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 Jan 3, 2024
1 parent 9127a1b commit f67cace
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/Rector/v8/v7/BackendUtilityGetRecordRawRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class BackendUtilityGetRecordRawRector extends AbstractRector
*/
public function getNodeTypes(): array
{
return [Node\Stmt\Expression::class];
return [Expression::class];
}

/**
Expand All @@ -52,6 +52,7 @@ public function refactor(Node $node): ?array
if (! $staticCall instanceof StaticCall) {
return null;
}

if (! $this->nodeTypeResolver->isMethodStaticCallOrClassMethodObjectType(
$staticCall,
new ObjectType('TYPO3\CMS\Backend\Utility\BackendUtility')
Expand All @@ -72,16 +73,12 @@ public function refactor(Node $node): ?array
$this->nodeFactory->createMethodCall(new Variable(self::QUERY_BUILDER), 'getRestrictions'),
'removeAll'
);

$nodes = [];
foreach ([
$nodes = [
new Nop(),
new Expression($queryBuilderAssign),
new Expression($queryBuilderRemoveRestrictions),
new Nop(),
] as $newNode) {
$nodes[] = $newNode;
}
];

$node->expr->expr = $this->fetchQueryBuilderResults($firstArgument, $secondArgument, $thirdArgument);

Expand Down

0 comments on commit f67cace

Please sign in to comment.