make it work again

This commit is contained in:
TomasVotruba 2017-10-16 19:58:22 +02:00
parent 3484239b2c
commit cc8a5aec00
3 changed files with 18 additions and 14 deletions

View File

@ -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[]

View File

@ -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',

View File

@ -2,7 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace PHPUnit; namespace PHPUnit;
class TestCase
class TestCase
{ {
} }