# source: https://book.cakephp.org/4.0/en/appendices/4-0-migration-guide.html

services:
    Rector\Rector\MethodCall\RenameMethodRector:
        Cake\Form\Form:
            'errors': 'getErrors'
        Cake\Mailer\Email:
            'set': 'setViewVars'

    Rector\Rector\ClassMethod\AddReturnTypeDeclarationRector:
        Cake\Http\BaseApplication:
            bootstrap: 'void'
            bootstrapCli: 'void'
            middleware: 'Cake\Http\MiddlewareQueue'
        Cake\Console\Shell:
            initialize: 'void'
        Cake\Controller\Controller:
            initialize: 'void'
            render: 'Cake\Http\Response'
        Cake\ORM\Table:
            initialize: 'void'
            updateAll: 'int'
            deleteAll: 'int'
            validationDefault: 'Cake\Validation\Validator'
        Cake\View\Helper:
            initialize: 'void'

# source: https://book.cakephp.org/4.0/en/appendices/4-0-migration-guide.html

services:
    Rector\Rector\Class_\RenameClassRector:
        Cake\Database\Type: 'Cake\Database\TypeFactory'

    Rector\Rector\Constant\RenameClassConstantRector:
        Cake\View\View:
            NAME_ELEMENT: TYPE_ELEMENT
            NAME_LAYOUT: TYPE_LAYOUT
        Cake\Mailer\Email:
            MESSAGE_HTML: 'Cake\Mailer\Message::MESSAGE_HTML'
            MESSAGE_TEXT: 'Cake\Mailer\Message::MESSAGE_TEXT'
            MESSAGE_BOTH: 'Cake\Mailer\Message::MESSAGE_BOTH'
            EMAIL_PATTERN: 'Cake\Mailer\Message::EMAIL_PATTERN'

    Rector\Rector\MethodCall\RenameMethodRector:
        Cake\Form\Form:
            errors: 'getErrors'
        Cake\Mailer\Email:
            set: 'setViewVars'
        Cake\ORM\EntityInterface:
            unsetProperty: 'unset'
        Cake\Cache\Cache:
            engine: 'pool'
        Cake\Http\Cookie\Cookie:
            getStringValue: 'getScalarValue'
        Cake\Validation\Validator:
            containsNonAlphaNumeric: notAlphaNumeric

    Rector\Rector\ClassMethod\AddReturnTypeDeclarationRector:
        Cake\Http\BaseApplication:
            bootstrap: 'void'
            bootstrapCli: 'void'
            middleware: 'Cake\Http\MiddlewareQueue'
        Cake\Console\Shell:
            initialize: 'void'
        Cake\Controller\Controller:
            initialize: 'void'
            render: 'Cake\Http\Response'
        Cake\ORM\Table:
            initialize: 'void'
            updateAll: 'int'
            deleteAll: 'int'
            validationDefault: 'Cake\Validation\Validator'
        Cake\View\Helper:
            initialize: 'void'

Add more rectors for CakePHP 4.0
Add more rectors for CakePHP 4.0

More renames that can be handled by rector.
