Completed
Push — master ( 861170...663fad )
by David
01:45
created
src/Rules/TypeHints/AbstractMissingTypeHintRule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -287,15 +287,15 @@  discard block
 block discarded – undo
287 287
         }
288 288
 
289 289
         if ($type instanceof ObjectType) {
290
-            return ($isNullable?'?':'').'\\'.$type->describe(VerbosityLevel::typeOnly());
290
+            return ($isNullable ? '?' : '').'\\'.$type->describe(VerbosityLevel::typeOnly());
291 291
         }
292 292
 
293 293
         if ($type instanceof ArrayType) {
294
-            return ($isNullable?'?':'').'array';
294
+            return ($isNullable ? '?' : '').'array';
295 295
         }
296 296
 
297 297
         if ($this->isNativeType($type)) {
298
-            return ($isNullable?'?':'').$type->describe(VerbosityLevel::typeOnly());
298
+            return ($isNullable ? '?' : '').$type->describe(VerbosityLevel::typeOnly());
299 299
         }
300 300
 
301 301
         // TODO: more definitions to add here
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
     private function typesWithoutNullable(Type $docBlockTypeHints): Type
346 346
     {
347 347
         if ($docBlockTypeHints instanceof UnionType) {
348
-            $filteredTypes = array_values(array_filter($docBlockTypeHints->getTypes(), function (Type $item) {
348
+            $filteredTypes = array_values(array_filter($docBlockTypeHints->getTypes(), function(Type $item) {
349 349
                 return !$item instanceof NullType;
350 350
             }));
351 351
             if (\count($filteredTypes) === 1) {
Please login to merge, or discard this patch.
src/Rules/Exceptions/MustRethrowRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@
 block discarded – undo
37 37
         // Let's only apply the filter to \Exception, \RuntimeException or \Throwable
38 38
         $exceptionType = null;
39 39
         foreach ($node->types as $type) {
40
-            if (in_array((string)$type, [Exception::class, RuntimeException::class, Throwable::class], true)) {
41
-                $exceptionType = (string)$type;
40
+            if (in_array((string) $type, [Exception::class, RuntimeException::class, Throwable::class], true)) {
41
+                $exceptionType = (string) $type;
42 42
                 break;
43 43
             }
44 44
         }
Please login to merge, or discard this patch.