Skip to content

Commit

Permalink
[ci-review] Rector Rectify
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 7, 2021
1 parent 89086c0 commit 7d76851
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private function matchClassMethodOnlyStmt(ClassMethod $classMethod): null | Stmt
return null;
}

if (count($classMethod->stmts) !== 1) {
if (count((array) $classMethod->stmts) !== 1) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use PhpParser\Node\Stmt\Interface_;
use PhpParser\Node\Stmt\Return_;
use PhpParser\NodeFinder;
use PHPStan\Analyser\MutatingScope;
use PHPStan\Type\MixedType;
use PHPStan\Type\ObjectType;
use PHPStan\Type\ThisType;
Expand All @@ -37,7 +36,7 @@ final class FluentChainMethodCallNodeAnalyzer
* Types that look like fluent interface, but actually create a new object.
* Should be skipped, as they return different object. Not an fluent interface!
*
* @var class-string<MutatingScope>[]
* @var string[]
*/
private const KNOWN_FACTORY_FLUENT_TYPES = ['PHPStan\Analyser\MutatingScope'];

Expand Down
2 changes: 1 addition & 1 deletion rules/Defluent/Rector/ClassMethod/NormalToFluentRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function refactor(Node $node): ?Node
return null;
}

$classMethodStatementCount = count($node->stmts);
$classMethodStatementCount = count((array) $node->stmts);

// iterate from bottom to up, so we can merge
for ($i = $classMethodStatementCount - 1; $i >= 0; --$i) {
Expand Down
2 changes: 1 addition & 1 deletion rules/Defluent/Skipper/FluentMethodCallSkipper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class FluentMethodCallSkipper
* Skip query and builder
* @see https://ocramius.github.io/blog/fluent-interfaces-are-evil/ "When does a fluent interface make sense?
*
* @var class-string[]
* @var string[]
*/
private const ALLOWED_FLUENT_TYPES = [
// symfony
Expand Down
2 changes: 1 addition & 1 deletion rules/Php70/Rector/ClassMethod/Php4ConstructorRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function refactor(Node $node): ?Node
return null;
}

if (count($node->stmts) === 1) {
if (count((array) $node->stmts) === 1) {
/** @var Expression|Expr $stmt */
$stmt = $node->stmts[0];
if (! $stmt instanceof Expression) {
Expand Down

0 comments on commit 7d76851

Please sign in to comment.