Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Nikolaou committed Mar 1, 2025
1 parent d91889e commit 41545a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Components/SqlComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function render(): Closure
}

/**
* @param ComponentAttributeBag<string,string> $attributes
* @param ComponentAttributeBag<string,string> $attributes
*/
private function format(Htmlable $slot, ComponentAttributeBag $attributes): string
{
Expand All @@ -42,17 +42,17 @@ private function format(Htmlable $slot, ComponentAttributeBag $attributes): stri
}

/**
* @param ComponentAttributeBag<string,string> $attributes
* @param ComponentAttributeBag<string,string> $attributes
*/
private function highlighter(ComponentAttributeBag $attributes): Highlighter
{
return $this->highlight
? app(Highlighter::class, ['htmlAttributes' => $this->formatAttributes($attributes)])
: new NullHighlighter();
: new NullHighlighter;
}

/**
* @param ComponentAttributeBag<string,string> $attributes
* @param ComponentAttributeBag<string,string> $attributes
* @return array<string,string>
*/
private function formatAttributes(ComponentAttributeBag $attributes): array
Expand Down
4 changes: 2 additions & 2 deletions tests/SqlComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$sql = "select * from `users` where `email` = '[email protected]'";

$blade = test()->blade('<x-sql :highlight="false">{!! $sql !!}</x-sql>', ['sql' => $sql]);
$formatted = (new SqlFormatter(new NullHighlighter()))->format($sql);
$formatted = (new SqlFormatter(new NullHighlighter))->format($sql);

expect((string) $blade)->toBe($formatted);
});
Expand All @@ -36,7 +36,7 @@
$sql = "select * from `users` where `email` = '[email protected]'";

$blade = test()->blade(sprintf('<x-sql :format="false" :highlight="false">%s</x-sql>', $sql));
$plain = (new SqlFormatter(new NullHighlighter()))->highlight($sql);
$plain = (new SqlFormatter(new NullHighlighter))->highlight($sql);

expect((string) $blade)->toBe($plain);
});
Expand Down

0 comments on commit 41545a5

Please sign in to comment.