Completed
Pull Request — master (#25)
by Filippo
08:26
created
src/Rules/TypeHints/AbstractMissingTypeHintRule.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
                 foreach ($docblockWithoutNullable as $docblockTypehint) {
198 198
                     if (!$this->isTypeIterable($docblockTypehint)) {
199 199
                         if ($context instanceof ReflectionParameter) {
200
-                            return sprintf('%s, mismatching type-hints for parameter %s. PHP type hint is "array" and docblock type hint is %s.', $this->getContext($context), $context->getName(), (string)$docblockTypehint);
200
+                            return sprintf('%s, mismatching type-hints for parameter %s. PHP type hint is "array" and docblock type hint is %s.', $this->getContext($context), $context->getName(), (string) $docblockTypehint);
201 201
                         } else {
202
-                            return sprintf('%s, mismatching type-hints for return type. PHP type hint is "array" and docblock declared return type is %s.', $this->getContext($context), (string)$docblockTypehint);
202
+                            return sprintf('%s, mismatching type-hints for return type. PHP type hint is "array" and docblock declared return type is %s.', $this->getContext($context), (string) $docblockTypehint);
203 203
                         }
204 204
                     }
205 205
 
@@ -308,11 +308,11 @@  discard block
 block discarded – undo
308 308
         $type = $types[0];
309 309
 
310 310
         if ($this->isNativeType($type)) {
311
-            return ($isNullable?'?':'').((string)$type);
311
+            return ($isNullable ? '?' : '').((string) $type);
312 312
         }
313 313
 
314 314
         if ($type instanceof Array_) {
315
-            return ($isNullable?'?':'').'array';
315
+            return ($isNullable ? '?' : '').'array';
316 316
         }
317 317
 
318 318
         // TODO: more definitions to add here
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 
322 322
         // "object" type-hint is not available in PHP 7.1
323 323
         if ($type instanceof Object_ && (string) $type !== 'object') {
324
-            return ($isNullable?'?':'').((string)$type);
324
+            return ($isNullable ? '?' : '').((string) $type);
325 325
         }
326 326
 
327 327
         return null;
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
      */
365 365
     private function typesWithoutNullable(array $docBlockTypeHints): array
366 366
     {
367
-        return array_values(array_filter($docBlockTypeHints, function ($item) {
367
+        return array_values(array_filter($docBlockTypeHints, function($item) {
368 368
             return !$item instanceof Null_;
369 369
         }));
370 370
     }
Please login to merge, or discard this patch.