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);
$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;
}
/**

View File

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

View File

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