diff --git a/config/inertia-breadcrumbs.php b/config/inertia-breadcrumbs.php index b3b8fbb..e6ec888 100644 --- a/config/inertia-breadcrumbs.php +++ b/config/inertia-breadcrumbs.php @@ -3,8 +3,8 @@ use RobertBoes\InertiaBreadcrumbs\Classifier\AppendAllBreadcrumbs; use RobertBoes\InertiaBreadcrumbs\Classifier\IgnoreSingleBreadcrumbs; use RobertBoes\InertiaBreadcrumbs\Collectors\DiglacticBreadcrumbsCollector; -use RobertBoes\InertiaBreadcrumbs\Collectors\TabunaBreadcrumbsCollector; use RobertBoes\InertiaBreadcrumbs\Collectors\GretelBreadcrumbsCollector; +use RobertBoes\InertiaBreadcrumbs\Collectors\TabunaBreadcrumbsCollector; return [ 'middleware' => [ diff --git a/src/BreadcrumbCollection.php b/src/BreadcrumbCollection.php index 3172550..0e912c6 100644 --- a/src/BreadcrumbCollection.php +++ b/src/BreadcrumbCollection.php @@ -13,9 +13,7 @@ class BreadcrumbCollection implements Arrayable public Collection $items; /** - * - * @param array|Collection $items - * @param null|Closure(mixed): Breadcrumb $initializer + * @param null|Closure(mixed): Breadcrumb $initializer * @return void */ public function __construct(array|Collection $items, ?Closure $initializer = null) diff --git a/src/Collectors/DiglacticBreadcrumbsCollector.php b/src/Collectors/DiglacticBreadcrumbsCollector.php index 063dc9f..c032435 100644 --- a/src/Collectors/DiglacticBreadcrumbsCollector.php +++ b/src/Collectors/DiglacticBreadcrumbsCollector.php @@ -38,7 +38,7 @@ private function getBreadcrumbs(Request $request): Collection try { return Breadcrumbs::generate($route->getName(), ...array_values($route->parameters())); - } catch (InvalidBreadcrumbException | UnnamedRouteException) { + } catch (InvalidBreadcrumbException|UnnamedRouteException) { return collect(); } } diff --git a/src/Exceptions/PackageNotInstalledException.php b/src/Exceptions/PackageNotInstalledException.php index cdf06e1..577f6a9 100644 --- a/src/Exceptions/PackageNotInstalledException.php +++ b/src/Exceptions/PackageNotInstalledException.php @@ -8,6 +8,6 @@ class PackageNotInstalledException extends Exception { public function __construct(string $packageIdentifier) { - parent::__construct(sprintf("%s is not installed", $packageIdentifier)); + parent::__construct(sprintf('%s is not installed', $packageIdentifier)); } } diff --git a/tests/DiglacticCollectorTest.php b/tests/DiglacticCollectorTest.php index 3ca6913..74b9adb 100644 --- a/tests/DiglacticCollectorTest.php +++ b/tests/DiglacticCollectorTest.php @@ -35,7 +35,7 @@ public function usesCustomMiddlewareGroup($app) } /** - * @param \Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router */ public function defineRoutes($router) { @@ -86,7 +86,6 @@ public function it_throws_an_exception_when_package_is_not_installed() /** * @test - * */ public function it_collects_diglactic_breadcrumbs() { @@ -136,6 +135,7 @@ public function it_can_use_a_reserved_keyword() /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_resolves_a_single_route_parameter() @@ -182,6 +182,7 @@ public function it_returns_empty_collection_for_404_page() /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_ignores_the_query_string_by_default_when_determining_current_route() @@ -208,6 +209,7 @@ public function it_ignores_the_query_string_by_default_when_determining_current_ /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_does_not_ignore_query_parameters_when_configured_to_do_so_when_determining_current_route() diff --git a/tests/GretelCollectorTest.php b/tests/GretelCollectorTest.php index b9d888c..f4ba362 100644 --- a/tests/GretelCollectorTest.php +++ b/tests/GretelCollectorTest.php @@ -32,7 +32,7 @@ protected function getPackageProviders($app) } /** - * @param \Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router */ public function defineRoutes($router) { @@ -111,6 +111,7 @@ public function it_returns_empty_collection_for_404_page() /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_ignores_the_query_string_by_default_when_determining_current_route() @@ -134,6 +135,7 @@ public function it_ignores_the_query_string_by_default_when_determining_current_ /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_does_not_ignore_query_parameters_when_configured_to_do_so_when_determining_current_route() diff --git a/tests/Helpers/RequestBuilder.php b/tests/Helpers/RequestBuilder.php index abb7c48..aec76c7 100644 --- a/tests/Helpers/RequestBuilder.php +++ b/tests/Helpers/RequestBuilder.php @@ -14,11 +14,12 @@ class RequestBuilder * @example RequestBuilder::create('post.show', ['postId' => 1], PostShowRequest::class); * @example RequestBuilder::create('post.index'); * - * @param string $routeName Name of the route. - * @param array $parameters Array of route or input parameters. - * @param string $class Request class. - * @throws \Exception If the route name doesn't exist. + * @param string $routeName Name of the route. + * @param array $parameters Array of route or input parameters. + * @param string $class Request class. * @return Request + * + * @throws \Exception If the route name doesn't exist. */ public static function create(string $routeName, array $parameters = [], string $class = Request::class) { diff --git a/tests/MiddlewareTest.php b/tests/MiddlewareTest.php index bb52a22..1971ea2 100644 --- a/tests/MiddlewareTest.php +++ b/tests/MiddlewareTest.php @@ -27,7 +27,7 @@ public function hasMiddlewareDisabled($app) } /** - * @param \Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router */ public function defineRoutes($router) { @@ -53,6 +53,7 @@ public function it_adds_middleware_to_web_group() /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_adds_middleware_to_custom_group() @@ -69,6 +70,7 @@ public function it_adds_middleware_to_custom_group() /** * @test + * * @define-env hasMiddlewareDisabled */ public function it_only_adds_middleware_when_enabled_in_config() @@ -78,6 +80,7 @@ public function it_only_adds_middleware_when_enabled_in_config() /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_adds_breadcrumbs_for_current_route() @@ -104,6 +107,7 @@ public function it_adds_breadcrumbs_for_current_route() /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_adds_diglactic_breadcrumbs_with_additional_data() @@ -131,6 +135,7 @@ public function it_adds_diglactic_breadcrumbs_with_additional_data() /** * @test + * * @define-env usesCustomMiddlewareGroup * @define-env usesCustomSharedKey */ @@ -159,6 +164,7 @@ public function it_does_change_key_of_breadcrumb() /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_does_not_add_breadcrumbs_when_route_has_no_breadcrumbs() diff --git a/tests/SerializationTest.php b/tests/SerializationTest.php index a5caa20..67416a4 100644 --- a/tests/SerializationTest.php +++ b/tests/SerializationTest.php @@ -13,7 +13,7 @@ class SerializationTest extends TestCase { /** - * @param \Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router */ public function defineRoutes($router): void { diff --git a/tests/TabunaCollectorTest.php b/tests/TabunaCollectorTest.php index 4f45e56..c1afaea 100644 --- a/tests/TabunaCollectorTest.php +++ b/tests/TabunaCollectorTest.php @@ -27,7 +27,7 @@ protected function collector(): string } /** - * @param \Illuminate\Routing\Router $router + * @param \Illuminate\Routing\Router $router */ public function defineRoutes($router) { @@ -138,6 +138,7 @@ public function it_returns_empty_collection_for_404_page() /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_ignores_the_query_string_by_default_when_determining_current_route() @@ -166,6 +167,7 @@ public function it_ignores_the_query_string_by_default_when_determining_current_ /** * @test + * * @define-env usesCustomMiddlewareGroup */ public function it_does_not_ignore_query_parameters_when_configured_to_do_so_when_determining_current_route()