@@ -3,10 +3,7 @@ discard block |
||
| 3 | 3 | namespace Mpociot\ApiDoc\Extracting\Strategies\Responses; |
| 4 | 4 | |
| 5 | 5 | use Exception; |
| 6 | -use Illuminate\Database\Eloquent\Model; |
|
| 7 | -use Illuminate\Database\Eloquent\Model as IlluminateModel; |
|
| 8 | 6 | use Illuminate\Routing\Route; |
| 9 | -use Illuminate\Support\Arr; |
|
| 10 | 7 | use League\Fractal\Manager; |
| 11 | 8 | use League\Fractal\Resource\Collection; |
| 12 | 9 | use League\Fractal\Resource\Item; |
@@ -16,7 +13,6 @@ discard block |
||
| 16 | 13 | use Mpociot\ApiDoc\Tools\Flags; |
| 17 | 14 | use Mpociot\ApiDoc\Tools\Utils; |
| 18 | 15 | use Mpociot\Reflection\DocBlock; |
| 19 | -use Mpociot\Reflection\DocBlock\Tag; |
|
| 20 | 16 | use ReflectionClass; |
| 21 | 17 | use ReflectionMethod; |
| 22 | 18 | |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | $fractal = new Manager(); |
| 70 | 70 | |
| 71 | - if (! is_null(config('apidoc.fractal.serializer'))) { |
|
| 71 | + if (!is_null(config('apidoc.fractal.serializer'))) { |
|
| 72 | 72 | $fractal->setSerializer(app(config('apidoc.fractal.serializer'))); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Mpociot\ApiDoc\Extracting; |
| 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\Support\Arr; |
| 9 | 8 | use Mpociot\ApiDoc\Tools\Flags; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | private function getClassToBeTransformed(array $tags, ReflectionMethod $transformerMethod): string |
| 39 | 39 | { |
| 40 | - $modelTag = Arr::first(array_filter($tags, function ($tag) { |
|
| 40 | + $modelTag = Arr::first(array_filter($tags, function($tag) { |
|
| 41 | 41 | return ($tag instanceof Tag) && strtolower($tag->getName()) == 'transformermodel'; |
| 42 | 42 | })); |
| 43 | 43 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $type = $modelTag->getContent(); |
| 47 | 47 | } else { |
| 48 | 48 | $parameter = Arr::first($transformerMethod->getParameters()); |
| 49 | - if ($parameter->hasType() && ! $parameter->getType()->isBuiltin() && class_exists($parameter->getType()->getName())) { |
|
| 49 | + if ($parameter->hasType() && !$parameter->getType()->isBuiltin() && class_exists($parameter->getType()->getName())) { |
|
| 50 | 50 | // Ladies and gentlemen, we have a type! |
| 51 | 51 | $type = $parameter->getType()->getName(); |
| 52 | 52 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | private function getTransformerTag(array $tags) |
| 108 | 108 | { |
| 109 | 109 | $transformerTags = array_values( |
| 110 | - array_filter($tags, function ($tag) { |
|
| 110 | + array_filter($tags, function($tag) { |
|
| 111 | 111 | return ($tag instanceof Tag) && in_array(strtolower($tag->getName()), ['transformer', 'transformercollection']); |
| 112 | 112 | }) |
| 113 | 113 | ); |
@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | private function getResponseParametersFromDocBlock($tags) |
| 13 | 13 | { |
| 14 | 14 | $parameters = collect($tags) |
| 15 | - ->filter(function ($tag) { |
|
| 15 | + ->filter(function($tag) { |
|
| 16 | 16 | return $tag instanceof Tag && $tag->getName() === 'responseParam'; |
| 17 | 17 | }) |
| 18 | - ->mapWithKeys(function (Tag $tag) { |
|
| 18 | + ->mapWithKeys(function(Tag $tag) { |
|
| 19 | 19 | // Format: |
| 20 | 20 | // @responseParam <name> <type> <description> |
| 21 | 21 | // Examples: |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $type = $this->normalizeParameterType($type); |
| 34 | 34 | list($description, $example) = $this->parseParamDescription($description, $type); |
| 35 | - $value = is_null($example) && ! $this->shouldExcludeExample($tag->getContent()) |
|
| 35 | + $value = is_null($example) && !$this->shouldExcludeExample($tag->getContent()) |
|
| 36 | 36 | ? $this->generateDummyValue($type) |
| 37 | 37 | : $example; |
| 38 | 38 | |