Completed
Pull Request — master (#11)
by David
04:06
created
src/Rules/Exceptions/DoNotThrowExceptionBaseClassRule.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,7 @@
 block discarded – undo
5 5
 
6 6
 
7 7
 use PhpParser\Node;
8
-use PhpParser\Node\Stmt\Catch_;
9 8
 use PHPStan\Analyser\Scope;
10
-use PHPStan\Broker\Broker;
11 9
 use PHPStan\Rules\Rule;
12 10
 
13 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
@@ -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/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 1 patch
Spacing   +6 added lines, -6 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
 
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
             foreach ($docblockWithoutNullable as $docblockTypehint) {
175 175
                 if (!$docblockTypehint instanceof Array_) {
176 176
                     if ($context instanceof ReflectionParameter) {
177
-                        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);
177
+                        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);
178 178
                     } else {
179
-                        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);
179
+                        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);
180 180
                     }
181 181
                 }
182 182
 
@@ -244,11 +244,11 @@  discard block
 block discarded – undo
244 244
         $type = $types[0];
245 245
 
246 246
         if ($this->isNativeType($type)) {
247
-            return ($isNullable?'?':'').((string)$type);
247
+            return ($isNullable ? '?' : '').((string) $type);
248 248
         }
249 249
 
250 250
         if ($type instanceof Array_) {
251
-            return ($isNullable?'?':'').'array';
251
+            return ($isNullable ? '?' : '').'array';
252 252
         }
253 253
 
254 254
         // TODO: more definitions to add here
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         // Manage array of things => (cast to array)
257 257
 
258 258
         if ($type instanceof Object_) {
259
-            return ($isNullable?'?':'').((string)$type);
259
+            return ($isNullable ? '?' : '').((string) $type);
260 260
         }
261 261
 
262 262
         return null;
Please login to merge, or discard this patch.