Completed
Pull Request — master (#55)
by
unknown
01:16
created
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/Conditionals/SwitchMustContainDefaultRule.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,6 @@
 block discarded – undo
5 5
 
6 6
 use PhpParser\Node;
7 7
 use PhpParser\Node\Stmt\Switch_;
8
-use PhpParser\NodeTraverser;
9
-use PhpParser\NodeVisitorAbstract;
10 8
 use PHPStan\Analyser\Scope;
11 9
 use PHPStan\Rules\Rule;
12 10
 use TheCodingMachine\PHPStan\Utils\PrefixGenerator;
Please login to merge, or discard this patch.
src/Rules/Superglobals/NoSuperglobalsRule.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -5,10 +5,7 @@
 block discarded – undo
5 5
 
6 6
 use PhpParser\Node;
7 7
 use PHPStan\Analyser\Scope;
8
-use PHPStan\Reflection\FunctionReflection;
9
-use PHPStan\Reflection\MethodReflection;
10 8
 use PHPStan\Rules\Rule;
11
-use PHPStan\ShouldNotHappenException;
12 9
 use TheCodingMachine\PHPStan\Utils\PrefixGenerator;
13 10
 
14 11
 /**
Please login to merge, or discard this patch.
src/Rules/Exceptions/EmptyExceptionRule.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use PhpParser\Node;
7 7
 use PhpParser\Node\Stmt\Catch_;
8 8
 use PHPStan\Analyser\Scope;
9
-use PHPStan\Broker\Broker;
10 9
 use PHPStan\Rules\Rule;
11 10
 use function strpos;
12 11
 
Please login to merge, or discard this patch.
src/Rules/Exceptions/MustRethrowRule.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -6,14 +6,12 @@
 block discarded – undo
6 6
 use Exception;
7 7
 use function in_array;
8 8
 use PhpParser\Node;
9
-use PhpParser\NodeFinder;
10 9
 use PhpParser\Node\Stmt\Catch_;
11 10
 use PhpParser\NodeTraverser;
12 11
 use PhpParser\NodeVisitorAbstract;
13 12
 use PhpParser\Node\Expr\Variable;
14 13
 use PhpParser\Node\Expr\StaticCall;
15 14
 use PHPStan\Analyser\Scope;
16
-use PHPStan\Broker\Broker;
17 15
 use PHPStan\Rules\Rule;
18 16
 use RuntimeException;
19 17
 use TheCodingMachine\PHPStan\Utils\PrefixGenerator;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
         // Let's only apply the filter to \Exception, \RuntimeException or \Throwable
43 43
         $exceptionType = null;
44 44
         foreach ($node->types as $type) {
45
-            if (in_array((string)$type, [Exception::class, RuntimeException::class, Throwable::class], true)) {
46
-                $exceptionType = (string)$type;
45
+            if (in_array((string) $type, [Exception::class, RuntimeException::class, Throwable::class], true)) {
46
+                $exceptionType = (string) $type;
47 47
                 break;
48 48
             }
49 49
         }
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
                     return false;
109 109
                 }
110 110
 
111
-                $varArgs = array_filter($args, function ($arg) {
112
-                    return $arg->value instanceof Variable && $arg->value->name === $this->exceptionVarName ;
111
+                $varArgs = array_filter($args, function($arg) {
112
+                    return $arg->value instanceof Variable && $arg->value->name === $this->exceptionVarName;
113 113
                 });
114 114
 
115 115
                 return 0 !== count($varArgs);
Please login to merge, or discard this patch.