@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Mpociot\ApiDoc\Extracting\Strategies\Responses; |
| 4 | 4 | |
| 5 | 5 | use Exception; |
| 6 | -use Illuminate\Database\Eloquent\Model; |
|
| 7 | 6 | use Illuminate\Database\Eloquent\Model as IlluminateModel; |
| 8 | 7 | use Illuminate\Routing\Route; |
| 9 | 8 | use Illuminate\Support\Arr; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $fractal = new Manager(); |
| 67 | 67 | |
| 68 | - if (! is_null(config('apidoc.fractal.serializer'))) { |
|
| 68 | + if (!is_null(config('apidoc.fractal.serializer'))) { |
|
| 69 | 69 | $fractal->setSerializer(app(config('apidoc.fractal.serializer'))); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | ], |
| 85 | 85 | ]; |
| 86 | 86 | } catch (Exception $e) { |
| 87 | - echo 'Exception thrown when fetching transformer response for ['.implode(',', $route->methods)."] {$route->uri}.\n"; |
|
| 87 | + echo 'Exception thrown when fetching transformer response for [' . implode(',', $route->methods) . "] {$route->uri}.\n"; |
|
| 88 | 88 | if (Flags::$shouldBeVerbose) { |
| 89 | 89 | Utils::dumpException($e); |
| 90 | 90 | } else { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | private function getClassToBeTransformed(array $tags, ReflectionMethod $transformerMethod): string |
| 122 | 122 | { |
| 123 | - $modelTag = Arr::first(array_filter($tags, function ($tag) { |
|
| 123 | + $modelTag = Arr::first(array_filter($tags, function($tag) { |
|
| 124 | 124 | return ($tag instanceof Tag) && strtolower($tag->getName()) == 'transformermodel'; |
| 125 | 125 | })); |
| 126 | 126 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $type = $modelTag->getContent(); |
| 130 | 130 | } else { |
| 131 | 131 | $parameter = Arr::first($transformerMethod->getParameters()); |
| 132 | - if ($parameter->hasType() && ! $parameter->getType()->isBuiltin() && class_exists($parameter->getType()->getName())) { |
|
| 132 | + if ($parameter->hasType() && !$parameter->getType()->isBuiltin() && class_exists($parameter->getType()->getName())) { |
|
| 133 | 133 | // Ladies and gentlemen, we have a type! |
| 134 | 134 | $type = $parameter->getType()->getName(); |
| 135 | 135 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | private function getTransformerTag(array $tags) |
| 191 | 191 | { |
| 192 | 192 | $transformerTags = array_values( |
| 193 | - array_filter($tags, function ($tag) { |
|
| 193 | + array_filter($tags, function($tag) { |
|
| 194 | 194 | return ($tag instanceof Tag) && in_array(strtolower($tag->getName()), ['transformer', 'transformercollection']); |
| 195 | 195 | }) |
| 196 | 196 | ); |
@@ -14,25 +14,25 @@ |
||
| 14 | 14 | $faker->seed($this->config->get('faker_seed')); |
| 15 | 15 | } |
| 16 | 16 | $fakeFactories = [ |
| 17 | - 'integer' => function () use ($faker) { |
|
| 17 | + 'integer' => function() use ($faker) { |
|
| 18 | 18 | return $faker->numberBetween(1, 20); |
| 19 | 19 | }, |
| 20 | - 'number' => function () use ($faker) { |
|
| 20 | + 'number' => function() use ($faker) { |
|
| 21 | 21 | return $faker->randomFloat(); |
| 22 | 22 | }, |
| 23 | - 'float' => function () use ($faker) { |
|
| 23 | + 'float' => function() use ($faker) { |
|
| 24 | 24 | return $faker->randomFloat(); |
| 25 | 25 | }, |
| 26 | - 'boolean' => function () use ($faker) { |
|
| 26 | + 'boolean' => function() use ($faker) { |
|
| 27 | 27 | return $faker->boolean(); |
| 28 | 28 | }, |
| 29 | - 'string' => function () use ($faker) { |
|
| 29 | + 'string' => function() use ($faker) { |
|
| 30 | 30 | return $faker->word; |
| 31 | 31 | }, |
| 32 | - 'array' => function () { |
|
| 32 | + 'array' => function() { |
|
| 33 | 33 | return []; |
| 34 | 34 | }, |
| 35 | - 'object' => function () { |
|
| 35 | + 'object' => function() { |
|
| 36 | 36 | return new stdClass; |
| 37 | 37 | }, |
| 38 | 38 | ]; |