Passed
Push — master ( 0ee5cf...8209bc )
by Fran
02:47
created
src/base/types/helpers/ApiFormHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/base/types/helpers/InjectorHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.
src/base/types/helpers/AnnotationHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.