mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 11:44:14 +01:00
make it work again
This commit is contained in:
parent
3484239b2c
commit
cc8a5aec00
@ -89,6 +89,10 @@ final class PseudoNamespaceToNamespaceRector extends AbstractRector
|
||||
$nameOrIdentifierNode->setAttribute('origNode', null);
|
||||
$newNameParts = [$this->oldToNewUseStatements[$oldName]];
|
||||
}
|
||||
|
||||
$nameOrIdentifierNode->parts = $newNameParts;
|
||||
|
||||
return $nameOrIdentifierNode;
|
||||
}
|
||||
|
||||
if ($nameOrIdentifierNode instanceof Identifier && $parentNode instanceof Class_) {
|
||||
@ -97,12 +101,12 @@ final class PseudoNamespaceToNamespaceRector extends AbstractRector
|
||||
|
||||
$this->newNamespace = implode('\\', $namespaceParts);
|
||||
|
||||
$newNameParts = [$lastNewNamePart];
|
||||
$nameOrIdentifierNode->name = $lastNewNamePart;
|
||||
|
||||
return $nameOrIdentifierNode;
|
||||
}
|
||||
|
||||
$nameOrIdentifierNode->parts = $newNameParts;
|
||||
|
||||
return $nameOrIdentifierNode;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9,15 +9,15 @@ final class Test extends AbstractConfigurableRectorTestCase
|
||||
{
|
||||
public function test(): void
|
||||
{
|
||||
// $this->doTestFileMatchesExpectedContent(
|
||||
// __DIR__ . '/wrong/wrong.php.inc',
|
||||
// __DIR__ . '/correct/correct.php.inc'
|
||||
// );
|
||||
//
|
||||
// $this->doTestFileMatchesExpectedContent(
|
||||
// __DIR__ . '/wrong/wrong2.php.inc',
|
||||
// __DIR__ . '/correct/correct2.php.inc'
|
||||
// );
|
||||
$this->doTestFileMatchesExpectedContent(
|
||||
__DIR__ . '/wrong/wrong.php.inc',
|
||||
__DIR__ . '/correct/correct.php.inc'
|
||||
);
|
||||
|
||||
$this->doTestFileMatchesExpectedContent(
|
||||
__DIR__ . '/wrong/wrong2.php.inc',
|
||||
__DIR__ . '/correct/correct2.php.inc'
|
||||
);
|
||||
|
||||
$this->doTestFileMatchesExpectedContent(
|
||||
__DIR__ . '/wrong/wrong3.php.inc',
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
namespace PHPUnit;
|
||||
class TestCase
|
||||
|
||||
class TestCase
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user