mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-05 02:40:50 +00:00
[Rector] make PhpGeneratorDocumentMethodRector work
This commit is contained in:
parent
5cd643f279
commit
9bac151b41
|
@ -18,26 +18,25 @@ final class PhpGeneratorDocumentMethodRector extends AbstractChangeMethodNameRec
|
|||
return 2.4;
|
||||
}
|
||||
|
||||
protected function getClassName(): string
|
||||
{
|
||||
// allow array?
|
||||
}
|
||||
|
||||
protected function getOldMethodName(): string
|
||||
{
|
||||
// return string
|
||||
}
|
||||
|
||||
protected function getNewMethodName(): string
|
||||
{
|
||||
// retun string
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[][]
|
||||
*/
|
||||
protected function getPerClassOldToNewMethods(): array
|
||||
{
|
||||
// TODO: Implement getPerClassOldToNewMethods() method.
|
||||
return [
|
||||
'Nette\PhpGenerator\ClassType' => $this->commonMethods,
|
||||
'Nette\PhpGenerator\Method' => $this->commonMethods,
|
||||
'Nette\PhpGenerator\PhpFile' => $this->commonMethods,
|
||||
'Nette\PhpGenerator\Property' => $this->commonMethods
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $commonMethods = [
|
||||
'addDocument' => 'addComment',
|
||||
'setDocuments' => 'setComment',
|
||||
'getDocuments' => 'getComment'
|
||||
];
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Rector\Tests\Rector\Contrib\Nette\PhpGeneratorDocumentMethod;
|
||||
|
||||
use Rector\Rector\Contrib\Nette\PhpGeneratorDocumentMethodRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
final class Test extends AbstractRectorTestCase
|
||||
|
@ -19,6 +20,6 @@ final class Test extends AbstractRectorTestCase
|
|||
*/
|
||||
protected function getRectorClasses(): array
|
||||
{
|
||||
return [/* todo */];
|
||||
return [PhpGeneratorDocumentMethodRector::class];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user