From 29f1be7f45f6fe4ffcf59a1c87bb469d47f1d227 Mon Sep 17 00:00:00 2001 From: rubenvanassche Date: Thu, 23 Dec 2021 13:28:01 +0000 Subject: [PATCH] Fix styling --- src/Context/LaravelRequestContext.php | 2 +- tests/Context/LaravelRequestContextTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Context/LaravelRequestContext.php b/src/Context/LaravelRequestContext.php index 69f5b3c7..74be8bdd 100644 --- a/src/Context/LaravelRequestContext.php +++ b/src/Context/LaravelRequestContext.php @@ -63,7 +63,7 @@ protected function getRouteParameters(): array ->map(function ($parameter) { return $parameter instanceof Model ? $parameter->withoutRelations() : $parameter; }) - ->map(function ($parameter){ + ->map(function ($parameter) { return method_exists($parameter, 'toFlare') ? $parameter->toFlare() : $parameter; }) ->toArray(); diff --git a/tests/Context/LaravelRequestContextTest.php b/tests/Context/LaravelRequestContextTest.php index 198f4a58..c2cd0ac8 100644 --- a/tests/Context/LaravelRequestContextTest.php +++ b/tests/Context/LaravelRequestContextTest.php @@ -84,14 +84,14 @@ public function it_will_call_the_to_flare_method_on_route_parameters_when_it_exi $route->bind($request); $request->setRouteResolver(function () use ($route) { - $route->setParameter('user', new class{ + $route->setParameter('user', new class () { public function toFlare(): array { return ['stripped']; } }); - return $route; + return $route; }); $context = new LaravelRequestContext($request);