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);
|
$nameOrIdentifierNode->setAttribute('origNode', null);
|
||||||
$newNameParts = [$this->oldToNewUseStatements[$oldName]];
|
$newNameParts = [$this->oldToNewUseStatements[$oldName]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$nameOrIdentifierNode->parts = $newNameParts;
|
||||||
|
|
||||||
|
return $nameOrIdentifierNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($nameOrIdentifierNode instanceof Identifier && $parentNode instanceof Class_) {
|
if ($nameOrIdentifierNode instanceof Identifier && $parentNode instanceof Class_) {
|
||||||
@ -97,14 +101,14 @@ final class PseudoNamespaceToNamespaceRector extends AbstractRector
|
|||||||
|
|
||||||
$this->newNamespace = implode('\\', $namespaceParts);
|
$this->newNamespace = implode('\\', $namespaceParts);
|
||||||
|
|
||||||
$newNameParts = [$lastNewNamePart];
|
$nameOrIdentifierNode->name = $lastNewNamePart;
|
||||||
}
|
|
||||||
|
|
||||||
$nameOrIdentifierNode->parts = $newNameParts;
|
|
||||||
|
|
||||||
return $nameOrIdentifierNode;
|
return $nameOrIdentifierNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Node[] $nodes
|
* @param Node[] $nodes
|
||||||
* @return Node[]
|
* @return Node[]
|
||||||
|
@ -9,15 +9,15 @@ final class Test extends AbstractConfigurableRectorTestCase
|
|||||||
{
|
{
|
||||||
public function test(): void
|
public function test(): void
|
||||||
{
|
{
|
||||||
// $this->doTestFileMatchesExpectedContent(
|
$this->doTestFileMatchesExpectedContent(
|
||||||
// __DIR__ . '/wrong/wrong.php.inc',
|
__DIR__ . '/wrong/wrong.php.inc',
|
||||||
// __DIR__ . '/correct/correct.php.inc'
|
__DIR__ . '/correct/correct.php.inc'
|
||||||
// );
|
);
|
||||||
//
|
|
||||||
// $this->doTestFileMatchesExpectedContent(
|
$this->doTestFileMatchesExpectedContent(
|
||||||
// __DIR__ . '/wrong/wrong2.php.inc',
|
__DIR__ . '/wrong/wrong2.php.inc',
|
||||||
// __DIR__ . '/correct/correct2.php.inc'
|
__DIR__ . '/correct/correct2.php.inc'
|
||||||
// );
|
);
|
||||||
|
|
||||||
$this->doTestFileMatchesExpectedContent(
|
$this->doTestFileMatchesExpectedContent(
|
||||||
__DIR__ . '/wrong/wrong3.php.inc',
|
__DIR__ . '/wrong/wrong3.php.inc',
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
namespace PHPUnit;
|
namespace PHPUnit;
|
||||||
class TestCase
|
|
||||||
|
|
||||||
|
class TestCase
|
||||||
{
|
{
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user