@@ -6,14 +6,12 @@ |
||
| 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; |
@@ -42,8 +42,8 @@ discard block |
||
| 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 |
||
| 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); |