Completed
Push — master ( bac13f...7bfd9a )
by David
11s
created
src/Rules/Exceptions/EmptyExceptionRule.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 use PhpParser\Node;
8 8
 use PhpParser\Node\Stmt\Catch_;
9 9
 use PHPStan\Analyser\Scope;
10
-use PHPStan\Broker\Broker;
11 10
 use PHPStan\Rules\Rule;
12 11
 
13 12
 class EmptyExceptionRule implements Rule
Please login to merge, or discard this patch.
src/Rules/Exceptions/ThrowMustBundlePreviousExceptionRule.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use PhpParser\NodeTraverser;
10 10
 use PhpParser\NodeVisitorAbstract;
11 11
 use PHPStan\Analyser\Scope;
12
-use PHPStan\Broker\Broker;
13 12
 use PHPStan\Rules\Rule;
14 13
 
15 14
 /**
Please login to merge, or discard this patch.
src/Rules/TypeHints/MissingTypeHintInFunctionRule.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,7 @@
 block discarded – undo
3 3
 
4 4
 namespace TheCodingMachine\PHPStan\Rules\TypeHints;
5 5
 
6
-use Roave\BetterReflection\Reflection\ReflectionFunction;
7 6
 use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract;
8
-use Roave\BetterReflection\Reflection\ReflectionMethod;
9 7
 use Roave\BetterReflection\Reflection\ReflectionParameter;
10 8
 use PhpParser\Node;
11 9
 
Please login to merge, or discard this patch.
src/Rules/TypeHints/MissingTypeHintInMethodRule.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,12 +3,9 @@
 block discarded – undo
3 3
 
4 4
 namespace TheCodingMachine\PHPStan\Rules\TypeHints;
5 5
 
6
-use Roave\BetterReflection\Reflection\ReflectionFunction;
7 6
 use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract;
8
-use Roave\BetterReflection\Reflection\ReflectionMethod;
9 7
 use Roave\BetterReflection\Reflection\ReflectionParameter;
10 8
 use PhpParser\Node;
11
-use PHPStan\Reflection\MethodReflection;
12 9
 
13 10
 class MissingTypeHintInMethodRule extends AbstractMissingTypeHintRule
14 11
 {
Please login to merge, or discard this patch.
src/Rules/TypeHints/AbstractMissingTypeHintRule.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@  discard block
 block discarded – undo
3 3
 
4 4
 namespace TheCodingMachine\PHPStan\Rules\TypeHints;
5 5
 
6
-use phpDocumentor\Reflection\DocBlockFactory;
7 6
 use phpDocumentor\Reflection\Type;
8 7
 use phpDocumentor\Reflection\Types\Array_;
9 8
 use phpDocumentor\Reflection\Types\Boolean;
@@ -26,8 +25,6 @@  discard block
 block discarded – undo
26 25
 use Roave\BetterReflection\Reflection\ReflectionMethod;
27 26
 use Roave\BetterReflection\Reflection\ReflectionParameter;
28 27
 use Roave\BetterReflection\Reflector\Exception\IdentifierNotFound;
29
-use Roave\BetterReflection\TypesFinder\PhpDocumentor\NamespaceNodeToReflectionTypeContext;
30
-use Roave\BetterReflection\TypesFinder\ResolveTypes;
31 28
 
32 29
 abstract class AbstractMissingTypeHintRule implements Rule
33 30
 {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace TheCodingMachine\PHPStan\Rules\TypeHints;
5 5
 
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
                 foreach ($docblockWithoutNullable as $docblockTypehint) {
197 197
                     if (!$this->isTypeIterable($docblockTypehint)) {
198 198
                         if ($context instanceof ReflectionParameter) {
199
-                            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);
199
+                            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 200
                         } else {
201
-                            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);
201
+                            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 202
                         }
203 203
                     }
204 204
 
@@ -307,11 +307,11 @@  discard block
 block discarded – undo
307 307
         $type = $types[0];
308 308
 
309 309
         if ($this->isNativeType($type)) {
310
-            return ($isNullable?'?':'').((string)$type);
310
+            return ($isNullable ? '?' : '').((string) $type);
311 311
         }
312 312
 
313 313
         if ($type instanceof Array_) {
314
-            return ($isNullable?'?':'').'array';
314
+            return ($isNullable ? '?' : '').'array';
315 315
         }
316 316
 
317 317
         // TODO: more definitions to add here
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
         // "object" type-hint is not available in PHP 7.1
322 322
         if ($type instanceof Object_ && (string) $type !== 'object') {
323
-            return ($isNullable?'?':'').((string)$type);
323
+            return ($isNullable ? '?' : '').((string) $type);
324 324
         }
325 325
 
326 326
         return null;
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
      */
364 364
     private function typesWithoutNullable(array $docBlockTypeHints): array
365 365
     {
366
-        return array_values(array_filter($docBlockTypeHints, function ($item) {
366
+        return array_values(array_filter($docBlockTypeHints, function($item) {
367 367
             return !$item instanceof Null_;
368 368
         }));
369 369
     }
Please login to merge, or discard this patch.