@@ -19,11 +19,11 @@ |
||
19 | 19 | public static function checkApiActions($namespace, $domain, $api) { |
20 | 20 | $actions = []; |
21 | 21 | $reflector = new ReflectionClass($namespace); |
22 | - if(null !== $reflector) { |
|
23 | - foreach($reflector->getMethods(ReflectionMethod::IS_PUBLIC) as $apiAction) { |
|
22 | + if (null !== $reflector) { |
|
23 | + foreach ($reflector->getMethods(ReflectionMethod::IS_PUBLIC) as $apiAction) { |
|
24 | 24 | $docComments = $apiAction->getDocComment(); |
25 | 25 | $action = AnnotationHelper::extractAction($docComments); |
26 | - if(null !== $action) { |
|
26 | + if (null !== $action) { |
|
27 | 27 | list($route, $info) = RouterHelper::extractRouteInfo($apiAction, $api, $domain); |
28 | 28 | list($method, $cleanRoute) = RouterHelper::extractHttpRoute($route); |
29 | 29 | $formAction = new FormAction(); |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | $label = self::getLabel($property->getDocComment()); |
32 | 32 | $values = self::getValues($property->getDocComment()); |
33 | 33 | $isArray = (bool)preg_match('/\[\]$/', $instanceType); |
34 | - if($isArray) { |
|
34 | + if ($isArray) { |
|
35 | 35 | $instanceType = str_replace('[]', '', $instanceType); |
36 | 36 | } |
37 | - if($instanceType === '\\DateTime' || !Router::exists($instanceType)) { |
|
37 | + if ($instanceType === '\\DateTime' || !Router::exists($instanceType)) { |
|
38 | 38 | list($type, $format) = DocumentorHelper::translateSwaggerFormats($instanceType); |
39 | 39 | $variables[$property->getName()] = [ |
40 | 40 | 'type' => $type, |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | 'required' => $isRequired, |
43 | 43 | 'description' => $label, |
44 | 44 | ]; |
45 | - } else { |
|
45 | + }else { |
|
46 | 46 | $instance = new ReflectionClass($instanceType); |
47 | 47 | $variables[$property->getName()] = [ |
48 | 48 | 'is_array' => $isArray, |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'properties' => self::extractVariables($instance), |
52 | 52 | ]; |
53 | 53 | } |
54 | - if(!empty($values)){ |
|
54 | + if (!empty($values)) { |
|
55 | 55 | $variables[$property->getName()]['enum'] = $values; |
56 | 56 | } |
57 | 57 | } |
@@ -155,13 +155,13 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public static function constructInjectableInstance($variable, $singleton, $classNameSpace, $calledClass) |
157 | 157 | { |
158 | - Logger::log('Create inyectable instance for ' . $classNameSpace); |
|
158 | + Logger::log('Create inyectable instance for '.$classNameSpace); |
|
159 | 159 | $reflector = new ReflectionClass($calledClass); |
160 | 160 | $property = $reflector->getProperty($variable); |
161 | 161 | $varInstanceType = (null === $classNameSpace) ? InjectorHelper::extractVarType($property->getDocComment()) : $classNameSpace; |
162 | 162 | if (true === $singleton && method_exists($varInstanceType, 'getInstance')) { |
163 | 163 | $instance = $varInstanceType::getInstance(); |
164 | - } else { |
|
164 | + }else { |
|
165 | 165 | $instance = new $varInstanceType(); |
166 | 166 | } |
167 | 167 | return $instance; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | public static function getClassProperties($class) |
176 | 176 | { |
177 | 177 | $properties = []; |
178 | - Logger::log('Extracting annotations properties from class ' . $class); |
|
178 | + Logger::log('Extracting annotations properties from class '.$class); |
|
179 | 179 | $selfReflector = new ReflectionClass($class); |
180 | 180 | if (false !== $selfReflector->getParentClass()) { |
181 | 181 | $properties = self::getClassProperties($selfReflector->getParentClass()->getName()); |
@@ -92,7 +92,7 @@ |
||
92 | 92 | * @return string|null |
93 | 93 | */ |
94 | 94 | public static function extractFromDoc($needle, $comments, $default = null) { |
95 | - preg_match('/@' . $needle . '\ (.*)(\n|\r)/im', $comments, $matches); |
|
95 | + preg_match('/@'.$needle.'\ (.*)(\n|\r)/im', $comments, $matches); |
|
96 | 96 | return (count($matches) > 0) ? $matches[1] : $default; |
97 | 97 | } |
98 | 98 | } |