/opt/cpanel/ea-wappspector/vendor/rector/rector/src/NodeManipulator
NameSizeModeActions
AssignManipulator.php29950644editdlrm
BinaryOpManipulator.php49440644editdlrm
ClassConstManipulator.php26690644editdlrm
ClassDependencyManipulator.php93010644editdlrm
ClassInsertManipulator.php26690644editdlrm
ClassManipulator.php18350644editdlrm
ClassMethodAssignManipulator.php18920644editdlrm
ClassMethodManipulator.php22290644editdlrm
ClassMethodPropertyFetchManipulator.php43500644editdlrm
FuncCallManipulator.php11080644editdlrm
FunctionLikeManipulator.php7550644editdlrm
IfManipulator.php63420644editdlrm
PropertyFetchAssignManipulator.php25150644editdlrm
PropertyManipulator.php88620644editdlrm
StmtsManipulator.php31550644editdlrm
Edit: /opt/cpanel/ea-wappspector/vendor/rector/rector/src/NodeManipulator/StmtsManipulator.php (3155B)
simpleCallableNodeTraverser = $simpleCallableNodeTraverser; $this->betterNodeFinder = $betterNodeFinder; $this->nodeComparator = $nodeComparator; $this->exprUsedInNodeAnalyzer = $exprUsedInNodeAnalyzer; } /** * @param Stmt[] $stmts */ public function getUnwrappedLastStmt(array $stmts) : ?Node { \end($stmts); $lastStmtKey = \key($stmts); \reset($stmts); $lastStmt = $stmts[$lastStmtKey]; if ($lastStmt instanceof Expression) { return $lastStmt->expr; } return $lastStmt; } /** * @param Stmt[] $stmts * @return Stmt[] */ public function filterOutExistingStmts(ClassMethod $classMethod, array $stmts) : array { $this->simpleCallableNodeTraverser->traverseNodesWithCallable((array) $classMethod->stmts, function (Node $node) use(&$stmts) { foreach ($stmts as $key => $assign) { if (!$this->nodeComparator->areNodesEqual($node, $assign)) { continue; } unset($stmts[$key]); } return null; }); return $stmts; } /** * @param StmtsAwareInterface|Stmt[] $stmtsAware */ public function isVariableUsedInNextStmt($stmtsAware, int $jumpToKey, string $variableName) : bool { if ($stmtsAware instanceof StmtsAwareInterface && $stmtsAware->stmts === null) { return \false; } $stmts = \array_slice($stmtsAware instanceof StmtsAwareInterface ? $stmtsAware->stmts : $stmtsAware, $jumpToKey, null, \true); $variable = new Variable($variableName); return (bool) $this->betterNodeFinder->findFirst($stmts, function (Node $subNode) use($variable) : bool { return $this->exprUsedInNodeAnalyzer->isUsed($subNode, $variable); }); } }