mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-31 08:20:53 +00:00
[cs] apply indent of call in configs (#5547)
This commit is contained in:
parent
054de822ed
commit
de8fa30257
|
@ -48,16 +48,16 @@
|
|||
"symfony/finder": "^4.4.8|^5.1",
|
||||
"symfony/http-kernel": "^4.4.8|^5.1",
|
||||
"symfony/process": "^4.4.8|^5.1",
|
||||
"symplify/astral": "^9.1.4",
|
||||
"symplify/autowire-array-parameter": "^9.1.4",
|
||||
"symplify/console-color-diff": "^9.1.4",
|
||||
"symplify/package-builder": "^9.1.4",
|
||||
"symplify/rule-doc-generator": "^9.1.4",
|
||||
"symplify/set-config-resolver": "^9.1.4",
|
||||
"symplify/simple-php-doc-parser": "^9.1.4",
|
||||
"symplify/skipper": "^9.1.4",
|
||||
"symplify/smart-file-system": "^9.1.4",
|
||||
"symplify/symfony-php-config": "^9.1.4",
|
||||
"symplify/astral": "^9.1.9",
|
||||
"symplify/autowire-array-parameter": "^9.1.9",
|
||||
"symplify/console-color-diff": "^9.1.9",
|
||||
"symplify/package-builder": "^9.1.9",
|
||||
"symplify/rule-doc-generator": "^9.1.9",
|
||||
"symplify/set-config-resolver": "^9.1.9",
|
||||
"symplify/simple-php-doc-parser": "^9.1.9",
|
||||
"symplify/skipper": "^9.1.9",
|
||||
"symplify/smart-file-system": "^9.1.9",
|
||||
"symplify/symfony-php-config": "^9.1.9",
|
||||
"webmozart/assert": "^1.9"
|
||||
},
|
||||
"require-dev": {
|
||||
|
@ -71,13 +71,13 @@
|
|||
"phpunit/phpunit": "^9.5",
|
||||
"symfony/security-core": "^5.2",
|
||||
"symfony/security-http": "^5.2",
|
||||
"symplify/changelog-linker": "^9.1.4",
|
||||
"symplify/coding-standard": "^9.1.4",
|
||||
"symplify/easy-coding-standard": "^9.1.4",
|
||||
"symplify/changelog-linker": "^9.1.9",
|
||||
"symplify/coding-standard": "^9.1.9",
|
||||
"symplify/easy-coding-standard": "^9.1.9",
|
||||
"symplify/easy-ci": "^9.1.0",
|
||||
"symplify/easy-testing": "^9.1.4",
|
||||
"symplify/phpstan-extensions": "^9.1.4",
|
||||
"symplify/phpstan-rules": "^9.1.4",
|
||||
"symplify/easy-testing": "^9.1.9",
|
||||
"symplify/phpstan-extensions": "^9.1.9",
|
||||
"symplify/phpstan-rules": "^9.1.9",
|
||||
"tracy/tracy": "^2.8"
|
||||
},
|
||||
"replace": {
|
||||
|
|
|
@ -129,33 +129,34 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services->set(UnusedForeachValueToArrayKeysRector::class);
|
||||
$services->set(ArrayThisCallToThisMethodCallRector::class);
|
||||
$services->set(CommonNotEqualRector::class);
|
||||
$services->set(RenameFunctionRector::class)->call('configure', [[
|
||||
RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
|
||||
'split' => 'explode',
|
||||
'join' => 'implode',
|
||||
'sizeof' => 'count',
|
||||
# https://www.php.net/manual/en/aliases.php
|
||||
'chop' => 'rtrim',
|
||||
'doubleval' => 'floatval',
|
||||
'gzputs' => 'gzwrites',
|
||||
'fputs' => 'fwrite',
|
||||
'ini_alter' => 'ini_set',
|
||||
'is_double' => 'is_float',
|
||||
'is_integer' => 'is_int',
|
||||
'is_long' => 'is_int',
|
||||
'is_real' => 'is_float',
|
||||
'is_writeable' => 'is_writable',
|
||||
'key_exists' => 'array_key_exists',
|
||||
'pos' => 'current',
|
||||
'strchr' => 'strstr',
|
||||
# mb
|
||||
'mbstrcut' => 'mb_strcut',
|
||||
'mbstrlen' => 'mb_strlen',
|
||||
'mbstrpos' => 'mb_strpos',
|
||||
'mbstrrpos' => 'mb_strrpos',
|
||||
'mbsubstr' => 'mb_substr',
|
||||
],
|
||||
]]);
|
||||
$services->set(RenameFunctionRector::class)
|
||||
->call('configure', [[
|
||||
RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
|
||||
'split' => 'explode',
|
||||
'join' => 'implode',
|
||||
'sizeof' => 'count',
|
||||
# https://www.php.net/manual/en/aliases.php
|
||||
'chop' => 'rtrim',
|
||||
'doubleval' => 'floatval',
|
||||
'gzputs' => 'gzwrites',
|
||||
'fputs' => 'fwrite',
|
||||
'ini_alter' => 'ini_set',
|
||||
'is_double' => 'is_float',
|
||||
'is_integer' => 'is_int',
|
||||
'is_long' => 'is_int',
|
||||
'is_real' => 'is_float',
|
||||
'is_writeable' => 'is_writable',
|
||||
'key_exists' => 'array_key_exists',
|
||||
'pos' => 'current',
|
||||
'strchr' => 'strstr',
|
||||
# mb
|
||||
'mbstrcut' => 'mb_strcut',
|
||||
'mbstrlen' => 'mb_strlen',
|
||||
'mbstrpos' => 'mb_strpos',
|
||||
'mbstrrpos' => 'mb_strrpos',
|
||||
'mbsubstr' => 'mb_substr',
|
||||
],
|
||||
]]);
|
||||
$services->set(SetTypeToCastRector::class);
|
||||
$services->set(LogicalToBooleanRector::class);
|
||||
$services->set(VarToPublicPropertyRector::class);
|
||||
|
|
|
@ -63,13 +63,10 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
]]);
|
||||
|
||||
$services->set(AddEntityIdByConditionRector::class)
|
||||
->call(
|
||||
'configure',
|
||||
[[
|
||||
AddEntityIdByConditionRector::DETECTED_TRAITS => [
|
||||
'Knp\DoctrineBehaviors\Model\Translatable\Translation',
|
||||
'Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait',
|
||||
],
|
||||
]]
|
||||
);
|
||||
->call('configure', [[
|
||||
AddEntityIdByConditionRector::DETECTED_TRAITS => [
|
||||
'Knp\DoctrineBehaviors\Model\Translatable\Translation',
|
||||
'Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -30,16 +30,14 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services->set(RemoveRedundantDefaultPropertyAnnotationValuesRector::class);
|
||||
$services->set(RemoveRedundantDefaultClassAnnotationValuesRector::class);
|
||||
$services->set(ReplaceStringWithClassConstantRector::class)
|
||||
->call('configure', [
|
||||
[
|
||||
ReplaceStringWithClassConstantRector::REPLACE_STRING_WITH_CLASS_CONSTANT => ValueObjectInliner::inline([
|
||||
new ReplaceStringWithClassConstant(
|
||||
'Doctrine\ORM\QueryBuilder',
|
||||
'orderBy',
|
||||
1,
|
||||
'Doctrine\Common\Collections\Criteria'
|
||||
),
|
||||
]),
|
||||
],
|
||||
]);
|
||||
->call('configure', [[
|
||||
ReplaceStringWithClassConstantRector::REPLACE_STRING_WITH_CLASS_CONSTANT => ValueObjectInliner::inline([
|
||||
new ReplaceStringWithClassConstant(
|
||||
'Doctrine\ORM\QueryBuilder',
|
||||
'orderBy',
|
||||
1,
|
||||
'Doctrine\Common\Collections\Criteria'
|
||||
),
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -22,164 +22,217 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->import(__DIR__ . '/laravel-array-str-functions-to-static-call.php');
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(StaticCallToMethodCallRector::class)->call('configure', [[
|
||||
StaticCallToMethodCallRector::STATIC_CALLS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\App', '*', 'Illuminate\Foundation\Application', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Artisan',
|
||||
'*',
|
||||
'Illuminate\Contracts\Console\Kernel',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Auth', '*', 'Illuminate\Auth\AuthManager', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Blade',
|
||||
'*',
|
||||
'Illuminate\View\Compilers\BladeCompiler',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Broadcast',
|
||||
'*',
|
||||
'Illuminate\Contracts\Broadcasting\Factory',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Bus',
|
||||
'*',
|
||||
'Illuminate\Contracts\Bus\Dispatcher',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Cache', '*', 'Illuminate\Cache\CacheManager', '*'),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Config', '*', 'Illuminate\Config\Repository', '*'),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Cookie', '*', 'Illuminate\Cookie\CookieJar', '*'),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Crypt', '*', 'Illuminate\Encryption\Encrypter', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\DB',
|
||||
'*',
|
||||
'Illuminate\Database\DatabaseManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Event', '*', 'Illuminate\Events\Dispatcher', '*'),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\File', '*', 'Illuminate\Filesystem\Filesystem', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Gate',
|
||||
'*',
|
||||
'Illuminate\Contracts\Auth\Access\Gate',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Hash',
|
||||
'*',
|
||||
'Illuminate\Contracts\Hashing\Hasher',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Lang',
|
||||
'*',
|
||||
'Illuminate\Translation\Translator',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Log', '*', 'Illuminate\Log\LogManager', '*'),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Mail', '*', 'Illuminate\Mail\Mailer', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Notification',
|
||||
'*',
|
||||
'Illuminate\Notifications\ChannelManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Password',
|
||||
'*',
|
||||
'Illuminate\Auth\Passwords\PasswordBrokerManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Queue', '*', 'Illuminate\Queue\QueueManager', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Redirect',
|
||||
'*',
|
||||
'Illuminate\Routing\Redirector',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Redis', '*', 'Illuminate\Redis\RedisManager', '*'),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Request', '*', 'Illuminate\Http\Request', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Response',
|
||||
'*',
|
||||
'Illuminate\Contracts\Routing\ResponseFactory',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Route', '*', 'Illuminate\Routing\Router', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Schema',
|
||||
'*',
|
||||
'Illuminate\Database\Schema\Builder',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Session',
|
||||
'*',
|
||||
'Illuminate\Session\SessionManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Storage',
|
||||
'*',
|
||||
'Illuminate\Filesystem\FilesystemManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\URL', '*', 'Illuminate\Routing\UrlGenerator', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Validator',
|
||||
'*',
|
||||
'Illuminate\Validation\Factory',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\View', '*', 'Illuminate\View\Factory', '*'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(StaticCallToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
StaticCallToMethodCallRector::STATIC_CALLS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\App',
|
||||
'*',
|
||||
'Illuminate\Foundation\Application',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Artisan',
|
||||
'*',
|
||||
'Illuminate\Contracts\Console\Kernel',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Auth', '*', 'Illuminate\Auth\AuthManager', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Blade',
|
||||
'*',
|
||||
'Illuminate\View\Compilers\BladeCompiler',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Broadcast',
|
||||
'*',
|
||||
'Illuminate\Contracts\Broadcasting\Factory',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Bus',
|
||||
'*',
|
||||
'Illuminate\Contracts\Bus\Dispatcher',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Cache',
|
||||
'*',
|
||||
'Illuminate\Cache\CacheManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Config',
|
||||
'*',
|
||||
'Illuminate\Config\Repository',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Cookie',
|
||||
'*',
|
||||
'Illuminate\Cookie\CookieJar',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Crypt',
|
||||
'*',
|
||||
'Illuminate\Encryption\Encrypter',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\DB',
|
||||
'*',
|
||||
'Illuminate\Database\DatabaseManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Event',
|
||||
'*',
|
||||
'Illuminate\Events\Dispatcher',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\File',
|
||||
'*',
|
||||
'Illuminate\Filesystem\Filesystem',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Gate',
|
||||
'*',
|
||||
'Illuminate\Contracts\Auth\Access\Gate',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Hash',
|
||||
'*',
|
||||
'Illuminate\Contracts\Hashing\Hasher',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Lang',
|
||||
'*',
|
||||
'Illuminate\Translation\Translator',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Log', '*', 'Illuminate\Log\LogManager', '*'),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Mail', '*', 'Illuminate\Mail\Mailer', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Notification',
|
||||
'*',
|
||||
'Illuminate\Notifications\ChannelManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Password',
|
||||
'*',
|
||||
'Illuminate\Auth\Passwords\PasswordBrokerManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Queue',
|
||||
'*',
|
||||
'Illuminate\Queue\QueueManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Redirect',
|
||||
'*',
|
||||
'Illuminate\Routing\Redirector',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Redis',
|
||||
'*',
|
||||
'Illuminate\Redis\RedisManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Request', '*', 'Illuminate\Http\Request', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Response',
|
||||
'*',
|
||||
'Illuminate\Contracts\Routing\ResponseFactory',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\Route', '*', 'Illuminate\Routing\Router', '*'),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Schema',
|
||||
'*',
|
||||
'Illuminate\Database\Schema\Builder',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Session',
|
||||
'*',
|
||||
'Illuminate\Session\SessionManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Storage',
|
||||
'*',
|
||||
'Illuminate\Filesystem\FilesystemManager',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\URL',
|
||||
'*',
|
||||
'Illuminate\Routing\UrlGenerator',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall(
|
||||
'Illuminate\Support\Facades\Validator',
|
||||
'*',
|
||||
'Illuminate\Validation\Factory',
|
||||
'*'
|
||||
),
|
||||
new StaticCallToMethodCall('Illuminate\Support\Facades\View', '*', 'Illuminate\View\Factory', '*'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RequestStaticValidateToInjectRector::class);
|
||||
// @see https://github.com/laravel/framework/blob/78828bc779e410e03cc6465f002b834eadf160d2/src/Illuminate/Foundation/helpers.php#L959
|
||||
// @see https://gist.github.com/barryvdh/bb6ffc5d11e0a75dba67
|
||||
$services->set(ArgumentFuncCallToMethodCallRector::class)->call('configure', [[
|
||||
ArgumentFuncCallToMethodCallRector::FUNCTIONS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new ArgumentFuncCallToMethodCall('auth', 'Illuminate\Contracts\Auth\Guard'),
|
||||
new ArgumentFuncCallToMethodCall('policy', 'Illuminate\Contracts\Auth\Access\Gate', 'getPolicyFor'),
|
||||
new ArgumentFuncCallToMethodCall('cookie', 'Illuminate\Contracts\Cookie\Factory', 'make'),
|
||||
// router
|
||||
new ArgumentFuncCallToMethodCall('put', 'Illuminate\Routing\Router', 'put'),
|
||||
new ArgumentFuncCallToMethodCall('get', 'Illuminate\Routing\Router', 'get'),
|
||||
new ArgumentFuncCallToMethodCall('post', 'Illuminate\Routing\Router', 'post'),
|
||||
new ArgumentFuncCallToMethodCall('patch', 'Illuminate\Routing\Router', 'patch'),
|
||||
new ArgumentFuncCallToMethodCall('delete', 'Illuminate\Routing\Router', 'delete'),
|
||||
new ArgumentFuncCallToMethodCall('resource', 'Illuminate\Routing\Router', 'resource'),
|
||||
new ArgumentFuncCallToMethodCall('response', 'Illuminate\Contracts\Routing\ResponseFactory', 'make'),
|
||||
new ArgumentFuncCallToMethodCall('info', 'Illuminate\Log\Writer', 'info'),
|
||||
new ArgumentFuncCallToMethodCall('view', 'Illuminate\Contracts\View\Factory', 'make'),
|
||||
new ArgumentFuncCallToMethodCall('bcrypt', 'Illuminate\Hashing\BcryptHasher', 'make'),
|
||||
new ArgumentFuncCallToMethodCall('redirect', 'Illuminate\Routing\Redirector', 'back'),
|
||||
new ArgumentFuncCallToMethodCall('broadcast', 'Illuminate\Contracts\Broadcasting\Factory', 'event'),
|
||||
new ArgumentFuncCallToMethodCall('event', 'Illuminate\Events\Dispatcher', 'dispatch'),
|
||||
new ArgumentFuncCallToMethodCall('dispatch', 'Illuminate\Events\Dispatcher', 'dispatch'),
|
||||
new ArgumentFuncCallToMethodCall('route', 'Illuminate\Routing\UrlGenerator', 'route'),
|
||||
new ArgumentFuncCallToMethodCall('asset', 'Illuminate\Routing\UrlGenerator', 'asset'),
|
||||
new ArgumentFuncCallToMethodCall('url', 'Illuminate\Contracts\Routing\UrlGenerator', 'to'),
|
||||
new ArgumentFuncCallToMethodCall('action', 'Illuminate\Routing\UrlGenerator', 'action'),
|
||||
new ArgumentFuncCallToMethodCall('trans', 'Illuminate\Translation\Translator', 'trans'),
|
||||
new ArgumentFuncCallToMethodCall('trans_choice', 'Illuminate\Translation\Translator', 'transChoice'),
|
||||
new ArgumentFuncCallToMethodCall('logger', 'Illuminate\Log\Writer', 'debug'),
|
||||
new ArgumentFuncCallToMethodCall('back', 'Illuminate\Routing\Redirector', 'back', 'back'),
|
||||
]),
|
||||
ArgumentFuncCallToMethodCallRector::ARRAY_FUNCTIONS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new ArrayFuncCallToMethodCall('config', 'Illuminate\Contracts\Config\Repository', 'set', 'get'),
|
||||
new ArrayFuncCallToMethodCall('session', 'Illuminate\Session\SessionManager', 'put', 'get'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(FuncCallToNewRector::class)->call('configure', [[
|
||||
FuncCallToNewRector::FUNCTIONS_TO_NEWS => [
|
||||
'collect' => 'Illuminate\Support\Collection',
|
||||
],
|
||||
]]);
|
||||
$services->set(ArgumentFuncCallToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
ArgumentFuncCallToMethodCallRector::FUNCTIONS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new ArgumentFuncCallToMethodCall('auth', 'Illuminate\Contracts\Auth\Guard'),
|
||||
new ArgumentFuncCallToMethodCall('policy', 'Illuminate\Contracts\Auth\Access\Gate', 'getPolicyFor'),
|
||||
new ArgumentFuncCallToMethodCall('cookie', 'Illuminate\Contracts\Cookie\Factory', 'make'),
|
||||
// router
|
||||
new ArgumentFuncCallToMethodCall('put', 'Illuminate\Routing\Router', 'put'),
|
||||
new ArgumentFuncCallToMethodCall('get', 'Illuminate\Routing\Router', 'get'),
|
||||
new ArgumentFuncCallToMethodCall('post', 'Illuminate\Routing\Router', 'post'),
|
||||
new ArgumentFuncCallToMethodCall('patch', 'Illuminate\Routing\Router', 'patch'),
|
||||
new ArgumentFuncCallToMethodCall('delete', 'Illuminate\Routing\Router', 'delete'),
|
||||
new ArgumentFuncCallToMethodCall('resource', 'Illuminate\Routing\Router', 'resource'),
|
||||
new ArgumentFuncCallToMethodCall('response', 'Illuminate\Contracts\Routing\ResponseFactory', 'make'),
|
||||
new ArgumentFuncCallToMethodCall('info', 'Illuminate\Log\Writer', 'info'),
|
||||
new ArgumentFuncCallToMethodCall('view', 'Illuminate\Contracts\View\Factory', 'make'),
|
||||
new ArgumentFuncCallToMethodCall('bcrypt', 'Illuminate\Hashing\BcryptHasher', 'make'),
|
||||
new ArgumentFuncCallToMethodCall('redirect', 'Illuminate\Routing\Redirector', 'back'),
|
||||
new ArgumentFuncCallToMethodCall('broadcast', 'Illuminate\Contracts\Broadcasting\Factory', 'event'),
|
||||
new ArgumentFuncCallToMethodCall('event', 'Illuminate\Events\Dispatcher', 'dispatch'),
|
||||
new ArgumentFuncCallToMethodCall('dispatch', 'Illuminate\Events\Dispatcher', 'dispatch'),
|
||||
new ArgumentFuncCallToMethodCall('route', 'Illuminate\Routing\UrlGenerator', 'route'),
|
||||
new ArgumentFuncCallToMethodCall('asset', 'Illuminate\Routing\UrlGenerator', 'asset'),
|
||||
new ArgumentFuncCallToMethodCall('url', 'Illuminate\Contracts\Routing\UrlGenerator', 'to'),
|
||||
new ArgumentFuncCallToMethodCall('action', 'Illuminate\Routing\UrlGenerator', 'action'),
|
||||
new ArgumentFuncCallToMethodCall('trans', 'Illuminate\Translation\Translator', 'trans'),
|
||||
new ArgumentFuncCallToMethodCall('trans_choice', 'Illuminate\Translation\Translator', 'transChoice'),
|
||||
new ArgumentFuncCallToMethodCall('logger', 'Illuminate\Log\Writer', 'debug'),
|
||||
new ArgumentFuncCallToMethodCall('back', 'Illuminate\Routing\Redirector', 'back', 'back'),
|
||||
]),
|
||||
ArgumentFuncCallToMethodCallRector::ARRAY_FUNCTIONS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new ArrayFuncCallToMethodCall('config', 'Illuminate\Contracts\Config\Repository', 'set', 'get'),
|
||||
new ArrayFuncCallToMethodCall('session', 'Illuminate\Session\SessionManager', 'put', 'get'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(FuncCallToNewRector::class)
|
||||
->call('configure', [[
|
||||
FuncCallToNewRector::FUNCTIONS_TO_NEWS => [
|
||||
'collect' => 'Illuminate\Support\Collection',
|
||||
],
|
||||
]]);
|
||||
$services->set(HelperFuncCallToFacadeClassRector::class);
|
||||
|
||||
$services->set(RenameClassRector::class)
|
||||
|
|
|
@ -31,12 +31,9 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
]]);
|
||||
|
||||
$services->set(RenameClassRector::class)
|
||||
->call(
|
||||
'configure',
|
||||
[[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
'Illuminate\Translation\LoaderInterface' => 'Illuminate\Contracts\Translation\Loader',
|
||||
],
|
||||
]]
|
||||
);
|
||||
->call('configure', [[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
'Illuminate\Translation\LoaderInterface' => 'Illuminate\Contracts\Translation\Loader',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -20,43 +20,46 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
# see: https://laravel.com/docs/5.7/upgrade
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ChangeMethodVisibilityRector::class)->call('configure', [[
|
||||
ChangeMethodVisibilityRector::METHOD_VISIBILITIES => ValueObjectInliner::inline([
|
||||
new ChangeMethodVisibility('Illuminate\Routing\Router', 'addRoute', Visibility::PUBLIC),
|
||||
new ChangeMethodVisibility('Illuminate\Contracts\Auth\Access\Gate', 'raw', Visibility::PUBLIC),
|
||||
]),
|
||||
]]);
|
||||
$services->set(ArgumentAdderRector::class)->call('configure', [[
|
||||
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
new ArgumentAdder('Illuminate\Auth\Middleware\Authenticate', 'authenticate', 0, 'request'),
|
||||
new ArgumentAdder(
|
||||
'Illuminate\Foundation\Auth\ResetsPasswords',
|
||||
'sendResetResponse',
|
||||
0,
|
||||
'request',
|
||||
null,
|
||||
'Illuminate\Http\Illuminate\Http'
|
||||
),
|
||||
new ArgumentAdder(
|
||||
'Illuminate\Foundation\Auth\SendsPasswordResetEmails',
|
||||
'sendResetLinkResponse',
|
||||
0,
|
||||
'request',
|
||||
null,
|
||||
'Illuminate\Http\Illuminate\Http'
|
||||
),
|
||||
new ArgumentAdder('Illuminate\Database\ConnectionInterface', 'select', 2, 'useReadPdo', true),
|
||||
new ArgumentAdder('Illuminate\Database\ConnectionInterface', 'selectOne', 2, 'useReadPdo', true),
|
||||
]),
|
||||
]]);
|
||||
$services->set(ChangeMethodVisibilityRector::class)
|
||||
->call('configure', [[
|
||||
ChangeMethodVisibilityRector::METHOD_VISIBILITIES => ValueObjectInliner::inline([
|
||||
new ChangeMethodVisibility('Illuminate\Routing\Router', 'addRoute', Visibility::PUBLIC),
|
||||
new ChangeMethodVisibility('Illuminate\Contracts\Auth\Access\Gate', 'raw', Visibility::PUBLIC),
|
||||
]),
|
||||
]]);
|
||||
$services->set(ArgumentAdderRector::class)
|
||||
->call('configure', [[
|
||||
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
new ArgumentAdder('Illuminate\Auth\Middleware\Authenticate', 'authenticate', 0, 'request'),
|
||||
new ArgumentAdder(
|
||||
'Illuminate\Foundation\Auth\ResetsPasswords',
|
||||
'sendResetResponse',
|
||||
0,
|
||||
'request',
|
||||
null,
|
||||
'Illuminate\Http\Illuminate\Http'
|
||||
),
|
||||
new ArgumentAdder(
|
||||
'Illuminate\Foundation\Auth\SendsPasswordResetEmails',
|
||||
'sendResetLinkResponse',
|
||||
0,
|
||||
'request',
|
||||
null,
|
||||
'Illuminate\Http\Illuminate\Http'
|
||||
),
|
||||
new ArgumentAdder('Illuminate\Database\ConnectionInterface', 'select', 2, 'useReadPdo', true),
|
||||
new ArgumentAdder('Illuminate\Database\ConnectionInterface', 'selectOne', 2, 'useReadPdo', true),
|
||||
]),
|
||||
]]);
|
||||
$services->set(Redirect301ToPermanentRedirectRector::class);
|
||||
$services->set(ArgumentRemoverRector::class)->call('configure', [[
|
||||
ArgumentRemoverRector::REMOVED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
new ArgumentRemover('Illuminate\Foundation\Application', 'register', 1, [
|
||||
'name' => 'options',
|
||||
]), ]
|
||||
),
|
||||
]]);
|
||||
$services->set(ArgumentRemoverRector::class)
|
||||
->call('configure', [[
|
||||
ArgumentRemoverRector::REMOVED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
new ArgumentRemover('Illuminate\Foundation\Application', 'register', 1, [
|
||||
'name' => 'options',
|
||||
]),
|
||||
]),
|
||||
]]);
|
||||
$services->set(AddParentBootToModelClassMethodRector::class);
|
||||
$services->set(ChangeQueryWhereDateValueWithCarbonRector::class);
|
||||
$services->set(AddMockConsoleOutputFalseToConsoleTestsRector::class);
|
||||
|
|
|
@ -20,20 +20,22 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$containerConfigurator->import(__DIR__ . '/laravel-array-str-functions-to-static-call.php');
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(MinutesToSecondsInCacheRector::class);
|
||||
$services->set(AddReturnTypeDeclarationRector::class)->call('configure', [[
|
||||
AddReturnTypeDeclarationRector::METHOD_RETURN_TYPES => ValueObjectInliner::inline([
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Repository', 'put', new BooleanType()),
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Repository', 'forever', new BooleanType()),
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Store', 'put', new BooleanType()),
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Store', 'putMany', new BooleanType()),
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Store', 'forever', new BooleanType()),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RenamePropertyRector::class)->call('configure', [[
|
||||
RenamePropertyRector::RENAMED_PROPERTIES => ValueObjectInliner::inline([
|
||||
new RenameProperty('Illuminate\Routing\UrlGenerator', 'cachedSchema', 'cachedScheme'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(AddReturnTypeDeclarationRector::class)
|
||||
->call('configure', [[
|
||||
AddReturnTypeDeclarationRector::METHOD_RETURN_TYPES => ValueObjectInliner::inline([
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Repository', 'put', new BooleanType()),
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Repository', 'forever', new BooleanType()),
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Store', 'put', new BooleanType()),
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Store', 'putMany', new BooleanType()),
|
||||
new AddReturnTypeDeclaration('Illuminate\Contracts\Cache\Store', 'forever', new BooleanType()),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RenamePropertyRector::class)
|
||||
->call('configure', [[
|
||||
RenamePropertyRector::RENAMED_PROPERTIES => ValueObjectInliner::inline([
|
||||
new RenameProperty('Illuminate\Routing\UrlGenerator', 'cachedSchema', 'cachedScheme'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(PropertyDeferToDeferrableProviderToRector::class);
|
||||
$services->set(MakeTaggedPassedToParameterIterableTypeRector::class);
|
||||
};
|
||||
|
|
|
@ -75,14 +75,11 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
]]);
|
||||
|
||||
$services->set(RenameClassRector::class)
|
||||
->call(
|
||||
'configure',
|
||||
[[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
'Illuminate\Support\Facades\Input' => 'Illuminate\Support\Facades\Request',
|
||||
],
|
||||
]]
|
||||
);
|
||||
->call('configure', [[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
'Illuminate\Support\Facades\Input' => 'Illuminate\Support\Facades\Request',
|
||||
],
|
||||
]]);
|
||||
|
||||
$services->set(ChangeMethodVisibilityRector::class)
|
||||
->call('configure', [[
|
||||
|
|
|
@ -38,59 +38,70 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services->set(RemoveParentCallWithoutParentRector::class);
|
||||
// https://github.com/nette/utils/commit/d0041ba59f5d8bf1f5b3795fd76d43fb13ea2e15
|
||||
$services->set(FormerNullableArgumentToScalarTypedRector::class);
|
||||
$services->set(StaticCallToMethodCallRector::class)->call('configure', [[
|
||||
StaticCallToMethodCallRector::STATIC_CALLS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new StaticCallToMethodCall('Nette\Security\Passwords', 'hash', 'Nette\Security\Passwords', 'hash'),
|
||||
new StaticCallToMethodCall('Nette\Security\Passwords', 'verify', 'Nette\Security\Passwords', 'verify'),
|
||||
new StaticCallToMethodCall(
|
||||
'Nette\Security\Passwords',
|
||||
'needsRehash',
|
||||
'Nette\Security\Passwords',
|
||||
'needsRehash'
|
||||
),
|
||||
]),
|
||||
]]);
|
||||
$services->set(StaticCallToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
StaticCallToMethodCallRector::STATIC_CALLS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new StaticCallToMethodCall('Nette\Security\Passwords', 'hash', 'Nette\Security\Passwords', 'hash'),
|
||||
new StaticCallToMethodCall('Nette\Security\Passwords', 'verify', 'Nette\Security\Passwords', 'verify'),
|
||||
new StaticCallToMethodCall(
|
||||
'Nette\Security\Passwords',
|
||||
'needsRehash',
|
||||
'Nette\Security\Passwords',
|
||||
'needsRehash'
|
||||
),
|
||||
]),
|
||||
]]);
|
||||
// https://github.com/contributte/event-dispatcher-extra/tree/v0.4.3 and higher
|
||||
$services->set(RenameClassConstFetchRector::class)->call('configure', [[
|
||||
RenameClassConstFetchRector::CLASS_CONSTANT_RENAME => ValueObjectInliner::inline([
|
||||
new RenameClassConstFetch('Contributte\Events\Extra\Event\Security\LoggedInEvent', 'NAME', 'class'),
|
||||
new RenameClassConstFetch('Contributte\Events\Extra\Event\Security\LoggedOutEvent', 'NAME', 'class'),
|
||||
new RenameClassConstFetch('Contributte\Events\Extra\Event\Application\ShutdownEvent', 'NAME', 'class'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RenameClassRector::class)->call('configure', [[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
# nextras/forms was split into 2 packages
|
||||
'Nextras\FormComponents\Controls\DatePicker' => 'Nextras\FormComponents\Controls\DateControl',
|
||||
# @see https://github.com/nette/di/commit/a0d361192f8ac35f1d9f82aab7eb351e4be395ea
|
||||
'Nette\DI\ServiceDefinition' => 'Nette\DI\Definitions\ServiceDefinition',
|
||||
'Nette\DI\Statement' => 'Nette\DI\Definitions\Statement',
|
||||
'WebChemistry\Forms\Controls\Multiplier' => 'Contributte\FormMultiplier\Multiplier',
|
||||
],
|
||||
]]);
|
||||
$services->set(ArgumentDefaultValueReplacerRector::class)->call('configure', [[
|
||||
ArgumentDefaultValueReplacerRector::REPLACED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
// json 2nd argument is now `int` typed
|
||||
new ArgumentDefaultValueReplacer('Nette\Utils\Json', 'decode', 1, true, 'Nette\Utils\Json::FORCE_ARRAY'),
|
||||
// @see https://github.com/nette/forms/commit/574b97f9d5e7a902a224e57d7d584e7afc9fefec
|
||||
new ArgumentDefaultValueReplacer('Nette\Forms\Form', 'decode', 0, true, 'array'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RenameMethodRector::class)->call('configure', [[
|
||||
RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([
|
||||
// see https://github.com/nette/forms/commit/b99385aa9d24d729a18f6397a414ea88eab6895a
|
||||
new MethodCallRename('Nette\Forms\Controls\BaseControl', 'setType', 'setHtmlType'),
|
||||
new MethodCallRename('Nette\Forms\Controls\BaseControl', 'setAttribute', 'setHtmlAttribute'),
|
||||
new MethodCallRename(
|
||||
'Nette\DI\Definitions\ServiceDefinition',
|
||||
# see https://github.com/nette/di/commit/1705a5db431423fc610a6f339f88dead1b5dc4fb
|
||||
'setClass',
|
||||
'setType'
|
||||
),
|
||||
new MethodCallRename('Nette\DI\Definitions\ServiceDefinition', 'getClass', 'getType'),
|
||||
new MethodCallRename('Nette\DI\Definitions\Definition', 'isAutowired', 'getAutowired'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RenameClassConstFetchRector::class)
|
||||
->call('configure', [[
|
||||
RenameClassConstFetchRector::CLASS_CONSTANT_RENAME => ValueObjectInliner::inline([
|
||||
new RenameClassConstFetch('Contributte\Events\Extra\Event\Security\LoggedInEvent', 'NAME', 'class'),
|
||||
new RenameClassConstFetch('Contributte\Events\Extra\Event\Security\LoggedOutEvent', 'NAME', 'class'),
|
||||
new RenameClassConstFetch('Contributte\Events\Extra\Event\Application\ShutdownEvent', 'NAME', 'class'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RenameClassRector::class)
|
||||
->call('configure', [[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
# nextras/forms was split into 2 packages
|
||||
'Nextras\FormComponents\Controls\DatePicker' => 'Nextras\FormComponents\Controls\DateControl',
|
||||
# @see https://github.com/nette/di/commit/a0d361192f8ac35f1d9f82aab7eb351e4be395ea
|
||||
'Nette\DI\ServiceDefinition' => 'Nette\DI\Definitions\ServiceDefinition',
|
||||
'Nette\DI\Statement' => 'Nette\DI\Definitions\Statement',
|
||||
'WebChemistry\Forms\Controls\Multiplier' => 'Contributte\FormMultiplier\Multiplier',
|
||||
],
|
||||
]]);
|
||||
$services->set(ArgumentDefaultValueReplacerRector::class)
|
||||
->call('configure', [[
|
||||
ArgumentDefaultValueReplacerRector::REPLACED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
// json 2nd argument is now `int` typed
|
||||
new ArgumentDefaultValueReplacer(
|
||||
'Nette\Utils\Json',
|
||||
'decode',
|
||||
1,
|
||||
true,
|
||||
'Nette\Utils\Json::FORCE_ARRAY'
|
||||
),
|
||||
// @see https://github.com/nette/forms/commit/574b97f9d5e7a902a224e57d7d584e7afc9fefec
|
||||
new ArgumentDefaultValueReplacer('Nette\Forms\Form', 'decode', 0, true, 'array'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RenameMethodRector::class)
|
||||
->call('configure', [[
|
||||
RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([
|
||||
// see https://github.com/nette/forms/commit/b99385aa9d24d729a18f6397a414ea88eab6895a
|
||||
new MethodCallRename('Nette\Forms\Controls\BaseControl', 'setType', 'setHtmlType'),
|
||||
new MethodCallRename('Nette\Forms\Controls\BaseControl', 'setAttribute', 'setHtmlAttribute'),
|
||||
new MethodCallRename(
|
||||
'Nette\DI\Definitions\ServiceDefinition',
|
||||
# see https://github.com/nette/di/commit/1705a5db431423fc610a6f339f88dead1b5dc4fb
|
||||
'setClass',
|
||||
'setType'
|
||||
),
|
||||
new MethodCallRename('Nette\DI\Definitions\ServiceDefinition', 'getClass', 'getType'),
|
||||
new MethodCallRename('Nette\DI\Definitions\Definition', 'isAutowired', 'getAutowired'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(MagicHtmlCallToAppendAttributeRector::class);
|
||||
$services->set(RequestGetCookieDefaultArgumentToCoalesceRector::class);
|
||||
$services->set(RemoveParentAndNameFromComponentConstructorRector::class);
|
||||
|
|
|
@ -34,74 +34,76 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
]),
|
||||
]]);
|
||||
|
||||
$services->set(RenameClassRector::class)->call('configure', [[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
'Nette\Bridges\ApplicationLatte\Template' => 'Nette\Bridges\ApplicationLatte\DefaultTemplate',
|
||||
$services->set(RenameClassRector::class)
|
||||
->call('configure', [[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
'Nette\Bridges\ApplicationLatte\Template' => 'Nette\Bridges\ApplicationLatte\DefaultTemplate',
|
||||
|
||||
// https://github.com/nette/application/compare/v3.0.7...v3.1.0
|
||||
'Nette\Application\IRouter' => 'Nette\Routing\Router',
|
||||
'Nette\Application\IResponse' => 'Nette\Application\Response',
|
||||
'Nette\Application\UI\IRenderable' => 'Nette\Application\UI\Renderable',
|
||||
'Nette\Application\UI\ISignalReceiver' => 'Nette\Application\UI\SignalReceiver',
|
||||
'Nette\Application\UI\IStatePersistent' => 'Nette\Application\UI\StatePersistent',
|
||||
'Nette\Application\UI\ITemplate' => 'Nette\Application\UI\Template',
|
||||
'Nette\Application\UI\ITemplateFactory' => 'Nette\Application\UI\TemplateFactory',
|
||||
'Nette\Bridges\ApplicationLatte\ILatteFactory' => 'Nette\Bridges\ApplicationLatte\LatteFactory',
|
||||
// https://github.com/nette/application/compare/v3.0.7...v3.1.0
|
||||
'Nette\Application\IRouter' => 'Nette\Routing\Router',
|
||||
'Nette\Application\IResponse' => 'Nette\Application\Response',
|
||||
'Nette\Application\UI\IRenderable' => 'Nette\Application\UI\Renderable',
|
||||
'Nette\Application\UI\ISignalReceiver' => 'Nette\Application\UI\SignalReceiver',
|
||||
'Nette\Application\UI\IStatePersistent' => 'Nette\Application\UI\StatePersistent',
|
||||
'Nette\Application\UI\ITemplate' => 'Nette\Application\UI\Template',
|
||||
'Nette\Application\UI\ITemplateFactory' => 'Nette\Application\UI\TemplateFactory',
|
||||
'Nette\Bridges\ApplicationLatte\ILatteFactory' => 'Nette\Bridges\ApplicationLatte\LatteFactory',
|
||||
|
||||
// https://github.com/nette/bootstrap/compare/v3.0.2...v3.1.0
|
||||
'Nette\Configurator' => 'Nette\Bootstrap\Configurator',
|
||||
// https://github.com/nette/bootstrap/compare/v3.0.2...v3.1.0
|
||||
'Nette\Configurator' => 'Nette\Bootstrap\Configurator',
|
||||
|
||||
// https://github.com/nette/caching/compare/v3.0.2...v3.1.0
|
||||
'Nette\Caching\IBulkReader' => 'Nette\Caching\BulkReader',
|
||||
'Nette\Caching\IStorage' => 'Nette\Caching\Storage',
|
||||
'Nette\Caching\Storages\IJournal' => 'Nette\Caching\Storages\Journal',
|
||||
// https://github.com/nette/caching/compare/v3.0.2...v3.1.0
|
||||
'Nette\Caching\IBulkReader' => 'Nette\Caching\BulkReader',
|
||||
'Nette\Caching\IStorage' => 'Nette\Caching\Storage',
|
||||
'Nette\Caching\Storages\IJournal' => 'Nette\Caching\Storages\Journal',
|
||||
|
||||
// https://github.com/nette/database/compare/v3.0.7...v3.1.1
|
||||
'Nette\Database\ISupplementalDriver' => 'Nette\Database\Driver',
|
||||
'Nette\Database\IConventions' => 'Nette\Database\Conventions',
|
||||
'Nette\Database\Context' => 'Nette\Database\Explorer',
|
||||
'Nette\Database\IRow' => 'Nette\Database\Row',
|
||||
'Nette\Database\IRowContainer' => 'Nette\Database\ResultSet',
|
||||
'Nette\Database\Table\IRow' => 'Nette\Database\Table\ActiveRow',
|
||||
'Nette\Database\Table\IRowContainer' => 'Nette\Database\Table\Selection',
|
||||
// https://github.com/nette/database/compare/v3.0.7...v3.1.1
|
||||
'Nette\Database\ISupplementalDriver' => 'Nette\Database\Driver',
|
||||
'Nette\Database\IConventions' => 'Nette\Database\Conventions',
|
||||
'Nette\Database\Context' => 'Nette\Database\Explorer',
|
||||
'Nette\Database\IRow' => 'Nette\Database\Row',
|
||||
'Nette\Database\IRowContainer' => 'Nette\Database\ResultSet',
|
||||
'Nette\Database\Table\IRow' => 'Nette\Database\Table\ActiveRow',
|
||||
'Nette\Database\Table\IRowContainer' => 'Nette\Database\Table\Selection',
|
||||
|
||||
// https://github.com/nette/forms/compare/v3.0.7...v3.1.0-RC2
|
||||
'Nette\Forms\IControl' => 'Nette\Forms\Control',
|
||||
'Nette\Forms\IFormRenderer' => 'Nette\Forms\FormRenderer',
|
||||
'Nette\Forms\ISubmitterControl' => 'Nette\Forms\SubmitterControl',
|
||||
// https://github.com/nette/forms/compare/v3.0.7...v3.1.0-RC2
|
||||
'Nette\Forms\IControl' => 'Nette\Forms\Control',
|
||||
'Nette\Forms\IFormRenderer' => 'Nette\Forms\FormRenderer',
|
||||
'Nette\Forms\ISubmitterControl' => 'Nette\Forms\SubmitterControl',
|
||||
|
||||
// https://github.com/nette/mail/compare/v3.0.1...v3.1.5
|
||||
'Nette\Mail\IMailer' => 'Nette\Mail\Mailer',
|
||||
// https://github.com/nette/mail/compare/v3.0.1...v3.1.5
|
||||
'Nette\Mail\IMailer' => 'Nette\Mail\Mailer',
|
||||
|
||||
// https://github.com/nette/security/compare/v3.0.5...v3.1.2
|
||||
'Nette\Security\IAuthorizator' => 'Nette\Security\Authorizator',
|
||||
'Nette\Security\Identity' => 'Nette\Security\SimpleIdentity',
|
||||
'Nette\Security\IResource' => 'Nette\Security\Resource',
|
||||
'Nette\Security\IRole' => 'Nette\Security\Role',
|
||||
// https://github.com/nette/security/compare/v3.0.5...v3.1.2
|
||||
'Nette\Security\IAuthorizator' => 'Nette\Security\Authorizator',
|
||||
'Nette\Security\Identity' => 'Nette\Security\SimpleIdentity',
|
||||
'Nette\Security\IResource' => 'Nette\Security\Resource',
|
||||
'Nette\Security\IRole' => 'Nette\Security\Role',
|
||||
|
||||
// https://github.com/nette/utils/compare/v3.1.4...v3.2.1
|
||||
'Nette\Utils\IHtmlString' => 'Nette\HtmlStringable',
|
||||
'Nette\Localization\ITranslator' => 'Nette\Localization\Translator',
|
||||
// https://github.com/nette/utils/compare/v3.1.4...v3.2.1
|
||||
'Nette\Utils\IHtmlString' => 'Nette\HtmlStringable',
|
||||
'Nette\Localization\ITranslator' => 'Nette\Localization\Translator',
|
||||
|
||||
// https://github.com/nette/latte/compare/v2.5.5...v2.9.2
|
||||
'Latte\ILoader' => 'Latte\Loader',
|
||||
'Latte\IMacro' => 'Latte\Macro',
|
||||
'Latte\Runtime\IHtmlString' => 'Latte\Runtime\HtmlStringable',
|
||||
'Latte\Runtime\ISnippetBridge' => 'Latte\Runtime\SnippetBridge',
|
||||
],
|
||||
]]);
|
||||
// https://github.com/nette/latte/compare/v2.5.5...v2.9.2
|
||||
'Latte\ILoader' => 'Latte\Loader',
|
||||
'Latte\IMacro' => 'Latte\Macro',
|
||||
'Latte\Runtime\IHtmlString' => 'Latte\Runtime\HtmlStringable',
|
||||
'Latte\Runtime\ISnippetBridge' => 'Latte\Runtime\SnippetBridge',
|
||||
],
|
||||
]]);
|
||||
|
||||
$services->set(RenameMethodRector::class)->call('configure', [[
|
||||
RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([
|
||||
// https://github.com/nette/caching/commit/60281abf366c4ab76e9436dc1bfe2e402db18b67
|
||||
new MethodCallRename('Nette\Caching\Cache', 'start', 'capture'),
|
||||
// https://github.com/nette/forms/commit/faaaf8b8fd3408a274a9de7ca3f342091010ad5d
|
||||
new MethodCallRename('Nette\Forms\Container', 'addImage', 'addImageButton'),
|
||||
// https://github.com/nette/utils/commit/d0427c1811462dbb6c503143eabe5478b26685f7
|
||||
new MethodCallRename('Nette\Utils\Arrays', 'searchKey', 'getKeyOffset'),
|
||||
new MethodCallRename('Nette\Configurator', 'addParameters', 'addStaticParameters'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RenameMethodRector::class)
|
||||
->call('configure', [[
|
||||
RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([
|
||||
// https://github.com/nette/caching/commit/60281abf366c4ab76e9436dc1bfe2e402db18b67
|
||||
new MethodCallRename('Nette\Caching\Cache', 'start', 'capture'),
|
||||
// https://github.com/nette/forms/commit/faaaf8b8fd3408a274a9de7ca3f342091010ad5d
|
||||
new MethodCallRename('Nette\Forms\Container', 'addImage', 'addImageButton'),
|
||||
// https://github.com/nette/utils/commit/d0427c1811462dbb6c503143eabe5478b26685f7
|
||||
new MethodCallRename('Nette\Utils\Arrays', 'searchKey', 'getKeyOffset'),
|
||||
new MethodCallRename('Nette\Configurator', 'addParameters', 'addStaticParameters'),
|
||||
]),
|
||||
]]);
|
||||
|
||||
$services->set(RenameStaticMethodRector::class)
|
||||
->call('configure', [[
|
||||
|
|
|
@ -9,12 +9,9 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(RenameClassRector::class)
|
||||
->call(
|
||||
'configure',
|
||||
[[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
'Doctrine\Common\DataFixtures\AbstractFixture' => 'Doctrine\Bundle\FixturesBundle\Fixture',
|
||||
],
|
||||
]]
|
||||
);
|
||||
->call('configure', [[
|
||||
RenameClassRector::OLD_TO_NEW_CLASSES => [
|
||||
'Doctrine\Common\DataFixtures\AbstractFixture' => 'Doctrine\Bundle\FixturesBundle\Fixture',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -40,42 +40,44 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services->set(ChangeSwitchToMatchRector::class);
|
||||
|
||||
// nette\utils and Strings::replace()
|
||||
$services->set(ArgumentAdderRector::class)->call('configure', [[
|
||||
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
new ArgumentAdder('Nette\Utils\Strings', 'replace', 2, 'replacement', ''),
|
||||
]),
|
||||
]]);
|
||||
$services->set(ArgumentAdderRector::class)
|
||||
->call('configure', [[
|
||||
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
new ArgumentAdder('Nette\Utils\Strings', 'replace', 2, 'replacement', ''),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RemoveParentCallWithoutParentRector::class);
|
||||
$services->set(SetStateToStaticRector::class);
|
||||
$services->set(FinalPrivateToPrivateVisibilityRector::class);
|
||||
// @see https://php.watch/versions/8.0/pgsql-aliases-deprecated
|
||||
$services->set(RenameFunctionRector::class)->call('configure', [[
|
||||
RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
|
||||
'pg_clientencoding' => 'pg_client_encoding',
|
||||
'pg_cmdtuples' => 'pg_affected_rows',
|
||||
'pg_errormessage' => 'pg_last_error',
|
||||
'pg_fieldisnull' => 'pg_field_is_null',
|
||||
'pg_fieldname' => 'pg_field_name',
|
||||
'pg_fieldnum' => 'pg_field_num',
|
||||
'pg_fieldprtlen' => 'pg_field_prtlen',
|
||||
'pg_fieldsize' => 'pg_field_size',
|
||||
'pg_fieldtype' => 'pg_field_type',
|
||||
'pg_freeresult' => 'pg_free_result',
|
||||
'pg_getlastoid' => 'pg_last_oid',
|
||||
'pg_loclose' => 'pg_lo_close',
|
||||
'pg_locreate' => 'pg_lo_create',
|
||||
'pg_loexport' => 'pg_lo_export',
|
||||
'pg_loimport' => 'pg_lo_import',
|
||||
'pg_loopen' => 'pg_lo_open',
|
||||
'pg_loread' => 'pg_lo_read',
|
||||
'pg_loreadall' => 'pg_lo_read_all',
|
||||
'pg_lounlink' => 'pg_lo_unlink',
|
||||
'pg_lowrite' => 'pg_lo_write',
|
||||
'pg_numfields' => 'pg_num_fields',
|
||||
'pg_numrows' => 'pg_num_rows',
|
||||
'pg_result' => 'pg_fetch_result',
|
||||
'pg_setclientencoding' => 'pg_set_client_encoding',
|
||||
],
|
||||
]]);
|
||||
$services->set(RenameFunctionRector::class)
|
||||
->call('configure', [[
|
||||
RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
|
||||
'pg_clientencoding' => 'pg_client_encoding',
|
||||
'pg_cmdtuples' => 'pg_affected_rows',
|
||||
'pg_errormessage' => 'pg_last_error',
|
||||
'pg_fieldisnull' => 'pg_field_is_null',
|
||||
'pg_fieldname' => 'pg_field_name',
|
||||
'pg_fieldnum' => 'pg_field_num',
|
||||
'pg_fieldprtlen' => 'pg_field_prtlen',
|
||||
'pg_fieldsize' => 'pg_field_size',
|
||||
'pg_fieldtype' => 'pg_field_type',
|
||||
'pg_freeresult' => 'pg_free_result',
|
||||
'pg_getlastoid' => 'pg_last_oid',
|
||||
'pg_loclose' => 'pg_lo_close',
|
||||
'pg_locreate' => 'pg_lo_create',
|
||||
'pg_loexport' => 'pg_lo_export',
|
||||
'pg_loimport' => 'pg_lo_import',
|
||||
'pg_loopen' => 'pg_lo_open',
|
||||
'pg_loread' => 'pg_lo_read',
|
||||
'pg_loreadall' => 'pg_lo_read_all',
|
||||
'pg_lounlink' => 'pg_lo_unlink',
|
||||
'pg_lowrite' => 'pg_lo_write',
|
||||
'pg_numfields' => 'pg_num_fields',
|
||||
'pg_numrows' => 'pg_num_rows',
|
||||
'pg_result' => 'pg_fetch_result',
|
||||
'pg_setclientencoding' => 'pg_set_client_encoding',
|
||||
],
|
||||
]]);
|
||||
$services->set(OptionalParametersAfterRequiredRector::class);
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# 668 Rules Overview
|
||||
# 669 Rules Overview
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
|||
|
||||
- [DowngradePhp80](#downgradephp80) (12)
|
||||
|
||||
- [EarlyReturn](#earlyreturn) (8)
|
||||
- [EarlyReturn](#earlyreturn) (9)
|
||||
|
||||
- [Generic](#generic) (11)
|
||||
|
||||
|
@ -2458,7 +2458,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
|
||||
### SplitDoubleAssignRector
|
||||
|
||||
Split multiple inline assigns to `each` own lines default value, to prevent undefined array issues
|
||||
Split multiple inline assigns to each own lines default value, to prevent undefined array issues
|
||||
|
||||
- class: `Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector`
|
||||
|
||||
|
@ -5183,17 +5183,16 @@ Turns parent EntityRepository class to constructor dependency
|
|||
|
||||
+use App\Entity\Post;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
+use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
-final class PostRepository extends EntityRepository
|
||||
+final class PostRepository
|
||||
{
|
||||
+ /**
|
||||
+ * @var \Doctrine\ORM\EntityRepository
|
||||
+ */
|
||||
+ private $repository;
|
||||
+ public function __construct(\Doctrine\ORM\EntityManager $entityManager)
|
||||
+ private EntityRepository $repository;
|
||||
+
|
||||
+ public function __construct(EntityManagerInterface $entityManager)
|
||||
+ {
|
||||
+ $this->repository = $entityManager->getRepository(\App\Entity\Post::class);
|
||||
+ $this->repository = $entityManager->getRepository(Post::class);
|
||||
+ }
|
||||
}
|
||||
```
|
||||
|
@ -6708,6 +6707,35 @@ Split if statement, when if condition always break execution flow
|
|||
|
||||
<br>
|
||||
|
||||
### ReturnAfterToEarlyOnBreakRector
|
||||
|
||||
Change return after foreach to early return in foreach on break
|
||||
|
||||
- class: `Rector\EarlyReturn\Rector\Foreach_\ReturnAfterToEarlyOnBreakRector`
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
public function run(array $pathConstants, string $allowedPath)
|
||||
{
|
||||
- $pathOK = false;
|
||||
-
|
||||
foreach ($pathConstants as $allowedPath) {
|
||||
if ($dirPath == $allowedPath) {
|
||||
- $pathOK = true;
|
||||
- break;
|
||||
+ return true;
|
||||
}
|
||||
}
|
||||
|
||||
- return $pathOK;
|
||||
+ return false;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### ReturnBinaryAndToEarlyReturnRector
|
||||
|
||||
Changes Single return of && && to early returns
|
||||
|
@ -13325,7 +13353,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
|
||||
### PassFactoryToUniqueObjectRector
|
||||
|
||||
Convert new `X/Static::call()` to factories in entities, pass them via constructor to `each` other
|
||||
Convert new `X/Static::call()` to factories in entities, pass them via constructor to each other
|
||||
|
||||
:wrench: **configure it!**
|
||||
|
||||
|
|
|
@ -5,15 +5,13 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(MoveServicesBySuffixToDirectoryRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(MoveServicesBySuffixToDirectoryRector::class)
|
||||
->call('configure', [[
|
||||
MoveServicesBySuffixToDirectoryRector::GROUP_NAMES_BY_SUFFIX => [
|
||||
'Repository',
|
||||
'Command',
|
||||
'Mapper',
|
||||
'Controller',
|
||||
],
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,21 +8,22 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ModalToGetSetRector::class)->call('configure', [[
|
||||
ModalToGetSetRector::UNPREFIXED_METHODS_TO_GET_SET => ValueObjectInliner::inline([
|
||||
$services->set(ModalToGetSetRector::class)
|
||||
->call('configure', [[
|
||||
ModalToGetSetRector::UNPREFIXED_METHODS_TO_GET_SET => ValueObjectInliner::inline([
|
||||
|
||||
new ModalToGetSet(SomeModelType::class, 'config', null, null, 2, 'array'),
|
||||
new ModalToGetSet(
|
||||
SomeModelType::class,
|
||||
'customMethod',
|
||||
'customMethodGetName',
|
||||
'customMethodSetName',
|
||||
2,
|
||||
'array'
|
||||
),
|
||||
new ModalToGetSet(SomeModelType::class, 'makeEntity', 'createEntity', 'generateEntity'),
|
||||
new ModalToGetSet(SomeModelType::class, 'method'),
|
||||
new ModalToGetSet(SomeModelType::class, 'config', null, null, 2, 'array'),
|
||||
new ModalToGetSet(
|
||||
SomeModelType::class,
|
||||
'customMethod',
|
||||
'customMethodGetName',
|
||||
'customMethodSetName',
|
||||
2,
|
||||
'array'
|
||||
),
|
||||
new ModalToGetSet(SomeModelType::class, 'makeEntity', 'createEntity', 'generateEntity'),
|
||||
new ModalToGetSet(SomeModelType::class, 'method'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,15 +8,11 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RenameMethodCallBasedOnParameterRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(RenameMethodCallBasedOnParameterRector::class)
|
||||
->call('configure', [[
|
||||
RenameMethodCallBasedOnParameterRector::CALLS_WITH_PARAM_RENAMES => ValueObjectInliner::inline([
|
||||
|
||||
new RenameMethodCallBasedOnParameter(SomeModelType::class, 'getParam', 'paging', 'getAttribute'),
|
||||
new RenameMethodCallBasedOnParameter(SomeModelType::class, 'withParam', 'paging', 'withAttribute'),
|
||||
|
||||
]),
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -10,17 +10,13 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ReturnArrayClassMethodToYieldRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(ReturnArrayClassMethodToYieldRector::class)
|
||||
->call('configure', [[
|
||||
ReturnArrayClassMethodToYieldRector::METHODS_TO_YIELDS => ValueObjectInliner::inline([
|
||||
|
||||
new ReturnArrayClassMethodToYield(EventSubscriberInterface::class, 'getSubscribedEvents'),
|
||||
new ReturnArrayClassMethodToYield(ParentTestCase::class, 'provide*'),
|
||||
new ReturnArrayClassMethodToYield(ParentTestCase::class, 'dataProvider*'),
|
||||
new ReturnArrayClassMethodToYield(TestCase::class, 'provideData'),
|
||||
|
||||
]),
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,12 +6,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(YieldClassMethodToArrayClassMethodRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(YieldClassMethodToArrayClassMethodRector::class)
|
||||
->call('configure', [[
|
||||
YieldClassMethodToArrayClassMethodRector::METHODS_BY_TYPE => [
|
||||
EventSubscriberInterface::class => ['getSubscribedEvents'],
|
||||
],
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,10 +5,11 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(FunctionCallToConstantRector::class)->call('configure', [[
|
||||
FunctionCallToConstantRector::FUNCTIONS_TO_CONSTANTS => [
|
||||
'php_sapi_name' => 'PHP_SAPI',
|
||||
'pi' => 'M_PI',
|
||||
],
|
||||
]]);
|
||||
$services->set(FunctionCallToConstantRector::class)
|
||||
->call('configure', [[
|
||||
FunctionCallToConstantRector::FUNCTIONS_TO_CONSTANTS => [
|
||||
'php_sapi_name' => 'PHP_SAPI',
|
||||
'pi' => 'M_PI',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,11 +8,12 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(PreferThisOrSelfMethodCallRector::class)->call('configure', [[
|
||||
PreferThisOrSelfMethodCallRector::TYPE_TO_PREFERENCE => [
|
||||
AbstractTestCase::class => 'self',
|
||||
BeLocalClass::class => 'this',
|
||||
TestCase::class => 'self',
|
||||
],
|
||||
]]);
|
||||
$services->set(PreferThisOrSelfMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
PreferThisOrSelfMethodCallRector::TYPE_TO_PREFERENCE => [
|
||||
AbstractTestCase::class => 'self',
|
||||
BeLocalClass::class => 'this',
|
||||
TestCase::class => 'self',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,7 +6,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RemoveAnnotationRector::class)->call('configure', [[
|
||||
RemoveAnnotationRector::ANNOTATIONS_TO_REMOVE => ['method', JMSInjectParamsTagValueNode::class],
|
||||
]]);
|
||||
$services->set(RemoveAnnotationRector::class)
|
||||
->call('configure', [[
|
||||
RemoveAnnotationRector::ANNOTATIONS_TO_REMOVE => ['method', JMSInjectParamsTagValueNode::class],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,7 +6,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(AddEntityIdByConditionRector::class)->call('configure', [[
|
||||
AddEntityIdByConditionRector::DETECTED_TRAITS => [SomeTrait::class],
|
||||
]]);
|
||||
$services->set(AddEntityIdByConditionRector::class)
|
||||
->call('configure', [[
|
||||
AddEntityIdByConditionRector::DETECTED_TRAITS => [SomeTrait::class],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,12 +5,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(EntityAliasToClassConstantReferenceRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(EntityAliasToClassConstantReferenceRector::class)
|
||||
->call('configure', [[
|
||||
EntityAliasToClassConstantReferenceRector::ALIASES_TO_NAMESPACES => [
|
||||
'App' => 'App\Entity',
|
||||
],
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,9 +6,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(AddMethodParentCallRector::class)->call('configure', [[
|
||||
AddMethodParentCallRector::METHODS_BY_PARENT_TYPES => [
|
||||
ParentClassWithNewConstructor::class => '__construct',
|
||||
],
|
||||
]]);
|
||||
$services->set(AddMethodParentCallRector::class)
|
||||
->call('configure', [[
|
||||
AddMethodParentCallRector::METHODS_BY_PARENT_TYPES => [
|
||||
ParentClassWithNewConstructor::class => '__construct',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -10,38 +10,39 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ArgumentAdderRector::class)->call('configure', [[
|
||||
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
// covers https://github.com/rectorphp/rector/issues/4267
|
||||
new ArgumentAdder(
|
||||
SomeContainerBuilder::class,
|
||||
'sendResetLinkResponse',
|
||||
0,
|
||||
'request',
|
||||
null,
|
||||
'Illuminate\Http\Illuminate\Http'
|
||||
),
|
||||
new ArgumentAdder(SomeContainerBuilder::class, 'compile', 0, 'isCompiled', false),
|
||||
new ArgumentAdder(SomeContainerBuilder::class, 'addCompilerPass', 2, 'priority', 0, 'int'),
|
||||
// scoped
|
||||
new ArgumentAdder(
|
||||
SomeParentClient::class,
|
||||
'submit',
|
||||
2,
|
||||
'serverParameters',
|
||||
[],
|
||||
'array',
|
||||
ArgumentAddingScope::SCOPE_PARENT_CALL
|
||||
),
|
||||
new ArgumentAdder(
|
||||
SomeParentClient::class,
|
||||
'submit',
|
||||
2,
|
||||
'serverParameters',
|
||||
[],
|
||||
'array',
|
||||
ArgumentAddingScope::SCOPE_CLASS_METHOD
|
||||
),
|
||||
]),
|
||||
]]);
|
||||
$services->set(ArgumentAdderRector::class)
|
||||
->call('configure', [[
|
||||
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
// covers https://github.com/rectorphp/rector/issues/4267
|
||||
new ArgumentAdder(
|
||||
SomeContainerBuilder::class,
|
||||
'sendResetLinkResponse',
|
||||
0,
|
||||
'request',
|
||||
null,
|
||||
'Illuminate\Http\Illuminate\Http'
|
||||
),
|
||||
new ArgumentAdder(SomeContainerBuilder::class, 'compile', 0, 'isCompiled', false),
|
||||
new ArgumentAdder(SomeContainerBuilder::class, 'addCompilerPass', 2, 'priority', 0, 'int'),
|
||||
// scoped
|
||||
new ArgumentAdder(
|
||||
SomeParentClient::class,
|
||||
'submit',
|
||||
2,
|
||||
'serverParameters',
|
||||
[],
|
||||
'array',
|
||||
ArgumentAddingScope::SCOPE_PARENT_CALL
|
||||
),
|
||||
new ArgumentAdder(
|
||||
SomeParentClient::class,
|
||||
'submit',
|
||||
2,
|
||||
'serverParameters',
|
||||
[],
|
||||
'array',
|
||||
ArgumentAddingScope::SCOPE_CLASS_METHOD
|
||||
),
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,45 +7,46 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ArgumentDefaultValueReplacerRector::class)->call('configure', [[
|
||||
ArgumentDefaultValueReplacerRector::REPLACED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
$services->set(ArgumentDefaultValueReplacerRector::class)
|
||||
->call('configure', [[
|
||||
ArgumentDefaultValueReplacerRector::REPLACED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
|
||||
new ArgumentDefaultValueReplacer(
|
||||
'Symfony\Component\DependencyInjection\Definition',
|
||||
'setScope',
|
||||
0,
|
||||
'Symfony\Component\DependencyInjection\ContainerBuilder::SCOPE_PROTOTYPE',
|
||||
false
|
||||
),
|
||||
new ArgumentDefaultValueReplacer('Symfony\Component\Yaml\Yaml', 'parse', 1, [
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
], 'Symfony\Component\Yaml\Yaml::PARSE_OBJECT_FOR_MAP'),
|
||||
new ArgumentDefaultValueReplacer('Symfony\Component\Yaml\Yaml', 'parse', 1, [
|
||||
false,
|
||||
true,
|
||||
], 'Symfony\Component\Yaml\Yaml::PARSE_OBJECT'),
|
||||
new ArgumentDefaultValueReplacer('Symfony\Component\Yaml\Yaml', 'parse', 1, false, 0),
|
||||
new ArgumentDefaultValueReplacer(
|
||||
'Symfony\Component\Yaml\Yaml',
|
||||
'parse',
|
||||
1,
|
||||
true,
|
||||
'Symfony\Component\Yaml\Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE'
|
||||
),
|
||||
new ArgumentDefaultValueReplacer('Symfony\Component\Yaml\Yaml', 'dump', 3, [
|
||||
false,
|
||||
true,
|
||||
], 'Symfony\Component\Yaml\Yaml::DUMP_OBJECT'),
|
||||
new ArgumentDefaultValueReplacer(
|
||||
'Symfony\Component\Yaml\Yaml',
|
||||
'dump',
|
||||
3,
|
||||
true,
|
||||
'Symfony\Component\Yaml\Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE'
|
||||
),
|
||||
new ArgumentDefaultValueReplacer(
|
||||
'Symfony\Component\DependencyInjection\Definition',
|
||||
'setScope',
|
||||
0,
|
||||
'Symfony\Component\DependencyInjection\ContainerBuilder::SCOPE_PROTOTYPE',
|
||||
false
|
||||
),
|
||||
new ArgumentDefaultValueReplacer('Symfony\Component\Yaml\Yaml', 'parse', 1, [
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
], 'Symfony\Component\Yaml\Yaml::PARSE_OBJECT_FOR_MAP'),
|
||||
new ArgumentDefaultValueReplacer('Symfony\Component\Yaml\Yaml', 'parse', 1, [
|
||||
false,
|
||||
true,
|
||||
], 'Symfony\Component\Yaml\Yaml::PARSE_OBJECT'),
|
||||
new ArgumentDefaultValueReplacer('Symfony\Component\Yaml\Yaml', 'parse', 1, false, 0),
|
||||
new ArgumentDefaultValueReplacer(
|
||||
'Symfony\Component\Yaml\Yaml',
|
||||
'parse',
|
||||
1,
|
||||
true,
|
||||
'Symfony\Component\Yaml\Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE'
|
||||
),
|
||||
new ArgumentDefaultValueReplacer('Symfony\Component\Yaml\Yaml', 'dump', 3, [
|
||||
false,
|
||||
true,
|
||||
], 'Symfony\Component\Yaml\Yaml::DUMP_OBJECT'),
|
||||
new ArgumentDefaultValueReplacer(
|
||||
'Symfony\Component\Yaml\Yaml',
|
||||
'dump',
|
||||
3,
|
||||
true,
|
||||
'Symfony\Component\Yaml\Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE'
|
||||
),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,11 +8,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(NormalToFluentRector::class)->call('configure', [[
|
||||
NormalToFluentRector::CALLS_TO_FLUENT => ValueObjectInliner::inline([
|
||||
$services->set(NormalToFluentRector::class)
|
||||
->call('configure', [[
|
||||
NormalToFluentRector::CALLS_TO_FLUENT => ValueObjectInliner::inline([
|
||||
|
||||
new NormalToFluent(FluentInterfaceClass::class, ['someFunction', 'otherFunction', 'joinThisAsWell']),
|
||||
]
|
||||
),
|
||||
]]);
|
||||
new NormalToFluent(FluentInterfaceClass::class, ['someFunction', 'otherFunction', 'joinThisAsWell']),
|
||||
]
|
||||
),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,11 +8,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(SingleToManyMethodRector::class)->call('configure', [[
|
||||
SingleToManyMethodRector::SINGLES_TO_MANY_METHODS => ValueObjectInliner::inline([
|
||||
$services->set(SingleToManyMethodRector::class)
|
||||
->call('configure', [[
|
||||
SingleToManyMethodRector::SINGLES_TO_MANY_METHODS => ValueObjectInliner::inline([
|
||||
|
||||
new SingleToManyMethod(OneToManyInterface::class, 'getNode', 'getNodes'),
|
||||
new SingleToManyMethod(OneToManyInterface::class, 'getNode', 'getNodes'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,11 +8,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(WrapReturnRector::class)->call('configure', [[
|
||||
WrapReturnRector::TYPE_METHOD_WRAPS => ValueObjectInliner::inline([
|
||||
$services->set(WrapReturnRector::class)
|
||||
->call('configure', [[
|
||||
WrapReturnRector::TYPE_METHOD_WRAPS => ValueObjectInliner::inline([
|
||||
|
||||
new WrapReturn(SomeReturnClass::class, 'getItem', true),
|
||||
new WrapReturn(SomeReturnClass::class, 'getItem', true),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,9 +7,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(AddInterfaceByTraitRector::class)->call('configure', [[
|
||||
AddInterfaceByTraitRector::INTERFACE_BY_TRAIT => [
|
||||
SomeTrait::class => SomeInterface::class,
|
||||
],
|
||||
]]);
|
||||
$services->set(AddInterfaceByTraitRector::class)
|
||||
->call('configure', [[
|
||||
AddInterfaceByTraitRector::INTERFACE_BY_TRAIT => [
|
||||
SomeTrait::class => SomeInterface::class,
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,9 +7,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(MergeInterfacesRector::class)->call('configure', [[
|
||||
MergeInterfacesRector::OLD_TO_NEW_INTERFACES => [
|
||||
SomeOldInterface::class => SomeInterface::class,
|
||||
],
|
||||
]]);
|
||||
$services->set(MergeInterfacesRector::class)
|
||||
->call('configure', [[
|
||||
MergeInterfacesRector::OLD_TO_NEW_INTERFACES => [
|
||||
SomeOldInterface::class => SomeInterface::class,
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,11 +7,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(SwapFuncCallArgumentsRector::class)->call('configure', [[
|
||||
SwapFuncCallArgumentsRector::FUNCTION_ARGUMENT_SWAPS => ValueObjectInliner::inline([
|
||||
$services->set(SwapFuncCallArgumentsRector::class)
|
||||
->call('configure', [[
|
||||
SwapFuncCallArgumentsRector::FUNCTION_ARGUMENT_SWAPS => ValueObjectInliner::inline([
|
||||
|
||||
new SwapFuncCallArguments('some_function', [1, 0]),
|
||||
]
|
||||
),
|
||||
]]);
|
||||
new SwapFuncCallArguments('some_function', [1, 0]),
|
||||
]
|
||||
),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,7 +5,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(AddTopIncludeRector::class)->call('configure', [[
|
||||
AddTopIncludeRector::AUTOLOAD_FILE_PATH => '/../autoloader.php',
|
||||
]]);
|
||||
$services->set(AddTopIncludeRector::class)
|
||||
->call('configure', [[
|
||||
AddTopIncludeRector::AUTOLOAD_FILE_PATH => '/../autoloader.php',
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,10 +5,11 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ReservedObjectRector::class)->call('configure', [[
|
||||
ReservedObjectRector::RESERVED_KEYWORDS_TO_REPLACEMENTS => [
|
||||
'ReservedObject' => 'SmartObject',
|
||||
'Object' => 'AnotherSmartObject',
|
||||
],
|
||||
]]);
|
||||
$services->set(ReservedObjectRector::class)
|
||||
->call('configure', [[
|
||||
ReservedObjectRector::RESERVED_KEYWORDS_TO_REPLACEMENTS => [
|
||||
'ReservedObject' => 'SmartObject',
|
||||
'Object' => 'AnotherSmartObject',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,10 +5,11 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ReservedFnFunctionRector::class)->call('configure', [[
|
||||
ReservedFnFunctionRector::RESERVED_NAMES_TO_NEW_ONES => [
|
||||
// for testing purposes of "fn" even on PHP 7.3-
|
||||
'reservedFn' => 'f',
|
||||
],
|
||||
]]);
|
||||
$services->set(ReservedFnFunctionRector::class)
|
||||
->call('configure', [[
|
||||
ReservedFnFunctionRector::RESERVED_NAMES_TO_NEW_ONES => [
|
||||
// for testing purposes of "fn" even on PHP 7.3-
|
||||
'reservedFn' => 'f',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,7 +5,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(AddLiteralSeparatorToNumberRector::class)->call('configure', [[
|
||||
AddLiteralSeparatorToNumberRector::LIMIT_VALUE => 1000000,
|
||||
]]);
|
||||
$services->set(AddLiteralSeparatorToNumberRector::class)
|
||||
->call('configure', [[
|
||||
AddLiteralSeparatorToNumberRector::LIMIT_VALUE => 1000000,
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,7 +5,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(TypedPropertyRector::class)->call('configure', [[
|
||||
TypedPropertyRector::CLASS_LIKE_TYPE_ONLY => true,
|
||||
]]);
|
||||
$services->set(TypedPropertyRector::class)
|
||||
->call('configure', [[
|
||||
TypedPropertyRector::CLASS_LIKE_TYPE_ONLY => true,
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,10 +6,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(PHPUnitStaticToKernelTestCaseGetRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(PHPUnitStaticToKernelTestCaseGetRector::class)
|
||||
->call('configure', [[
|
||||
PHPUnitStaticToKernelTestCaseGetRector::STATIC_CLASS_TYPES => [ClassWithStaticMethods::class],
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,11 +7,12 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(StaticTypeToSetterInjectionRector::class)->call('configure', [[
|
||||
StaticTypeToSetterInjectionRector::STATIC_TYPES => [
|
||||
GenericEntityFactory::class,
|
||||
// with adding a parent interface to the class
|
||||
'ParentSetterEnforcingInterface' => GenericEntityFactoryWithInterface::class,
|
||||
],
|
||||
]]);
|
||||
$services->set(StaticTypeToSetterInjectionRector::class)
|
||||
->call('configure', [[
|
||||
StaticTypeToSetterInjectionRector::STATIC_TYPES => [
|
||||
GenericEntityFactory::class,
|
||||
// with adding a parent interface to the class
|
||||
'ParentSetterEnforcingInterface' => GenericEntityFactoryWithInterface::class,
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -10,22 +10,18 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ArgumentRemoverRector::class)->call('configure', [[
|
||||
ArgumentRemoverRector::REMOVED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
|
||||
new ArgumentRemover(Persister::class, 'getSelectJoinColumnSQL', 4, null), new ArgumentRemover(
|
||||
Yaml::class,
|
||||
'parse',
|
||||
1,
|
||||
[
|
||||
'Symfony\Component\Yaml\Yaml::PARSE_KEYS_AS_STRINGS',
|
||||
'hey',
|
||||
55,
|
||||
5.5,
|
||||
|
||||
]), new ArgumentRemover(RemoveInTheMiddle::class, 'run', 1, [
|
||||
$services->set(ArgumentRemoverRector::class)
|
||||
->call('configure', [[
|
||||
ArgumentRemoverRector::REMOVED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
new ArgumentRemover(Persister::class, 'getSelectJoinColumnSQL', 4, null), new ArgumentRemover(
|
||||
Yaml::class,
|
||||
'parse',
|
||||
1,
|
||||
['Symfony\Component\Yaml\Yaml::PARSE_KEYS_AS_STRINGS', 'hey', 55, 5.5]
|
||||
),
|
||||
new ArgumentRemover(RemoveInTheMiddle::class, 'run', 1, [
|
||||
'name' => 'second',
|
||||
]), ]
|
||||
),
|
||||
]]);
|
||||
]),
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,7 +6,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RemoveInterfacesRector::class)->call('configure', [[
|
||||
RemoveInterfacesRector::INTERFACES_TO_REMOVE => [SomeInterface::class],
|
||||
]]);
|
||||
$services->set(RemoveInterfacesRector::class)
|
||||
->call('configure', [[
|
||||
RemoveInterfacesRector::INTERFACES_TO_REMOVE => [SomeInterface::class],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,7 +6,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RemoveParentRector::class)->call('configure', [[
|
||||
RemoveParentRector::PARENT_TYPES_TO_REMOVE => [ParentTypeToBeRemoved::class],
|
||||
]]);
|
||||
$services->set(RemoveParentRector::class)
|
||||
->call('configure', [[
|
||||
RemoveParentRector::PARENT_TYPES_TO_REMOVE => [ParentTypeToBeRemoved::class],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,7 +6,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RemoveTraitRector::class)->call('configure', [[
|
||||
RemoveTraitRector::TRAITS_TO_REMOVE => [TraitToBeRemoved::class],
|
||||
]]);
|
||||
$services->set(RemoveTraitRector::class)
|
||||
->call('configure', [[
|
||||
RemoveTraitRector::TRAITS_TO_REMOVE => [TraitToBeRemoved::class],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,11 +7,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RemoveFuncCallArgRector::class)->call('configure', [[
|
||||
RemoveFuncCallArgRector::REMOVED_FUNCTION_ARGUMENTS => ValueObjectInliner::inline([
|
||||
$services->set(RemoveFuncCallArgRector::class)
|
||||
->call('configure', [[
|
||||
RemoveFuncCallArgRector::REMOVED_FUNCTION_ARGUMENTS => ValueObjectInliner::inline([
|
||||
|
||||
new RemoveFuncCallArg('ldap_first_attribute', 2),
|
||||
new RemoveFuncCallArg('ldap_first_attribute', 2),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,14 +7,15 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RemoveFuncCallRector::class)->call('configure', [[
|
||||
RemoveFuncCallRector::REMOVE_FUNC_CALLS => ValueObjectInliner::inline([
|
||||
|
||||
new RemoveFuncCall('ini_get', [
|
||||
0 => ['y2k_compliance', 'safe_mode', 'magic_quotes_runtime'],
|
||||
]), new RemoveFuncCall('ini_set', [
|
||||
0 => ['y2k_compliance', 'safe_mode', 'magic_quotes_runtime'],
|
||||
]), ]
|
||||
),
|
||||
]]);
|
||||
$services->set(RemoveFuncCallRector::class)
|
||||
->call('configure', [[
|
||||
RemoveFuncCallRector::REMOVE_FUNC_CALLS => ValueObjectInliner::inline([
|
||||
new RemoveFuncCall('ini_get', [
|
||||
0 => ['y2k_compliance', 'safe_mode', 'magic_quotes_runtime'],
|
||||
]),
|
||||
new RemoveFuncCall('ini_set', [
|
||||
0 => ['y2k_compliance', 'safe_mode', 'magic_quotes_runtime'],
|
||||
]),
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -10,19 +10,20 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RenameClassConstFetchRector::class)->call('configure', [[
|
||||
RenameClassConstFetchRector::CLASS_CONSTANT_RENAME => ValueObjectInliner::inline([
|
||||
$services->set(RenameClassConstFetchRector::class)
|
||||
->call('configure', [[
|
||||
RenameClassConstFetchRector::CLASS_CONSTANT_RENAME => ValueObjectInliner::inline([
|
||||
|
||||
new RenameClassConstFetch(LocalFormEvents::class, 'PRE_BIND', 'PRE_SUBMIT'),
|
||||
new RenameClassConstFetch(LocalFormEvents::class, 'BIND', 'SUBMIT'),
|
||||
new RenameClassConstFetch(LocalFormEvents::class, 'POST_BIND', 'POST_SUBMIT'),
|
||||
new RenameClassAndConstFetch(
|
||||
LocalFormEvents::class,
|
||||
'OLD_CONSTANT',
|
||||
DifferentClass::class,
|
||||
'NEW_CONSTANT'
|
||||
),
|
||||
new RenameClassConstFetch(LocalFormEvents::class, 'PRE_BIND', 'PRE_SUBMIT'),
|
||||
new RenameClassConstFetch(LocalFormEvents::class, 'BIND', 'SUBMIT'),
|
||||
new RenameClassConstFetch(LocalFormEvents::class, 'POST_BIND', 'POST_SUBMIT'),
|
||||
new RenameClassAndConstFetch(
|
||||
LocalFormEvents::class,
|
||||
'OLD_CONSTANT',
|
||||
DifferentClass::class,
|
||||
'NEW_CONSTANT'
|
||||
),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,11 +7,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RenameAnnotationRector::class)->call('configure', [[
|
||||
RenameAnnotationRector::RENAMED_ANNOTATIONS_IN_TYPES => ValueObjectInliner::inline([
|
||||
$services->set(RenameAnnotationRector::class)
|
||||
->call('configure', [[
|
||||
RenameAnnotationRector::RENAMED_ANNOTATIONS_IN_TYPES => ValueObjectInliner::inline([
|
||||
|
||||
new RenameAnnotation('PHPUnit\Framework\TestCase', 'scenario', 'test'),
|
||||
new RenameAnnotation('PHPUnit\Framework\TestCase', 'scenario', 'test'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,10 +5,11 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RenameConstantRector::class)->call('configure', [[
|
||||
RenameConstantRector::OLD_TO_NEW_CONSTANTS => [
|
||||
'MYSQL_ASSOC' => 'MYSQLI_ASSOC',
|
||||
'OLD_CONSTANT' => 'NEW_CONSTANT',
|
||||
],
|
||||
]]);
|
||||
$services->set(RenameConstantRector::class)
|
||||
->call('configure', [[
|
||||
RenameConstantRector::OLD_TO_NEW_CONSTANTS => [
|
||||
'MYSQL_ASSOC' => 'MYSQLI_ASSOC',
|
||||
'OLD_CONSTANT' => 'NEW_CONSTANT',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,18 +7,14 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(PseudoNamespaceToNamespaceRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(PseudoNamespaceToNamespaceRector::class)
|
||||
->call('configure', [[
|
||||
PseudoNamespaceToNamespaceRector::NAMESPACE_PREFIXES_WITH_EXCLUDED_CLASSES => ValueObjectInliner::inline([
|
||||
|
||||
new PseudoNamespaceToNamespace('PHPUnit_', ['PHPUnit_Framework_MockObject_MockObject']),
|
||||
new PseudoNamespaceToNamespace('ChangeMe_', ['KeepMe_']),
|
||||
new PseudoNamespaceToNamespace(
|
||||
'Rector_Renaming_Tests_Rector_FileWithoutNamespace_PseudoNamespaceToNamespaceRector_Fixture_'
|
||||
),
|
||||
|
||||
]),
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -10,23 +10,24 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RenameMethodRector::class)->call('configure', [[
|
||||
RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([
|
||||
new MethodCallRename(AbstractType::class, 'setDefaultOptions', 'configureOptions'),
|
||||
new MethodCallRename(Html::class, 'add', 'addHtml'),
|
||||
new MethodCallRename(
|
||||
'Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Fixture\DemoFile',
|
||||
'notify',
|
||||
'__invoke'
|
||||
),
|
||||
new MethodCallRename('*Presenter', 'run', '__invoke'),
|
||||
new MethodCallRename(
|
||||
\Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Fixture\SkipSelfMethodRename::class,
|
||||
'preventPHPStormRefactoring',
|
||||
'gone'
|
||||
),
|
||||
// with array key
|
||||
new MethodCallRenameWithArrayKey(Html::class, 'addToArray', 'addToHtmlArray', 'hey'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(RenameMethodRector::class)
|
||||
->call('configure', [[
|
||||
RenameMethodRector::METHOD_CALL_RENAMES => ValueObjectInliner::inline([
|
||||
new MethodCallRename(AbstractType::class, 'setDefaultOptions', 'configureOptions'),
|
||||
new MethodCallRename(Html::class, 'add', 'addHtml'),
|
||||
new MethodCallRename(
|
||||
'Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Fixture\DemoFile',
|
||||
'notify',
|
||||
'__invoke'
|
||||
),
|
||||
new MethodCallRename('*Presenter', 'run', '__invoke'),
|
||||
new MethodCallRename(
|
||||
\Rector\Renaming\Tests\Rector\MethodCall\RenameMethodRector\Fixture\SkipSelfMethodRename::class,
|
||||
'preventPHPStormRefactoring',
|
||||
'gone'
|
||||
),
|
||||
// with array key
|
||||
new MethodCallRenameWithArrayKey(Html::class, 'addToArray', 'addToHtmlArray', 'hey'),
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,12 +5,13 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RenameNamespaceRector::class)->call('configure', [[
|
||||
RenameNamespaceRector::OLD_TO_NEW_NAMESPACES => [
|
||||
'OldNamespace' => 'NewNamespace',
|
||||
'OldNamespaceWith\OldSplitNamespace' => 'NewNamespaceWith\NewSplitNamespace',
|
||||
'Old\Long\AnyNamespace' => 'Short\AnyNamespace',
|
||||
'PHPUnit_Framework_' => 'PHPUnit\Framework\\',
|
||||
],
|
||||
]]);
|
||||
$services->set(RenameNamespaceRector::class)
|
||||
->call('configure', [[
|
||||
RenameNamespaceRector::OLD_TO_NEW_NAMESPACES => [
|
||||
'OldNamespace' => 'NewNamespace',
|
||||
'OldNamespaceWith\OldSplitNamespace' => 'NewNamespaceWith\NewSplitNamespace',
|
||||
'Old\Long\AnyNamespace' => 'Short\AnyNamespace',
|
||||
'PHPUnit_Framework_' => 'PHPUnit\Framework\\',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,12 +8,13 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RenamePropertyRector::class)->call('configure', [[
|
||||
RenamePropertyRector::RENAMED_PROPERTIES => ValueObjectInliner::inline([
|
||||
$services->set(RenamePropertyRector::class)
|
||||
->call('configure', [[
|
||||
RenamePropertyRector::RENAMED_PROPERTIES => ValueObjectInliner::inline([
|
||||
|
||||
new RenameProperty(ClassWithProperties::class, 'oldProperty', 'newProperty'),
|
||||
new RenameProperty(ClassWithProperties::class, 'anotherOldProperty', 'anotherNewProperty'),
|
||||
new RenameProperty(ClassWithProperties::class, 'oldProperty', 'newProperty'),
|
||||
new RenameProperty(ClassWithProperties::class, 'anotherOldProperty', 'anotherNewProperty'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -9,17 +9,18 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RenameStaticMethodRector::class)->call('configure', [[
|
||||
RenameStaticMethodRector::OLD_TO_NEW_METHODS_BY_CLASSES => ValueObjectInliner::inline([
|
||||
$services->set(RenameStaticMethodRector::class)
|
||||
->call('configure', [[
|
||||
RenameStaticMethodRector::OLD_TO_NEW_METHODS_BY_CLASSES => ValueObjectInliner::inline([
|
||||
|
||||
new RenameStaticMethod(Html::class, 'add', Html::class, 'addHtml'),
|
||||
new RenameStaticMethod(
|
||||
FormMacros::class,
|
||||
'renderFormBegin',
|
||||
'Nette\Bridges\FormsLatte\Runtime',
|
||||
'renderFormBegin'
|
||||
),
|
||||
new RenameStaticMethod(Html::class, 'add', Html::class, 'addHtml'),
|
||||
new RenameStaticMethod(
|
||||
FormMacros::class,
|
||||
'renderFormBegin',
|
||||
'Nette\Bridges\FormsLatte\Runtime',
|
||||
'renderFormBegin'
|
||||
),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,9 +5,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(RenameStringRector::class)->call('configure', [[
|
||||
RenameStringRector::STRING_CHANGES => [
|
||||
'ROLE_PREVIOUS_ADMIN' => 'IS_IMPERSONATOR',
|
||||
],
|
||||
]]);
|
||||
$services->set(RenameStringRector::class)
|
||||
->call('configure', [[
|
||||
RenameStringRector::STRING_CHANGES => [
|
||||
'ROLE_PREVIOUS_ADMIN' => 'IS_IMPERSONATOR',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,9 +6,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(CompleteMissingDependencyInNewRector::class)->call('configure', [[
|
||||
CompleteMissingDependencyInNewRector::CLASS_TO_INSTANTIATE_BY_TYPE => [
|
||||
RandomDependency::class => RandomDependency::class,
|
||||
],
|
||||
]]);
|
||||
$services->set(CompleteMissingDependencyInNewRector::class)
|
||||
->call('configure', [[
|
||||
CompleteMissingDependencyInNewRector::CLASS_TO_INSTANTIATE_BY_TYPE => [
|
||||
RandomDependency::class => RandomDependency::class,
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -11,7 +11,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$parameters->set(Option::SYMFONY_CONTAINER_XML_PATH_PARAMETER, __DIR__ . '/../xml/services.xml');
|
||||
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(GetToConstructorInjectionRector::class)->call('configure', [[
|
||||
GetToConstructorInjectionRector::GET_METHOD_AWARE_TYPES => [SymfonyController::class, GetTrait::class],
|
||||
]]);
|
||||
$services->set(GetToConstructorInjectionRector::class)
|
||||
->call('configure', [[
|
||||
GetToConstructorInjectionRector::GET_METHOD_AWARE_TYPES => [SymfonyController::class, GetTrait::class],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,15 +7,16 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(GetAndSetToMethodCallRector::class)->call('configure', [[
|
||||
GetAndSetToMethodCallRector::TYPE_TO_METHOD_CALLS => [
|
||||
SomeContainer::class => [
|
||||
'get' => 'getService',
|
||||
'set' => 'addService',
|
||||
$services->set(GetAndSetToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
GetAndSetToMethodCallRector::TYPE_TO_METHOD_CALLS => [
|
||||
SomeContainer::class => [
|
||||
'get' => 'getService',
|
||||
'set' => 'addService',
|
||||
],
|
||||
Klarka::class => [
|
||||
'get' => 'get',
|
||||
],
|
||||
],
|
||||
Klarka::class => [
|
||||
'get' => 'get',
|
||||
],
|
||||
],
|
||||
]]);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,17 +8,18 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(PropertyFetchToMethodCallRector::class)->call('configure', [[
|
||||
PropertyFetchToMethodCallRector::PROPERTIES_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
$services->set(PropertyFetchToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
PropertyFetchToMethodCallRector::PROPERTIES_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
|
||||
new PropertyFetchToMethodCall(Translator::class, 'locale', 'getLocale', 'setLocale'),
|
||||
new PropertyFetchToMethodCall(
|
||||
'Rector\Transform\Tests\Rector\Assign\PropertyFetchToMethodCallRector\Fixture\Fixture2',
|
||||
'parameter',
|
||||
'getConfig',
|
||||
null,
|
||||
['parameter']),
|
||||
]
|
||||
),
|
||||
]]);
|
||||
new PropertyFetchToMethodCall(Translator::class, 'locale', 'getLocale', 'setLocale'),
|
||||
new PropertyFetchToMethodCall(
|
||||
'Rector\Transform\Tests\Rector\Assign\PropertyFetchToMethodCallRector\Fixture\Fixture2',
|
||||
'parameter',
|
||||
'getConfig',
|
||||
null,
|
||||
['parameter']),
|
||||
]
|
||||
),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,9 +5,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(FuncCallToNewRector::class)->call('configure', [[
|
||||
FuncCallToNewRector::FUNCTIONS_TO_NEWS => [
|
||||
'collection' => ['Collection'],
|
||||
],
|
||||
]]);
|
||||
$services->set(FuncCallToNewRector::class)
|
||||
->call('configure', [[
|
||||
FuncCallToNewRector::FUNCTIONS_TO_NEWS => [
|
||||
'collection' => ['Collection'],
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,11 +8,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(UnsetAndIssetToMethodCallRector::class)->call('configure', [[
|
||||
UnsetAndIssetToMethodCallRector::ISSET_UNSET_TO_METHOD_CALL => ValueObjectInliner::inline([
|
||||
$services->set(UnsetAndIssetToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
UnsetAndIssetToMethodCallRector::ISSET_UNSET_TO_METHOD_CALL => ValueObjectInliner::inline([
|
||||
|
||||
new UnsetAndIssetToMethodCall(LocalContainer::class, 'hasService', 'removeService'),
|
||||
new UnsetAndIssetToMethodCall(LocalContainer::class, 'hasService', 'removeService'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,14 +8,10 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(CallableInMethodCallToVariableRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(CallableInMethodCallToVariableRector::class)
|
||||
->call('configure', [[
|
||||
CallableInMethodCallToVariableRector::CALLABLE_IN_METHOD_CALL_TO_VARIABLE => ValueObjectInliner::inline([
|
||||
|
||||
new CallableInMethodCallToVariable(DummyCache::class, 'save', 1),
|
||||
|
||||
]),
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -5,9 +5,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(MethodCallToPropertyFetchRector::class)->call('configure', [[
|
||||
MethodCallToPropertyFetchRector::METHOD_CALL_TO_PROPERTY_FETCHES => [
|
||||
'getEntityManager' => 'entityManager',
|
||||
],
|
||||
]]);
|
||||
$services->set(MethodCallToPropertyFetchRector::class)
|
||||
->call('configure', [[
|
||||
MethodCallToPropertyFetchRector::METHOD_CALL_TO_PROPERTY_FETCHES => [
|
||||
'getEntityManager' => 'entityManager',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,11 +8,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(MethodCallToStaticCallRector::class)->call('configure', [[
|
||||
MethodCallToStaticCallRector::METHOD_CALLS_TO_STATIC_CALLS => ValueObjectInliner::inline([
|
||||
$services->set(MethodCallToStaticCallRector::class)
|
||||
->call('configure', [[
|
||||
MethodCallToStaticCallRector::METHOD_CALLS_TO_STATIC_CALLS => ValueObjectInliner::inline([
|
||||
|
||||
new MethodCallToStaticCall(AnotherDependency::class, 'process', 'StaticCaller', 'anotherMethod'),
|
||||
new MethodCallToStaticCall(AnotherDependency::class, 'process', 'StaticCaller', 'anotherMethod'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,18 +8,14 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ReplaceParentCallByPropertyCallRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(ReplaceParentCallByPropertyCallRector::class)
|
||||
->call('configure', [[
|
||||
ReplaceParentCallByPropertyCallRector::PARENT_CALLS_TO_PROPERTIES => ValueObjectInliner::inline([
|
||||
|
||||
new ReplaceParentCallByPropertyCall(
|
||||
TypeClassToReplaceMethodCallBy::class,
|
||||
'someMethod',
|
||||
'someProperty'
|
||||
),
|
||||
|
||||
]),
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,9 +8,10 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(NewArgToMethodCallRector::class)->call('configure', [[
|
||||
NewArgToMethodCallRector::NEW_ARGS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new NewArgToMethodCall(SomeDotenv::class, true, 'usePutenv'),
|
||||
]),
|
||||
]]);
|
||||
$services->set(NewArgToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
NewArgToMethodCallRector::NEW_ARGS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
new NewArgToMethodCall(SomeDotenv::class, true, 'usePutenv'),
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,7 +6,8 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(NewToConstructorInjectionRector::class)->call('configure', [[
|
||||
NewToConstructorInjectionRector::TYPES_TO_CONSTRUCTOR_INJECTION => [DummyValidator::class],
|
||||
]]);
|
||||
$services->set(NewToConstructorInjectionRector::class)
|
||||
->call('configure', [[
|
||||
NewToConstructorInjectionRector::TYPES_TO_CONSTRUCTOR_INJECTION => [DummyValidator::class],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -9,11 +9,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(NewToMethodCallRector::class)->call('configure', [[
|
||||
NewToMethodCallRector::NEWS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
$services->set(NewToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
NewToMethodCallRector::NEWS_TO_METHOD_CALLS => ValueObjectInliner::inline([
|
||||
|
||||
new NewToMethodCall(MyClass::class, MyClassFactory::class, 'create'),
|
||||
new NewToMethodCall(MyClass::class, MyClassFactory::class, 'create'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -9,11 +9,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(NewToStaticCallRector::class)->call('configure', [[
|
||||
NewToStaticCallRector::TYPE_TO_STATIC_CALLS => ValueObjectInliner::inline([
|
||||
$services->set(NewToStaticCallRector::class)
|
||||
->call('configure', [[
|
||||
NewToStaticCallRector::TYPE_TO_STATIC_CALLS => ValueObjectInliner::inline([
|
||||
|
||||
new NewToStaticCall(FromNewClass::class, IntoStaticClass::class, 'run'),
|
||||
new NewToStaticCall(FromNewClass::class, IntoStaticClass::class, 'run'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -8,11 +8,12 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(StaticCallToFuncCallRector::class)->call('configure', [[
|
||||
StaticCallToFuncCallRector::STATIC_CALLS_TO_FUNCTIONS => ValueObjectInliner::inline([
|
||||
$services->set(StaticCallToFuncCallRector::class)
|
||||
->call('configure', [[
|
||||
StaticCallToFuncCallRector::STATIC_CALLS_TO_FUNCTIONS => ValueObjectInliner::inline([
|
||||
|
||||
new StaticCallToFuncCall(SomeOldStaticClass::class, 'render', 'view'),
|
||||
new StaticCallToFuncCall(SomeOldStaticClass::class, 'render', 'view'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,12 +7,13 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(StringToClassConstantRector::class)->call('configure', [[
|
||||
StringToClassConstantRector::STRINGS_TO_CLASS_CONSTANTS => ValueObjectInliner::inline([
|
||||
$services->set(StringToClassConstantRector::class)
|
||||
->call('configure', [[
|
||||
StringToClassConstantRector::STRINGS_TO_CLASS_CONSTANTS => ValueObjectInliner::inline([
|
||||
|
||||
new StringToClassConstant('compiler.post_dump', 'Yet\AnotherClass', 'CONSTANT'),
|
||||
new StringToClassConstant('compiler.to_class', 'Yet\AnotherClass', 'class'),
|
||||
new StringToClassConstant('compiler.post_dump', 'Yet\AnotherClass', 'CONSTANT'),
|
||||
new StringToClassConstant('compiler.to_class', 'Yet\AnotherClass', 'class'),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -6,9 +6,10 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ToStringToMethodCallRector::class)->call('configure', [[
|
||||
ToStringToMethodCallRector::METHOD_NAMES_BY_TYPE => [
|
||||
ConfigCache::class => 'getPath',
|
||||
],
|
||||
]]);
|
||||
$services->set(ToStringToMethodCallRector::class)
|
||||
->call('configure', [[
|
||||
ToStringToMethodCallRector::METHOD_NAMES_BY_TYPE => [
|
||||
ConfigCache::class => 'getPath',
|
||||
],
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -12,11 +12,9 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(AddParamTypeDeclarationRector::class)->call(
|
||||
'configure',
|
||||
[[
|
||||
$services->set(AddParamTypeDeclarationRector::class)
|
||||
->call('configure', [[
|
||||
AddParamTypeDeclarationRector::PARAMETER_TYPEHINTS => ValueObjectInliner::inline([
|
||||
|
||||
new AddParamTypeDeclaration(
|
||||
ParentInterfaceWithChangeTypeInterface::class,
|
||||
'process',
|
||||
|
@ -30,8 +28,6 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
0,
|
||||
new ObjectType('Doctrine\ORM\EntityManagerInterface')
|
||||
),
|
||||
|
||||
]),
|
||||
]]
|
||||
);
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -9,14 +9,15 @@ use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ChangeMethodVisibilityRector::class)->call('configure', [[
|
||||
ChangeMethodVisibilityRector::METHOD_VISIBILITIES => ValueObjectInliner::inline([
|
||||
$services->set(ChangeMethodVisibilityRector::class)
|
||||
->call('configure', [[
|
||||
ChangeMethodVisibilityRector::METHOD_VISIBILITIES => ValueObjectInliner::inline([
|
||||
|
||||
new ChangeMethodVisibility(ParentObject::class, 'toBePublicMethod', Visibility::PUBLIC),
|
||||
new ChangeMethodVisibility(ParentObject::class, 'toBeProtectedMethod', Visibility::PROTECTED),
|
||||
new ChangeMethodVisibility(ParentObject::class, 'toBePrivateMethod', Visibility::PRIVATE),
|
||||
new ChangeMethodVisibility(ParentObject::class, 'toBePublicStaticMethod', Visibility::PUBLIC),
|
||||
new ChangeMethodVisibility(ParentObject::class, 'toBePublicMethod', Visibility::PUBLIC),
|
||||
new ChangeMethodVisibility(ParentObject::class, 'toBeProtectedMethod', Visibility::PROTECTED),
|
||||
new ChangeMethodVisibility(ParentObject::class, 'toBePrivateMethod', Visibility::PRIVATE),
|
||||
new ChangeMethodVisibility(ParentObject::class, 'toBePublicStaticMethod', Visibility::PUBLIC),
|
||||
|
||||
]),
|
||||
]]);
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
|
|
|
@ -7,17 +7,18 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
|
|||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(ChangePropertyVisibilityRector::class)->call('configure', [[
|
||||
ChangePropertyVisibilityRector::PROPERTY_TO_VISIBILITY_BY_CLASS => [
|
||||
ParentObject::class => [
|
||||
'toBePublicProperty' => Visibility::PUBLIC,
|
||||
'toBeProtectedProperty' => Visibility::PROTECTED,
|
||||
'toBePrivateProperty' => Visibility::PRIVATE,
|
||||
'toBePublicStaticProperty' => Visibility::PUBLIC,
|
||||
$services->set(ChangePropertyVisibilityRector::class)
|
||||
->call('configure', [[
|
||||
ChangePropertyVisibilityRector::PROPERTY_TO_VISIBILITY_BY_CLASS => [
|
||||
ParentObject::class => [
|
||||
'toBePublicProperty' => Visibility::PUBLIC,
|
||||
'toBeProtectedProperty' => Visibility::PROTECTED,
|
||||
'toBePrivateProperty' => Visibility::PRIVATE,
|
||||
'toBePublicStaticProperty' => Visibility::PUBLIC,
|
||||
],
|
||||
'Rector\Visibility\Tests\Rector\Property\ChangePropertyVisibilityRector\Fixture\Fixture3' => [
|
||||
'toBePublicStaticProperty' => Visibility::PUBLIC,
|
||||
],
|
||||
],
|
||||
'Rector\Visibility\Tests\Rector\Property\ChangePropertyVisibilityRector\Fixture\Fixture3' => [
|
||||
'toBePublicStaticProperty' => Visibility::PUBLIC,
|
||||
],
|
||||
],
|
||||
]]);
|
||||
]]);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user