Skip to content

Commit

Permalink
Update all classlike pseudo rector (#3002)
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster777 committed Oct 18, 2022
1 parent 56620a9 commit 71ffc80
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

interface ChangeMe_FooInterface
{
public function bar();
}
-----
<?php

namespace ChangeMe;

interface FooInterface
{
public function bar();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

trait ChangeMe_BarTrait
{
public function bar(): bool
{
return true;
}
}
-----
<?php

namespace ChangeMe;

trait BarTrait
{
public function bar(): bool
{
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassLike;
use PhpParser\Node\Stmt\Namespace_;
use PhpParser\Node\Stmt\Property;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
Expand Down Expand Up @@ -192,7 +192,7 @@ private function processName(Name $name): Name
private function processIdentifier(Identifier $identifier): ?Identifier
{
$parentNode = $identifier->getAttribute(AttributeKey::PARENT_NODE);
if (! $parentNode instanceof Class_) {
if (! $parentNode instanceof ClassLike) {
return null;
}

Expand Down

0 comments on commit 71ffc80

Please sign in to comment.