@@ -43,8 +43,8 @@ |
||
43 | 43 | |
44 | 44 | $path = $this->replaceNamedParameters($path, $parameters); |
45 | 45 | |
46 | - $path = preg_replace_callback('/\{.*?\}/', function ($match) use (&$parameters) { |
|
47 | - return (empty($parameters) && ! Str::endsWith($match[0], '?}')) |
|
46 | + $path = preg_replace_callback('/\{.*?\}/', function($match) use (&$parameters) { |
|
47 | + return (empty($parameters) && !Str::endsWith($match[0], '?}')) |
|
48 | 48 | ? $match[0] |
49 | 49 | : array_shift($parameters); |
50 | 50 | }, $path); |
@@ -92,7 +92,7 @@ |
||
92 | 92 | { |
93 | 93 | return $this->linksGroup |
94 | 94 | ->getLinkTypes() |
95 | - ->mapWithKeys(function (LinkType $linkType) use ($request) { |
|
95 | + ->mapWithKeys(function(LinkType $linkType) use ($request) { |
|
96 | 96 | $linkType->parameters($request->route()->parameters()); |
97 | 97 | |
98 | 98 | if ($linkType instanceof ControllerLinkType) { |
@@ -92,12 +92,12 @@ |
||
92 | 92 | |
93 | 93 | $action = is_array($this->action) ? $this->action[0] : $this->action; |
94 | 94 | |
95 | - return ! Str::contains($action, '@'); |
|
95 | + return !Str::contains($action, '@'); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | private function getParameters(?Model $model) |
99 | 99 | { |
100 | - if (! optional($model)->exists) { |
|
100 | + if (!optional($model)->exists) { |
|
101 | 101 | return $this->parameters; |
102 | 102 | } |
103 | 103 |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | private function resolveLinks(array $methodsToInclude, Model $model = null): array |
79 | 79 | { |
80 | 80 | $links = self::getRoutesForController($this->controller) |
81 | - ->filter(function (Route $route) use ($methodsToInclude) { |
|
81 | + ->filter(function(Route $route) use ($methodsToInclude) { |
|
82 | 82 | return in_array($route->getActionMethod(), $methodsToInclude); |
83 | 83 | }) |
84 | - ->map(function (Route $route) use ($model) { |
|
84 | + ->map(function(Route $route) use ($model) { |
|
85 | 85 | $route = RouteLinkType::make($route) |
86 | 86 | ->parameters($this->parameters) |
87 | 87 | ->name($this->resolveNameForRoute($route)) |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | }) |
95 | 95 | ->toArray(); |
96 | 96 | |
97 | - return ! empty($links) |
|
97 | + return !empty($links) |
|
98 | 98 | ? array_merge_recursive(...$links) |
99 | 99 | : []; |
100 | 100 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $routes = collect(resolve(Router::class)->getRoutes()->getRoutes()); |
109 | 109 | |
110 | 110 | self::$cachedRoutes[$controller] = $routes |
111 | - ->filter(function (Route $route) use ($controller) { |
|
111 | + ->filter(function(Route $route) use ($controller) { |
|
112 | 112 | return $controller === Str::before($route->getActionName(), '@'); |
113 | 113 | }); |
114 | 114 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | private function ensureUserDefinedMethodsExist() |
130 | 130 | { |
131 | 131 | foreach ($this->methods as $method) { |
132 | - if (! method_exists($this->controller, $method)) { |
|
132 | + if (!method_exists($this->controller, $method)) { |
|
133 | 133 | throw new Exception("Resource links tried to check non-existing method {$method} on controller: {$this->controller}"); |
134 | 134 | } |
135 | 135 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $providedParameters = $this->getProvidedParameters(); |
28 | 28 | |
29 | 29 | return collect($route->signatureParameters()) |
30 | - ->mapWithKeys(function (ReflectionParameter $signatureParameter) use ($providedParameters) { |
|
30 | + ->mapWithKeys(function(ReflectionParameter $signatureParameter) use ($providedParameters) { |
|
31 | 31 | return [ |
32 | 32 | $signatureParameter->getName() => $this->findParameter( |
33 | 33 | $signatureParameter, |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | ), |
36 | 36 | ]; |
37 | 37 | }) |
38 | - ->reject(function ($parameter) { |
|
38 | + ->reject(function($parameter) { |
|
39 | 39 | return $parameter === null; |
40 | 40 | }) |
41 | 41 | ->all(); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | foreach ($providedParameters as $index => $providedParameter) { |
64 | - if (! is_object($providedParameter) || $signatureParameter->getClass() === null) { |
|
64 | + if (!is_object($providedParameter) || $signatureParameter->getClass() === null) { |
|
65 | 65 | continue; |
66 | 66 | } |
67 | 67 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | $meta = self::meta(); |
13 | 13 | |
14 | - if (! count($meta)) { |
|
14 | + if (!count($meta)) { |
|
15 | 15 | return parent::collection($resource); |
16 | 16 | } |
17 | 17 |