Skip to content

Commit 050e60d

Browse files
committed
[stmts-aware] Use NodeGroup::STMTS_AWARE over StmtsAwareInterface
1 parent ac00ca3 commit 050e60d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rules/DowngradePhp73/Rector/FuncCall/DowngradeArrayKeyFirstLastRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private function refactorArrayKeyLast(
218218

219219
$resetExpression = new Expression($this->nodeFactory->createFuncCall('reset', [$array]));
220220

221-
if ($stmt instanceof StmtsAwareInterface) {
221+
if (property_exists($stmt, 'stmts')) {
222222
$stmt->stmts = array_merge([$resetExpression], $stmt->stmts);
223223
} elseif (! $stmt instanceof Return_) {
224224
$newStmts[] = $resetExpression;
@@ -230,7 +230,7 @@ private function refactorArrayKeyLast(
230230
private function resolvePrependNewStmt(
231231
Expr|Variable $array,
232232
FuncCall $funcCall,
233-
Stmt|StmtsAwareInterface $stmt
233+
Stmt|Node $stmt
234234
): Expression|If_ {
235235
if (! $stmt instanceof If_ || $stmt->cond instanceof FuncCall || ! $stmt->cond instanceof BooleanOr) {
236236
return new Expression($funcCall);

rules/DowngradePhp81/Rector/StmtsAwareInterface/DowngradeSetAccessibleReflectionPropertyRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function getNodeTypes(): array
8686
}
8787

8888
/**
89-
* @param StmtsAwareInterface $node
89+
* @param StmtsAware $node
9090
*/
9191
public function refactor(Node $node): ?Node
9292
{

0 commit comments

Comments
 (0)