From 7bcea4ed5ca17477044a4f7eef9a059f903534d1 Mon Sep 17 00:00:00 2001 From: freekmurze Date: Wed, 17 Jul 2024 12:27:50 +0000 Subject: [PATCH] Fix styling --- src/RouteResolver.php | 25 +++++++++++++------------ src/RouteTestingTestCall.php | 8 ++++---- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/RouteResolver.php b/src/RouteResolver.php index e4ffcf4..e6fdcfb 100644 --- a/src/RouteResolver.php +++ b/src/RouteResolver.php @@ -55,7 +55,7 @@ public function exceptPaths(array $paths): self return $this; } - + public function bindingNames(array $bindingNames): self { $this->bindingNames = $bindingNames; @@ -66,7 +66,7 @@ public function bindingNames(array $bindingNames): self public function exceptRoutesWithMissingBindings(): self { $this->exceptRoutesWithMissingBindings = true; - + return $this; } @@ -87,16 +87,17 @@ public function getFilteredRouteList(): array return true; }) - ->when($this->exceptRoutesWithMissingBindings, function(Collection $routes) { - return $routes->filter(function($route) { - $uriBindings = $this->getBindingsFromUrl($route['uri']); - - if (count($uriBindings) === 0) { - return true; - } - dump($uriBindings, $this->bindingNames); - return count(array_diff($uriBindings, $this->bindingNames)) === 0; - }); + ->when($this->exceptRoutesWithMissingBindings, function (Collection $routes) { + return $routes->filter(function ($route) { + $uriBindings = $this->getBindingsFromUrl($route['uri']); + + if (count($uriBindings) === 0) { + return true; + } + dump($uriBindings, $this->bindingNames); + + return count(array_diff($uriBindings, $this->bindingNames)) === 0; + }); }) ->toArray(); } diff --git a/src/RouteTestingTestCall.php b/src/RouteTestingTestCall.php index 0e5e350..205961b 100644 --- a/src/RouteTestingTestCall.php +++ b/src/RouteTestingTestCall.php @@ -22,7 +22,7 @@ class RouteTestingTestCall /** @var array */ protected array $assertions = []; - + public function __construct(TestCall $testCall) { $this->testCall = $testCall; @@ -46,11 +46,11 @@ protected function with(array $routes): self return $this; } - + public function ignoreRoutesWithMissingBindings(): self { $this->routeResolver->exceptRoutesWithMissingBindings($this->bindingNames); - + $this->with($this->routeResolver->getFilteredRouteList()); return $this; @@ -73,7 +73,7 @@ public function bind(string $binding, Closure $closure): self RouteTest::bind($binding, $closure); $this->bindingNames = array_merge($this->bindingNames, [$binding]); - + $this->routeResolver->bindingNames($this->bindingNames); $this->with($this->routeResolver->getFilteredRouteList());