Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"require-dev": {
"rector/rector-src": "dev-main",
"phpunit/phpunit": "^10.5",
"phpunit/phpunit": "^11.4",
"phpstan/phpstan": "^2.0",
"symplify/easy-coding-standard": "^12.3",
"phpstan/extension-installer": "^1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function refactor(Node $node): ?Node
// has dynamic return?
if ($hasDynamicReturnExprs === false) {
$returnedExpr = $methodCall->getArgs()[0]
->value;
->value;
$hasDynamicReturnExprs = ! $returnedExpr instanceof Scalar && ! $returnedExpr instanceof Array_;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function refactor(Node $node): ?Node
}

$firstArgumentValue = $node->getArgs()[0]
->value;
->value;
if (! $firstArgumentValue instanceof BinaryOp) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function refactor(Node $node): ?Node
}

$firstArgumentValue = $node->getArgs()[0]
->value;
->value;
if ($firstArgumentValue instanceof StaticCall) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function refactor(Node $node): ?Node
}

$firstArgumentValue = $node->getArgs()[0]
->value;
->value;
if (! $firstArgumentValue instanceof Instanceof_) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function refactor(Node $node): ?Node
}

$firstArgumentValue = $node->getArgs()[0]
->value;
->value;
if (! $firstArgumentValue instanceof BooleanNot) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function refactor(Node $node): ?Node
}

$firstArgumentValue = $node->getArgs()[0]
->value;
->value;
if (! $firstArgumentValue instanceof FuncCall) {
return null;
}
Expand All @@ -96,7 +96,7 @@ public function refactor(Node $node): ?Node
}

$propertyExistsMethodCall = $node->getArgs()[0]
->value;
->value;
if (! $propertyExistsMethodCall instanceof FuncCall) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions rules/CodeQuality/Rector/MethodCall/AssertRegExpRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function refactor(Node $node): ?Node

/** @var FuncCall|Node $secondArgumentValue */
$secondArgumentValue = $stmt->expr->getArgs()[1]
->value;
->value;

if (! $secondArgumentValue instanceof FuncCall) {
continue;
Expand Down Expand Up @@ -141,7 +141,7 @@ public function refactor(Node $node): ?Node
}

$oldFirstArgument = $stmt->expr->getArgs()[0]
->value;
->value;
$oldCondition = $this->resolveOldCondition($oldFirstArgument);

$this->renameMethod($stmt->expr, $oldMethodName, $oldCondition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function refactor(Node $node): ?Node
}

$firstArgumentValue = $node->getArgs()[0]
->value;
->value;
if (! $firstArgumentValue instanceof ConstFetch) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private function renameMethod(
private function moveFunctionArgumentsUp(MethodCall|StaticCall $node): void
{
$funcCallOrEmptyNode = $node->getArgs()[0]
->value;
->value;

if ($funcCallOrEmptyNode instanceof FuncCall) {
$funcCallOrEmptyNodeName = $this->getName($funcCallOrEmptyNode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function refactor(Node $node): ?Node
}

$onlyArgument = $node->getArgs()[0]
->value;
->value;
if (! $this->isMethodCallOnVariableNamed($onlyArgument, 'this', 'any')) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function (Node $node): bool {
}

return $node->getArgs()[0]
->value;
->value;
});

if ($hasAssertInside && $firstArg->value instanceof Array_) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function refactor(Node $node): ?Node
}

$typeNode = $node->getArgs()[0]
->value;
->value;
if (! $typeNode instanceof String_) {
return null;
}
Expand Down
Loading