@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ]; |
| 96 | 96 | } catch (\Exception $e) { |
| 97 | 97 | echo 'Exception thrown when fetching Eloquent API resource response for ['.implode(',', |
| 98 | - $route->methods)."] {$route->uri}.\n"; |
|
| 98 | + $route->methods)."] {$route->uri}.\n"; |
|
| 99 | 99 | if (Flags::$shouldBeVerbose) { |
| 100 | 100 | Utils::dumpException($e); |
| 101 | 101 | } else { |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | array_filter($tags, |
| 117 | 117 | function ($tag) { |
| 118 | 118 | return ($tag instanceof Tag) && in_array(strtolower($tag->getName()), |
| 119 | - [ |
|
| 120 | - 'apiresource', |
|
| 121 | - 'apiresourcecollection' |
|
| 122 | - ]); |
|
| 119 | + [ |
|
| 120 | + 'apiresource', |
|
| 121 | + 'apiresourcecollection' |
|
| 122 | + ]); |
|
| 123 | 123 | }) |
| 124 | 124 | ); |
| 125 | 125 | |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | ], |
| 95 | 95 | ]; |
| 96 | 96 | } catch (\Exception $e) { |
| 97 | - echo 'Exception thrown when fetching Eloquent API resource response for ['.implode(',', |
|
| 98 | - $route->methods)."] {$route->uri}.\n"; |
|
| 97 | + echo 'Exception thrown when fetching Eloquent API resource response for [' . implode(',', |
|
| 98 | + $route->methods) . "] {$route->uri}.\n"; |
|
| 99 | 99 | if (Flags::$shouldBeVerbose) { |
| 100 | 100 | Utils::dumpException($e); |
| 101 | 101 | } else { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | private function getApiResourceTag(array $tags) { |
| 115 | 115 | $apiResourceTags = array_values( |
| 116 | 116 | array_filter($tags, |
| 117 | - function ($tag) { |
|
| 117 | + function($tag) { |
|
| 118 | 118 | return ($tag instanceof Tag) && in_array(strtolower($tag->getName()), |
| 119 | 119 | [ |
| 120 | 120 | 'apiresource', |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | private function getClassToBeTransformed(array $tags): string { |
| 149 | 149 | $modelTag = Arr::first(array_filter($tags, |
| 150 | - function ($tag) { |
|
| 150 | + function($tag) { |
|
| 151 | 151 | return ($tag instanceof Tag) && strtolower($tag->getName()) == 'apiresourcemodel'; |
| 152 | 152 | })); |
| 153 | 153 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | // but the user might write it that way in a comment. Let's be safe. |
| 174 | 174 | $type = ltrim($type, '\\'); |
| 175 | 175 | |
| 176 | - if($states !== []){ |
|
| 176 | + if ($states !== []) { |
|
| 177 | 177 | return factory($type)->states($states)->make(); |
| 178 | 178 | } |
| 179 | 179 | |
@@ -205,11 +205,11 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | private function getApiResourceStates(array $tags) { |
| 207 | 207 | $tagz = collect($tags); |
| 208 | - $tag = $tagz->filter(function(Tag $tag){ |
|
| 208 | + $tag = $tagz->filter(function(Tag $tag) { |
|
| 209 | 209 | return strtolower($tag->getName()) === 'apiresourcestate'; |
| 210 | 210 | })->first(); |
| 211 | 211 | |
| 212 | - if(!$tag)return []; |
|
| 212 | + if (!$tag)return []; |
|
| 213 | 213 | return explode(',', $tag->getContent()); |
| 214 | 214 | // $apiResourceTags = array_values( |
| 215 | 215 | // array_filter($tags, |
@@ -209,7 +209,9 @@ |
||
| 209 | 209 | return strtolower($tag->getName()) === 'apiresourcestate'; |
| 210 | 210 | })->first(); |
| 211 | 211 | |
| 212 | - if(!$tag)return []; |
|
| 212 | + if(!$tag) { |
|
| 213 | + return []; |
|
| 214 | + } |
|
| 213 | 215 | return explode(',', $tag->getContent()); |
| 214 | 216 | // $apiResourceTags = array_values( |
| 215 | 217 | // array_filter($tags, |