@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | use Mpociot\ApiDoc\Strategies\Strategy; |
| 11 | 11 | use Mpociot\ApiDoc\Tools\Traits\DocBlockParamHelpers; |
| 12 | 12 | |
| 13 | -class GetFromRequestClass extends Strategy{ |
|
| 13 | +class GetFromRequestClass extends Strategy { |
|
| 14 | 14 | |
| 15 | 15 | use DocBlockParamHelpers; |
| 16 | 16 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | ? $paramType->__toString() |
| 28 | 28 | : $paramType->getName(); |
| 29 | 29 | |
| 30 | - $parameters = array_merge($parameters , $this->getBodyParametersFromRequestClass($parameterClassName)); |
|
| 30 | + $parameters = array_merge($parameters, $this->getBodyParametersFromRequestClass($parameterClassName)); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | return $parameters; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $instance = $r->newInstanceWithoutConstructor(); |
| 42 | 42 | $parameters = $instance->rules(); |
| 43 | 43 | foreach ($parameters as $key => $value) { |
| 44 | - $arrayParams = array_merge($arrayParams,$this->explodeParams($key , $value)); |
|
| 44 | + $arrayParams = array_merge($arrayParams, $this->explodeParams($key, $value)); |
|
| 45 | 45 | } |
| 46 | 46 | } catch (Throwable $e) { |
| 47 | 47 | echo $e->getMessage(); |
@@ -50,19 +50,19 @@ discard block |
||
| 50 | 50 | return $arrayParams; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - public function explodeParams($field , $paramsValue){ |
|
| 53 | + public function explodeParams($field, $paramsValue) { |
|
| 54 | 54 | $params = explode('|', $paramsValue); |
| 55 | 55 | $required = false; |
| 56 | 56 | $description = []; |
| 57 | 57 | $type = ''; |
| 58 | - foreach($params as $param){ |
|
| 59 | - if($param === 'required'){ |
|
| 58 | + foreach ($params as $param) { |
|
| 59 | + if ($param === 'required') { |
|
| 60 | 60 | $required = true; |
| 61 | 61 | } |
| 62 | - elseif($param === 'string' || $param === 'integer' ||$param === 'array' ||$param === 'boolean' ||$param === 'float' ||$param === 'number'|| $param === 'object'){ |
|
| 62 | + elseif ($param === 'string' || $param === 'integer' || $param === 'array' || $param === 'boolean' || $param === 'float' || $param === 'number' || $param === 'object') { |
|
| 63 | 63 | $type = $param; |
| 64 | 64 | } |
| 65 | - else{ |
|
| 65 | + else { |
|
| 66 | 66 | $description [] = $param; |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | return [ |
| 71 | 71 | $field=> [ |
| 72 | 72 | 'type'=> $type, |
| 73 | - 'description'=> implode(" ",$description), |
|
| 73 | + 'description'=> implode(" ", $description), |
|
| 74 | 74 | 'required'=>$required, |
| 75 | 75 | 'value'=>$this->generateDummyValue($type) |
| 76 | 76 | ] |