This commit is contained in:
TomasVotruba 2017-08-24 12:13:51 +02:00
parent 9bac151b41
commit 5cfd7a172f
3 changed files with 13 additions and 16 deletions

View File

@ -34,10 +34,8 @@ parameters:
skip:
Symplify\CodingStandard\Fixer\Php\ClassStringToClassConstantFixer:
# class might not exist
- src/Rector/Contrib/Nette/RemoveConfiguratorConstantsRector.php
- src/Rector/Contrib/Nette/NetteObjectToSmartTraitRector.php
- src/Rector/Contrib/Nette/HtmlAddMethodRector.php
# classes might not exist
- */src/Rector/Contrib/Nette/*Rector.php
Symplify\CodingStandard\Sniffs\Debug\CommentedOutCodeSniff:
# examples of code to be found
- src/Rector/Contrib/Symfony/GetterToPropertyRector.php

View File

@ -24,8 +24,8 @@ final class HtmlAddMethodRector extends AbstractChangeMethodNameRector
{
return [
'Nette\Utils\Html' => [
'add' => 'addHtml'
]
'add' => 'addHtml',
],
];
}
}

View File

@ -7,6 +7,14 @@ use Rector\Rector\AbstractChangeMethodNameRector;
final class PhpGeneratorDocumentMethodRector extends AbstractChangeMethodNameRector
{
/**
* @var string[]
*/
private $commonMethods = [
'addDocument' => 'addComment',
'setDocuments' => 'setComment',
'getDocuments' => 'getComment',
];
public function getSetName(): string
{
@ -27,16 +35,7 @@ final class PhpGeneratorDocumentMethodRector extends AbstractChangeMethodNameRec
'Nette\PhpGenerator\ClassType' => $this->commonMethods,
'Nette\PhpGenerator\Method' => $this->commonMethods,
'Nette\PhpGenerator\PhpFile' => $this->commonMethods,
'Nette\PhpGenerator\Property' => $this->commonMethods
'Nette\PhpGenerator\Property' => $this->commonMethods,
];
}
/**
* @var string[]
*/
private $commonMethods = [
'addDocument' => 'addComment',
'setDocuments' => 'setComment',
'getDocuments' => 'getComment'
];
}