Skip to content

Commit

Permalink
bump phpstan to 0.11.5
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Mar 27, 2019
1 parent ea38832 commit bbad5b8
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 26 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"nette/robot-loader": "^3.1",
"nette/utils": "^2.5",
"nikic/php-parser": "^4.2.1",
"phpstan/phpstan": "0.11.3",
"phpstan/phpstan": "0.11.5",
"sebastian/diff": "^3.0",
"symfony/console": "^3.4|^4.2",
"symfony/dependency-injection": "^3.4|^4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ public function refactor(Node $node): ?Node
return new BooleanOr($node->left, $node->right);
}

if ($node instanceof LogicalAnd) {
return new BooleanAnd($node->left, $node->right);
}

return null;
return new BooleanAnd($node->left, $node->right);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ public function refactor(Node $node): ?Node
return new Identical($node->left, $node->right);
}

if ($node instanceof NotEqual) {
return new NotIdentical($node->left, $node->right);
}

return $node;
return new NotIdentical($node->left, $node->right);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,11 @@ private function shouldSkip(Node $node): bool
return ! $this->isTypes($node, $this->requestTypes);
}

if ($node instanceof FuncCall) {
$class = $node->getAttribute(Attribute::CLASS_NODE);
if (! $class instanceof Class_) {
return true;
}

return ! $this->isName($node, 'request');
$class = $node->getAttribute(Attribute::CLASS_NODE);
if (! $class instanceof Class_) {
return true;
}

return true;
return ! $this->isName($node, 'request');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,7 @@ public function refactor(Node $node): ?Node
return $this->processMethodCall($node);
}

if ($node instanceof BinaryOp) {
return $this->processBinaryOp($node);
}

return $node;
return $this->processBinaryOp($node);
}

private function processMethodCall(MethodCall $methodCall): ?MethodCall
Expand Down
10 changes: 8 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ parameters:
- '*packages/BetterReflection/tests/Reflector/NotLoadedSource/SomeClass.php'
- 'packages/NodeTypeResolver/tests/PerNodeTypeResolver/VariableTypeResolver/Source/NewClass.php'
# tests files
- '*tests/**/Fixture/*'
- '*tests/**/Source/*'
- '*tests/*/Fixture/*'
- '*tests/*/Source/*'
- '*tests/Source/*'
- 'packages/NodeTypeResolver/tests/Source/SomeClass.php'
# intetionally original
- 'packages/Php/src/EregToPcreTransformer.php'
- '*/packages/ContributorTools/templates/*'
Expand Down Expand Up @@ -136,3 +138,7 @@ parameters:
- '#Parameter \#2 \$classMethod of method Rector\\NetteToSymfony\\Rector\\ClassMethod\\RouterListToControllerAnnotationsRector\:\:resolvePathFromClassAndMethodNodes\(\) expects PhpParser\\Node\\Stmt\\ClassMethod, PhpParser\\Node\\Stmt given#'
- '#Parameter \#2 \$constFetch of method Rector\\CodeQuality\\Rector\\Identical\\SimplifyArraySearchRector\:\:resolveIsNot\(\) expects PhpParser\\Node\\Expr\\ConstFetch, PhpParser\\Node given#'
- '#(.*?)PhpParser\\Node\\Expr\\Error\|PhpParser\\Node\\Expr\\Variable given#'

# false positive 0.11.5
- '#Unreachable statement \- code above always terminates#'
- '#Method Rector\\NodeTypeResolver\\NodeVisitor\\(.*?)\:\:enterNode\(\) should return int\|PhpParser\\Node\|void\|null but return statement is missing#'
11 changes: 11 additions & 0 deletions src/Exception/ShouldBeImplementedException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php declare(strict_types=1);

namespace Rector\Exception;

use Exception;

final class ShouldBeImplementedException extends Exception
{

}

3 changes: 3 additions & 0 deletions src/Testing/PHPUnit/AbstractRectorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Nette\Utils\Strings;
use Rector\Application\FileProcessor;
use Rector\Configuration\Option;
use Rector\Exception\ShouldBeImplementedException;
use Rector\Exception\ShouldNotHappenException;
use Rector\HttpKernel\RectorKernel;
use Symfony\Component\Yaml\Yaml;
Expand Down Expand Up @@ -86,11 +87,13 @@ protected function provideConfig(): string
}

// to be implemented
throw new ShouldBeImplementedException();
}

protected function getRectorClass(): string
{
// to be implemented
return '';
}

/**
Expand Down

0 comments on commit bbad5b8

Please sign in to comment.