diff --git a/src/DotPathComponentFinder.php b/src/DotPathComponentFinder.php index b08a06c..e490fd7 100644 --- a/src/DotPathComponentFinder.php +++ b/src/DotPathComponentFinder.php @@ -49,7 +49,7 @@ private function resolveNamespaceFromAlias(string $alias): string { $namespace = $this->namespaces[$alias] ?? null; - if (!$namespace) { + if (! $namespace) { throw new InvalidArgumentException("View component namespace [$alias] doesn't exist."); } diff --git a/src/ViewComponentsServiceProvider.php b/src/ViewComponentsServiceProvider.php index b067e0e..b9c9c26 100644 --- a/src/ViewComponentsServiceProvider.php +++ b/src/ViewComponentsServiceProvider.php @@ -2,10 +2,10 @@ namespace Spatie\ViewComponents; -use Illuminate\Contracts\Support\Htmlable; +use InvalidArgumentException; use Illuminate\Support\Facades\Blade; use Illuminate\Support\ServiceProvider; -use InvalidArgumentException; +use Illuminate\Contracts\Support\Htmlable; class ViewComponentsServiceProvider extends ServiceProvider { @@ -16,11 +16,11 @@ public function boot() $componentClass = $this->app->make(ComponentFinder::class)->find($expressionParts[0]); - if (!class_exists($componentClass)) { + if (! class_exists($componentClass)) { throw new InvalidArgumentException("View component [{$componentClass}] not found."); } - if (!array_key_exists(Htmlable::class, class_implements($componentClass))) { + if (! array_key_exists(Htmlable::class, class_implements($componentClass))) { throw new InvalidArgumentException( "View component [{$componentClass}] must implement Illuminate\Support\Htmlable." ); diff --git a/tests/NamespacesTest.php b/tests/NamespacesTest.php index 8b5effe..c20b2dd 100644 --- a/tests/NamespacesTest.php +++ b/tests/NamespacesTest.php @@ -2,8 +2,8 @@ namespace Spatie\ViewComponents\Tests; -use Illuminate\Support\Facades\Blade; use InvalidArgumentException; +use Illuminate\Support\Facades\Blade; class NamespacesTest extends TestCase {