add method renames

This commit is contained in:
Tomas Votruba 2018-09-23 18:44:14 +02:00
parent 44f25ea3f1
commit e4630108ed
2 changed files with 45 additions and 5 deletions

View File

@ -20,7 +20,7 @@ services:
- 'autoQuoting' # (now enableAutoQuoting()/isAutoQuotingEnabled(' - 'autoQuoting' # (now enableAutoQuoting()/isAutoQuotingEnabled('
Cake\Database\Expression\FunctionExpression: Cake\Database\Expression\FunctionExpression:
- 'name' - 'name'
Cake\Database\Expression\QueryExpression: #Cake\Database\Expression\QueryExpression:
#- 'tieWith' #() (now setConjunction()/getConjunction(' #- 'tieWith' #() (now setConjunction()/getConjunction('
Cake\Database\Expression\ValuesExpression: Cake\Database\Expression\ValuesExpression:
- 'columns' - 'columns'
@ -67,7 +67,7 @@ services:
Cake\ORM\EagerLoadable: Cake\ORM\EagerLoadable:
- 'config' - 'config'
#- 'setter part of canBeJoined() (now setCanBeJoined(' #- 'setter part of canBeJoined() (now setCanBeJoined('
Cake\ORM\EagerLoader: # Cake\ORM\EagerLoader:
#- 'matching' #() (getMatching() will have to be called after setMatching() to keep the old behavio' #- 'matching' #() (getMatching() will have to be called after setMatching() to keep the old behavio'
#- 'autoFields' #() (now enableAutoFields()/isAutoFieldsEnabled(' #- 'autoFields' #() (now enableAutoFields()/isAutoFieldsEnabled('
Cake\ORM\Locator\TableLocator: Cake\ORM\Locator\TableLocator:
@ -126,3 +126,44 @@ services:
- 'name' - 'name'
- 'className' - 'className'
#- 'autoLayout' #() (now enableAutoLayout()/isAutoLayoutEnabled(' #- 'autoLayout' #() (now enableAutoLayout()/isAutoLayoutEnabled('
Rector\Rector\MethodCall\MethodNameReplacerRector:
$perClassOldToNewMethods:
Cake\Network\Request:
param: 'getParam'
data: 'getData'
query: 'getQuery'
cookie: 'getCookie'
method: 'getMethod'
setInput: 'withBody'
Cake\Network\Response:
location: 'withLocation'
disableCache: 'withDisabledCache'
type: 'withType'
charset: 'withCharset'
cache: 'withCache'
modified: 'withModified'
expires: 'withExpires'
sharable: 'withSharable'
maxAge: 'withMaxAge'
vary: 'withVary'
etag: 'withEtag'
compress: 'withCompression'
length: 'withLength'
mustRevalidate: 'withMustRevalidate'
notModified: 'withNotModified'
cookie: 'withCookie'
file: 'withFile'
download: 'withDownload'
Cake\Event\Event:
'name': 'getName'
'subject': 'getSubject'
'result': 'getResult'
'data': 'getData'
Cake\View\Helper\FormHelper:
input: 'control'
inputs: 'controls'
allInputs: 'allControls'

View File

@ -12,7 +12,6 @@ use Rector\NodeTypeResolver\Node\Attribute;
use Rector\Rector\AbstractRector; use Rector\Rector\AbstractRector;
use Rector\RectorDefinition\ConfiguredCodeSample; use Rector\RectorDefinition\ConfiguredCodeSample;
use Rector\RectorDefinition\RectorDefinition; use Rector\RectorDefinition\RectorDefinition;
use SomeClass;
final class MethodNameReplacerRector extends AbstractRector final class MethodNameReplacerRector extends AbstractRector
{ {
@ -76,7 +75,7 @@ CODE_SAMPLE
, ,
[ [
'$perClassOldToNewMethods' => [ '$perClassOldToNewMethods' => [
SomeClass::class => [ 'SomeClass' => [
'oldMethod' => 'newMethod', 'oldMethod' => 'newMethod',
], ],
], ],