Skip to content

Commit 40d4f09

Browse files
committed
flip keys
1 parent 990d5b1 commit 40d4f09

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodRector.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,25 @@ public function getNodeTypes(): array
7878
*/
7979
public function refactor(Node $node): ?Node
8080
{
81+
<<<<<<< HEAD
8182
if ($node->getMethods() === []) {
83+
=======
84+
foreach ($node->stmts as $stmt) {
85+
if (!$stmt instanceof ClassMethod) {
86+
continue;
87+
}
88+
89+
if ($stmt->isPrivate()) {
90+
return null;
91+
}
92+
93+
dump('todo');
94+
}
95+
96+
$classMethods = $node->getMethods();
97+
98+
if ($classMethods === []) {
99+
>>>>>>> 77e904a598 (flip keys)
82100
return null;
83101
}
84102

src/PhpParser/NodeTraverser/AbstractImmutableNodeTraverser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ protected function traverseArray(array $nodes): array
211211
$visitorIndex = -1;
212212
$currentNodeVisitors = $this->getVisitorsForNode($node);
213213

214+
// @todo change everything we dont need here
214215
foreach ($currentNodeVisitors as $visitorIndex => $visitor) {
215216
$return = $visitor->enterNode($node);
216217
if ($return !== null) {

0 commit comments

Comments
 (0)