diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 04e7686eeba..2554a9b3c89 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2237,8 +2237,12 @@ return array( 'Rector\\Symfony\\DataProvider\\ServiceMapProvider' => $vendorDir . '/rector/rector-symfony/src/DataProvider/ServiceMapProvider.php', 'Rector\\Symfony\\DataProvider\\ServiceNameToTypeUniqueProvider' => $vendorDir . '/rector/rector-symfony/src/DataProvider/ServiceNameToTypeUniqueProvider.php', 'Rector\\Symfony\\DependencyInjection\\NodeDecorator\\CommandConstructorDecorator' => $vendorDir . '/rector/rector-symfony/rules/DependencyInjection/NodeDecorator/CommandConstructorDecorator.php', + 'Rector\\Symfony\\DependencyInjection\\NodeFactory\\AutowireClassMethodFactory' => $vendorDir . '/rector/rector-symfony/rules/DependencyInjection/NodeFactory/AutowireClassMethodFactory.php', 'Rector\\Symfony\\DependencyInjection\\Rector\\Class_\\CommandGetByTypeToConstructorInjectionRector' => $vendorDir . '/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/CommandGetByTypeToConstructorInjectionRector.php', 'Rector\\Symfony\\DependencyInjection\\Rector\\Class_\\ControllerGetByTypeToConstructorInjectionRector' => $vendorDir . '/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/ControllerGetByTypeToConstructorInjectionRector.php', + 'Rector\\Symfony\\DependencyInjection\\Rector\\Class_\\GetBySymfonyStringToConstructorInjectionRector' => $vendorDir . '/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/GetBySymfonyStringToConstructorInjectionRector.php', + 'Rector\\Symfony\\DependencyInjection\\Rector\\Trait_\\TraitGetByTypeToInjectRector' => $vendorDir . '/rector/rector-symfony/rules/DependencyInjection/Rector/Trait_/TraitGetByTypeToInjectRector.php', + 'Rector\\Symfony\\DependencyInjection\\ThisGetTypeMatcher' => $vendorDir . '/rector/rector-symfony/rules/DependencyInjection/ThisGetTypeMatcher.php', 'Rector\\Symfony\\DowngradeSymfony70\\Rector\\Class_\\DowngradeSymfonyCommandAttributeRector' => $vendorDir . '/rector/rector-symfony/rules/DowngradeSymfony70/Rector/Class_/DowngradeSymfonyCommandAttributeRector.php', 'Rector\\Symfony\\Enum\\SensioAttribute' => $vendorDir . '/rector/rector-symfony/src/Enum/SensioAttribute.php', 'Rector\\Symfony\\Enum\\SymfonyAnnotation' => $vendorDir . '/rector/rector-symfony/src/Enum/SymfonyAnnotation.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a45bbd408cf..c96e13877c8 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -2456,8 +2456,12 @@ class ComposerStaticInitc12d7e0a7ec6f5f877903ca571cd9ab7 'Rector\\Symfony\\DataProvider\\ServiceMapProvider' => __DIR__ . '/..' . '/rector/rector-symfony/src/DataProvider/ServiceMapProvider.php', 'Rector\\Symfony\\DataProvider\\ServiceNameToTypeUniqueProvider' => __DIR__ . '/..' . '/rector/rector-symfony/src/DataProvider/ServiceNameToTypeUniqueProvider.php', 'Rector\\Symfony\\DependencyInjection\\NodeDecorator\\CommandConstructorDecorator' => __DIR__ . '/..' . '/rector/rector-symfony/rules/DependencyInjection/NodeDecorator/CommandConstructorDecorator.php', + 'Rector\\Symfony\\DependencyInjection\\NodeFactory\\AutowireClassMethodFactory' => __DIR__ . '/..' . '/rector/rector-symfony/rules/DependencyInjection/NodeFactory/AutowireClassMethodFactory.php', 'Rector\\Symfony\\DependencyInjection\\Rector\\Class_\\CommandGetByTypeToConstructorInjectionRector' => __DIR__ . '/..' . '/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/CommandGetByTypeToConstructorInjectionRector.php', 'Rector\\Symfony\\DependencyInjection\\Rector\\Class_\\ControllerGetByTypeToConstructorInjectionRector' => __DIR__ . '/..' . '/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/ControllerGetByTypeToConstructorInjectionRector.php', + 'Rector\\Symfony\\DependencyInjection\\Rector\\Class_\\GetBySymfonyStringToConstructorInjectionRector' => __DIR__ . '/..' . '/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/GetBySymfonyStringToConstructorInjectionRector.php', + 'Rector\\Symfony\\DependencyInjection\\Rector\\Trait_\\TraitGetByTypeToInjectRector' => __DIR__ . '/..' . '/rector/rector-symfony/rules/DependencyInjection/Rector/Trait_/TraitGetByTypeToInjectRector.php', + 'Rector\\Symfony\\DependencyInjection\\ThisGetTypeMatcher' => __DIR__ . '/..' . '/rector/rector-symfony/rules/DependencyInjection/ThisGetTypeMatcher.php', 'Rector\\Symfony\\DowngradeSymfony70\\Rector\\Class_\\DowngradeSymfonyCommandAttributeRector' => __DIR__ . '/..' . '/rector/rector-symfony/rules/DowngradeSymfony70/Rector/Class_/DowngradeSymfonyCommandAttributeRector.php', 'Rector\\Symfony\\Enum\\SensioAttribute' => __DIR__ . '/..' . '/rector/rector-symfony/src/Enum/SensioAttribute.php', 'Rector\\Symfony\\Enum\\SymfonyAnnotation' => __DIR__ . '/..' . '/rector/rector-symfony/src/Enum/SymfonyAnnotation.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index feff15909d8..adc8e046f92 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1868,12 +1868,12 @@ "source": { "type": "git", "url": "https:\/\/github.com\/rectorphp\/rector-symfony.git", - "reference": "617b3aff39d3ae14e5ea24ad5150fb4d0fc4a05e" + "reference": "1138f045e2a27f9b069a3e512a04e6d49e04a596" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/617b3aff39d3ae14e5ea24ad5150fb4d0fc4a05e", - "reference": "617b3aff39d3ae14e5ea24ad5150fb4d0fc4a05e", + "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/1138f045e2a27f9b069a3e512a04e6d49e04a596", + "reference": "1138f045e2a27f9b069a3e512a04e6d49e04a596", "shasum": "" }, "require": { @@ -1898,7 +1898,7 @@ "tomasvotruba\/class-leak": "^1.0", "tracy\/tracy": "^2.10" }, - "time": "2024-12-01T14:07:35+00:00", + "time": "2024-12-01T16:51:24+00:00", "default-branch": true, "type": "rector-extension", "extra": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 95c5f0864d8..7bd2bce7730 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202412; -return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.3.2', 'version' => '3.3.2.0', 'reference' => 'b2bed4734f0cc156ee1fe9c0da2550420d99a21e', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.3', 'version' => '3.4.3.0', 'reference' => '4313d26ada5e0c4edfbd1dc481a92ff7bff91f12', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.5', 'version' => '3.0.5.0', 'reference' => '6c1925561632e83d60a44492e0b344cf48ab85ef', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.10', 'version' => '2.0.10.0', 'reference' => '5817d0659c5b50c9b950feb9af7b9668e2c436bc', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'fidry/cpu-core-counter' => array('pretty_version' => '1.2.0', 'version' => '1.2.0.0', 'reference' => '8520451a140d3f46ac33042715115e290cf5785f', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v11.34.2', 'version' => '11.34.2.0', 'reference' => 'b057b0bbb38d7c7524df1ca5c38e7318f4c64d26', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v11.34.2', 'version' => '11.34.2.0', 'reference' => '184317f701ba20ca265e36808ed54b75b115972d', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v4.0.5', 'version' => '4.0.5.0', 'reference' => '736c567e257dbe0fcf6ce81b4d6dbe05c6899f96', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v5.3.1', 'version' => '5.3.1.0', 'reference' => '8eea230464783aa9671db8eea6f8c6ac5285794b', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.2.0', 'version' => '4.2.0.0', 'reference' => '8b0223b5ed235fd377c75fdd1bfcad05c0f168b8', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '2.0.0', 'version' => '2.0.0.0', 'reference' => 'c00d78fb6b29658347f9d37ebe104bffadf36299', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('dev_requirement' => \false, 'replaced' => array(0 => '2.0.3')), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/log' => array('pretty_version' => '3.0.2', 'version' => '3.0.2.0', 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'psr/simple-cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/cache' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.13.0', 'version' => '1.13.0.0', 'reference' => 'eb8ae001b5a455665c89c1df97f6fb682f8fb0f5', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.5.0', 'version' => '1.5.0.0', 'reference' => 'bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v3.2.0', 'version' => '3.2.0.0', 'reference' => '8a164643313c71354582dc850b42b33fa12a4b63', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.16.0', 'version' => '1.16.0.0', 'reference' => '23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.4.0', 'version' => '1.4.0.0', 'reference' => '1e5b0acb8fe55143b5b426817155190eb6f5b18d', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '02ae401ff4e578a5dcdc0a68e5451628aaab2639', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '7bb52fbe9ada56afe39f7171de2a2ef847ed3571', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'a506b2c8befb25aca43fe29fbc863b3126266916', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '617b3aff39d3ae14e5ea24ad5150fb4d0fc4a05e', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.1.1', 'version' => '5.1.1.0', 'reference' => 'c41e007b4b62af48218231d6c2275e4c9b975b2e', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.4.15', 'version' => '6.4.15.0', 'reference' => 'f1fc6f47283e27336e7cebb9e8946c8de7bff9bd', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/filesystem' => array('pretty_version' => 'v6.4.13', 'version' => '6.4.13.0', 'reference' => '4856c9cf585d5a0313d8d35afd681a526f038dd3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.4.13', 'version' => '6.4.13.0', 'reference' => 'daea9eca0b08d0ed1dc9ab702a46128fd1be4958', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.31.0', 'version' => '1.31.0.0', 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.4.15', 'version' => '6.4.15.0', 'reference' => '3cb242f059c14ae08591c5c4087d1fe443564392', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => 'e53260aabf78fb3d63f8d79d69ece59f80d5eda0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/string' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/yaml' => array('pretty_version' => 'v7.2.0', 'version' => '7.2.0.0', 'reference' => '099581e99f557e9f16b43c5916c26380b54abb22', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/easy-parallel' => array('pretty_version' => '11.2.2', 'version' => '11.2.2.0', 'reference' => '8586c18bb8efb31cd192a4e5cc94ae7813f72ed9', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.2.0', 'version' => '11.2.0.0', 'reference' => '479cfcfd46047f80624aba931d9789e50475b5c6', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); +return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.3.2', 'version' => '3.3.2.0', 'reference' => 'b2bed4734f0cc156ee1fe9c0da2550420d99a21e', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.3', 'version' => '3.4.3.0', 'reference' => '4313d26ada5e0c4edfbd1dc481a92ff7bff91f12', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.5', 'version' => '3.0.5.0', 'reference' => '6c1925561632e83d60a44492e0b344cf48ab85ef', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.10', 'version' => '2.0.10.0', 'reference' => '5817d0659c5b50c9b950feb9af7b9668e2c436bc', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'fidry/cpu-core-counter' => array('pretty_version' => '1.2.0', 'version' => '1.2.0.0', 'reference' => '8520451a140d3f46ac33042715115e290cf5785f', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v11.34.2', 'version' => '11.34.2.0', 'reference' => 'b057b0bbb38d7c7524df1ca5c38e7318f4c64d26', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v11.34.2', 'version' => '11.34.2.0', 'reference' => '184317f701ba20ca265e36808ed54b75b115972d', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v4.0.5', 'version' => '4.0.5.0', 'reference' => '736c567e257dbe0fcf6ce81b4d6dbe05c6899f96', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v5.3.1', 'version' => '5.3.1.0', 'reference' => '8eea230464783aa9671db8eea6f8c6ac5285794b', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.2.0', 'version' => '4.2.0.0', 'reference' => '8b0223b5ed235fd377c75fdd1bfcad05c0f168b8', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '2.0.0', 'version' => '2.0.0.0', 'reference' => 'c00d78fb6b29658347f9d37ebe104bffadf36299', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('dev_requirement' => \false, 'replaced' => array(0 => '2.0.3')), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/log' => array('pretty_version' => '3.0.2', 'version' => '3.0.2.0', 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'psr/simple-cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/cache' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.13.0', 'version' => '1.13.0.0', 'reference' => 'eb8ae001b5a455665c89c1df97f6fb682f8fb0f5', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.5.0', 'version' => '1.5.0.0', 'reference' => 'bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v3.2.0', 'version' => '3.2.0.0', 'reference' => '8a164643313c71354582dc850b42b33fa12a4b63', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.16.0', 'version' => '1.16.0.0', 'reference' => '23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.4.0', 'version' => '1.4.0.0', 'reference' => '1e5b0acb8fe55143b5b426817155190eb6f5b18d', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '02ae401ff4e578a5dcdc0a68e5451628aaab2639', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '7bb52fbe9ada56afe39f7171de2a2ef847ed3571', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'a506b2c8befb25aca43fe29fbc863b3126266916', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '1138f045e2a27f9b069a3e512a04e6d49e04a596', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.1.1', 'version' => '5.1.1.0', 'reference' => 'c41e007b4b62af48218231d6c2275e4c9b975b2e', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.4.15', 'version' => '6.4.15.0', 'reference' => 'f1fc6f47283e27336e7cebb9e8946c8de7bff9bd', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/filesystem' => array('pretty_version' => 'v6.4.13', 'version' => '6.4.13.0', 'reference' => '4856c9cf585d5a0313d8d35afd681a526f038dd3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.4.13', 'version' => '6.4.13.0', 'reference' => 'daea9eca0b08d0ed1dc9ab702a46128fd1be4958', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.31.0', 'version' => '1.31.0.0', 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.4.15', 'version' => '6.4.15.0', 'reference' => '3cb242f059c14ae08591c5c4087d1fe443564392', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.5.1', 'version' => '3.5.1.0', 'reference' => 'e53260aabf78fb3d63f8d79d69ece59f80d5eda0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/string' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/yaml' => array('pretty_version' => 'v7.2.0', 'version' => '7.2.0.0', 'reference' => '099581e99f557e9f16b43c5916c26380b54abb22', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/easy-parallel' => array('pretty_version' => '11.2.2', 'version' => '11.2.2.0', 'reference' => '8586c18bb8efb31cd192a4e5cc94ae7813f72ed9', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.2.0', 'version' => '11.2.0.0', 'reference' => '479cfcfd46047f80624aba931d9789e50475b5c6', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); diff --git a/vendor/rector/extension-installer/src/GeneratedConfig.php b/vendor/rector/extension-installer/src/GeneratedConfig.php index 98a490a671d..273fa931ba5 100644 --- a/vendor/rector/extension-installer/src/GeneratedConfig.php +++ b/vendor/rector/extension-installer/src/GeneratedConfig.php @@ -9,7 +9,7 @@ namespace Rector\RectorInstaller; */ final class GeneratedConfig { - public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 02ae401'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 7bb52fb'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main a506b2c'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 617b3af')); + public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 02ae401'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 7bb52fb'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main a506b2c'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 1138f04')); private function __construct() { } diff --git a/vendor/rector/rector-symfony/config/sets/symfony/symfony-constructor-injection.php b/vendor/rector/rector-symfony/config/sets/symfony/symfony-constructor-injection.php index d06004fe58e..acf4de5e49a 100644 --- a/vendor/rector/rector-symfony/config/sets/symfony/symfony-constructor-injection.php +++ b/vendor/rector/rector-symfony/config/sets/symfony/symfony-constructor-injection.php @@ -4,16 +4,20 @@ declare (strict_types=1); namespace RectorPrefix202412; use Rector\Config\RectorConfig; +use Rector\Symfony\DependencyInjection\Rector\Class_\CommandGetByTypeToConstructorInjectionRector; +use Rector\Symfony\DependencyInjection\Rector\Class_\ControllerGetByTypeToConstructorInjectionRector; +use Rector\Symfony\DependencyInjection\Rector\Class_\GetBySymfonyStringToConstructorInjectionRector; +use Rector\Symfony\DependencyInjection\Rector\Trait_\TraitGetByTypeToInjectRector; use Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector; use Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector; -use Rector\Symfony\Symfony42\Rector\MethodCall\ContainerGetToConstructorInjectionRector; return static function (RectorConfig $rectorConfig) : void { $rectorConfig->rules([ // modern step-by-step narrow approach - \Rector\Symfony\DependencyInjection\Rector\Class_\ControllerGetByTypeToConstructorInjectionRector::class, - \Rector\Symfony\DependencyInjection\Rector\Class_\CommandGetByTypeToConstructorInjectionRector::class, + ControllerGetByTypeToConstructorInjectionRector::class, + CommandGetByTypeToConstructorInjectionRector::class, + GetBySymfonyStringToConstructorInjectionRector::class, + TraitGetByTypeToInjectRector::class, // legacy rules that require container fetch - ContainerGetToConstructorInjectionRector::class, ContainerGetNameToTypeInTestsRector::class, GetToConstructorInjectionRector::class, ]); diff --git a/vendor/rector/rector-symfony/config/sets/symfony/symfony42.php b/vendor/rector/rector-symfony/config/sets/symfony/symfony42.php index 2bff8a4ab16..31469415031 100644 --- a/vendor/rector/rector-symfony/config/sets/symfony/symfony42.php +++ b/vendor/rector/rector-symfony/config/sets/symfony/symfony42.php @@ -16,7 +16,6 @@ use Rector\Removing\ValueObject\ArgumentRemover; use Rector\Renaming\Rector\MethodCall\RenameMethodRector; use Rector\Renaming\Rector\Name\RenameClassRector; use Rector\Renaming\ValueObject\MethodCallRename; -use Rector\Symfony\Symfony42\Rector\MethodCall\ContainerGetToConstructorInjectionRector; use Rector\Symfony\Symfony42\Rector\New_\RootNodeTreeBuilderRector; use Rector\Symfony\Symfony42\Rector\New_\StringToArrayArgumentProcessRector; use Rector\Transform\Rector\ClassMethod\WrapReturnRector; @@ -39,11 +38,11 @@ return static function (RectorConfig $rectorConfig) : void { 'Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand' => 'Symfony\\Component\\Console\\Command\\Command', 'Symfony\\Component\\Translation\\TranslatorInterface' => 'Symfony\\Contracts\\Translation\\TranslatorInterface', ]); - # related to "Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand" deprecation, @see https://github.com/rectorphp/rector/issues/1629 - $rectorConfig->rule(ContainerGetToConstructorInjectionRector::class); - # https://symfony.com/blog/new-in-symfony-4-2-important-deprecations - $rectorConfig->rule(StringToArrayArgumentProcessRector::class); - $rectorConfig->rule(RootNodeTreeBuilderRector::class); + $rectorConfig->rules([ + # https://symfony.com/blog/new-in-symfony-4-2-important-deprecations + StringToArrayArgumentProcessRector::class, + RootNodeTreeBuilderRector::class, + ]); $rectorConfig->ruleWithConfiguration(ArgumentAdderRector::class, [new ArgumentAdder('Symfony\\Component\\DomCrawler\\Crawler', 'children', 0, null, null, null, ArgumentAddingScope::SCOPE_METHOD_CALL), new ArgumentAdder('Symfony\\Component\\Finder\\Finder', 'sortByName', 0, null, \false, null, ArgumentAddingScope::SCOPE_METHOD_CALL), new ArgumentAdder('Symfony\\Bridge\\Monolog\\Processor\\DebugProcessor', 'getLogs', 0, null, null, null, ArgumentAddingScope::SCOPE_METHOD_CALL), new ArgumentAdder('Symfony\\Bridge\\Monolog\\Processor\\DebugProcessor', 'countErrors', 0, 'default_value', null, null, ArgumentAddingScope::SCOPE_METHOD_CALL), new ArgumentAdder('Symfony\\Bridge\\Monolog\\Logger', 'getLogs', 0, 'default_value', null, null, ArgumentAddingScope::SCOPE_METHOD_CALL), new ArgumentAdder('Symfony\\Bridge\\Monolog\\Logger', 'countErrors', 0, 'default_value', null, null, ArgumentAddingScope::SCOPE_METHOD_CALL), new ArgumentAdder('Symfony\\Component\\Serializer\\Normalizer', 'handleCircularReference', 1, null, null, null, ArgumentAddingScope::SCOPE_METHOD_CALL), new ArgumentAdder('Symfony\\Component\\Serializer\\Normalizer', 'handleCircularReference', 2, null, null, null, ArgumentAddingScope::SCOPE_METHOD_CALL)]); $rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [new MethodCallRename('Symfony\\Component\\Cache\\CacheItem', 'getPreviousTags', 'getMetadata'), new MethodCallRename('Symfony\\Component\\Form\\AbstractTypeExtension', 'getExtendedType', 'getExtendedTypes')]); $iterableType = new IterableType(new MixedType(), new MixedType()); diff --git a/vendor/rector/rector-symfony/rules/DependencyInjection/NodeDecorator/CommandConstructorDecorator.php b/vendor/rector/rector-symfony/rules/DependencyInjection/NodeDecorator/CommandConstructorDecorator.php index 8c84f2d31cb..c3eb70a6a87 100644 --- a/vendor/rector/rector-symfony/rules/DependencyInjection/NodeDecorator/CommandConstructorDecorator.php +++ b/vendor/rector/rector-symfony/rules/DependencyInjection/NodeDecorator/CommandConstructorDecorator.php @@ -13,6 +13,9 @@ use Rector\NodeTypeResolver\NodeTypeResolver; use Rector\ValueObject\MethodName; final class CommandConstructorDecorator { + /** + * @readonly + */ private NodeTypeResolver $nodeTypeResolver; public function __construct(NodeTypeResolver $nodeTypeResolver) { diff --git a/vendor/rector/rector-symfony/rules/DependencyInjection/NodeFactory/AutowireClassMethodFactory.php b/vendor/rector/rector-symfony/rules/DependencyInjection/NodeFactory/AutowireClassMethodFactory.php new file mode 100644 index 00000000000..c57cf5eec3d --- /dev/null +++ b/vendor/rector/rector-symfony/rules/DependencyInjection/NodeFactory/AutowireClassMethodFactory.php @@ -0,0 +1,59 @@ +nodeNameResolver = $nodeNameResolver; + } + /** + * @param PropertyMetadata[] $propertyMetadatas + */ + public function create(Trait_ $trait, array $propertyMetadatas) : ClassMethod + { + $traitName = $this->nodeNameResolver->getShortName($trait); + $autowireClassMethod = new ClassMethod('autowire' . $traitName); + $autowireClassMethod->flags |= Modifiers::PUBLIC; + $autowireClassMethod->returnType = new Identifier('void'); + $autowireClassMethod->setDocComment(new Doc("/**\n * @required\n */")); + foreach ($propertyMetadatas as $propertyMetadata) { + $param = $this->createAutowiredParam($propertyMetadata); + $autowireClassMethod->params[] = $param; + $createPropertyAssign = new Assign(new PropertyFetch(new Variable('this'), new Identifier($propertyMetadata->getName())), new Variable($propertyMetadata->getName())); + $autowireClassMethod->stmts[] = new Expression($createPropertyAssign); + } + return $autowireClassMethod; + } + private function createAutowiredParam(PropertyMetadata $propertyMetadata) : Param + { + $param = new Param(new Variable($propertyMetadata->getName())); + $objectType = $propertyMetadata->getType(); + if (!$objectType instanceof ObjectType) { + throw new ShouldNotHappenException(); + } + $param->type = new FullyQualified($objectType->getClassName()); + return $param; + } +} diff --git a/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/CommandGetByTypeToConstructorInjectionRector.php b/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/CommandGetByTypeToConstructorInjectionRector.php index 2bdb38f6f5c..258c18b68c3 100644 --- a/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/CommandGetByTypeToConstructorInjectionRector.php +++ b/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/CommandGetByTypeToConstructorInjectionRector.php @@ -4,7 +4,6 @@ declare (strict_types=1); namespace Rector\Symfony\DependencyInjection\Rector\Class_; use PhpParser\Node; -use PhpParser\Node\Expr\ClassConstFetch; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Stmt\Class_; use PHPStan\Reflection\ClassReflection; @@ -15,6 +14,7 @@ use Rector\PostRector\ValueObject\PropertyMetadata; use Rector\Rector\AbstractRector; use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType; use Rector\Symfony\DependencyInjection\NodeDecorator\CommandConstructorDecorator; +use Rector\Symfony\DependencyInjection\ThisGetTypeMatcher; use Rector\Symfony\Enum\SymfonyClass; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -35,11 +35,16 @@ final class CommandGetByTypeToConstructorInjectionRector extends AbstractRector * @readonly */ private CommandConstructorDecorator $commandConstructorDecorator; - public function __construct(ClassDependencyManipulator $classDependencyManipulator, PropertyNaming $propertyNaming, CommandConstructorDecorator $commandConstructorDecorator) + /** + * @readonly + */ + private ThisGetTypeMatcher $thisGetTypeMatcher; + public function __construct(ClassDependencyManipulator $classDependencyManipulator, PropertyNaming $propertyNaming, CommandConstructorDecorator $commandConstructorDecorator, ThisGetTypeMatcher $thisGetTypeMatcher) { $this->classDependencyManipulator = $classDependencyManipulator; $this->propertyNaming = $propertyNaming; $this->commandConstructorDecorator = $commandConstructorDecorator; + $this->thisGetTypeMatcher = $thisGetTypeMatcher; } public function getRuleDefinition() : RuleDefinition { @@ -91,27 +96,7 @@ CODE_SAMPLE if (!$node instanceof MethodCall) { return null; } - if ($node->isFirstClassCallable()) { - return null; - } - if (!$this->isName($node->name, 'get')) { - return null; - } - if (!$this->isName($node->var, 'this')) { - return null; - } - if (\count($node->getArgs()) !== 1) { - return null; - } - $firstArg = $node->getArgs()[0]; - if (!$firstArg->value instanceof ClassConstFetch) { - return null; - } - // must be class const fetch - if (!$this->isName($firstArg->value->name, 'class')) { - return null; - } - $className = $this->getName($firstArg->value->class); + $className = $this->thisGetTypeMatcher->match($node); if (!\is_string($className)) { return null; } diff --git a/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/ControllerGetByTypeToConstructorInjectionRector.php b/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/ControllerGetByTypeToConstructorInjectionRector.php index 14e9c6b0e01..1d856e3da03 100644 --- a/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/ControllerGetByTypeToConstructorInjectionRector.php +++ b/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/ControllerGetByTypeToConstructorInjectionRector.php @@ -4,7 +4,6 @@ declare (strict_types=1); namespace Rector\Symfony\DependencyInjection\Rector\Class_; use PhpParser\Node; -use PhpParser\Node\Expr\ClassConstFetch; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Stmt\Class_; use PHPStan\Reflection\ClassReflection; @@ -14,6 +13,7 @@ use Rector\PHPStan\ScopeFetcher; use Rector\PostRector\ValueObject\PropertyMetadata; use Rector\Rector\AbstractRector; use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType; +use Rector\Symfony\DependencyInjection\ThisGetTypeMatcher; use Rector\Symfony\Enum\SymfonyClass; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -30,10 +30,15 @@ final class ControllerGetByTypeToConstructorInjectionRector extends AbstractRect * @readonly */ private PropertyNaming $propertyNaming; - public function __construct(ClassDependencyManipulator $classDependencyManipulator, PropertyNaming $propertyNaming) + /** + * @readonly + */ + private ThisGetTypeMatcher $thisGetTypeMatcher; + public function __construct(ClassDependencyManipulator $classDependencyManipulator, PropertyNaming $propertyNaming, ThisGetTypeMatcher $thisGetTypeMatcher) { $this->classDependencyManipulator = $classDependencyManipulator; $this->propertyNaming = $propertyNaming; + $this->thisGetTypeMatcher = $thisGetTypeMatcher; } public function getRuleDefinition() : RuleDefinition { @@ -85,27 +90,7 @@ CODE_SAMPLE if (!$node instanceof MethodCall) { return null; } - if ($node->isFirstClassCallable()) { - return null; - } - if (!$this->isName($node->name, 'get')) { - return null; - } - if (!$this->isName($node->var, 'this')) { - return null; - } - if (\count($node->getArgs()) !== 1) { - return null; - } - $firstArg = $node->getArgs()[0]; - if (!$firstArg->value instanceof ClassConstFetch) { - return null; - } - // must be class const fetch - if (!$this->isName($firstArg->value->name, 'class')) { - return null; - } - $className = $this->getName($firstArg->value->class); + $className = $this->thisGetTypeMatcher->match($node); if (!\is_string($className)) { return null; } diff --git a/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/GetBySymfonyStringToConstructorInjectionRector.php b/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/GetBySymfonyStringToConstructorInjectionRector.php new file mode 100644 index 00000000000..138e0beb08e --- /dev/null +++ b/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Class_/GetBySymfonyStringToConstructorInjectionRector.php @@ -0,0 +1,129 @@ + + */ + private const SYMFONY_NAME_TO_TYPE_MAP = ['validator' => SymfonyClass::VALIDATOR_INTERFACE, 'event_dispatcher' => SymfonyClass::EVENT_DISPATCHER_INTERFACE, 'logger' => SymfonyClass::LOGGER_INTERFACE, 'jms_serializer' => SymfonyClass::SERIALIZER_INTERFACE]; + public function __construct(ClassDependencyManipulator $classDependencyManipulator, ThisGetTypeMatcher $thisGetTypeMatcher, PropertyNaming $propertyNaming) + { + $this->classDependencyManipulator = $classDependencyManipulator; + $this->thisGetTypeMatcher = $thisGetTypeMatcher; + $this->propertyNaming = $propertyNaming; + } + public function getRuleDefinition() : RuleDefinition + { + return new RuleDefinition('Converts typical Symfony services like $this->get("validator") in commands/controllers to constructor injection (step 3/x)', [new CodeSample(<<<'CODE_SAMPLE' +use Symfony\Bundle\FrameworkBundle\Controller\Controller; + +final class SomeController extends Controller +{ + public function someMethod() + { + $someType = $this->get('validator'); + } +} +CODE_SAMPLE +, <<<'CODE_SAMPLE' +use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Validator\Validator\ValidatorInterface; + +final class SomeController extends Controller +{ + public function __construct(private ValidatorInterface $validator) + + public function someMethod() + { + $someType = $this->validator; + } +} +CODE_SAMPLE +)]); + } + /** + * @return array> + */ + public function getNodeTypes() : array + { + return [Class_::class]; + } + /** + * @param Class_ $node + */ + public function refactor(Node $node) : ?Node + { + if ($this->shouldSkipClass($node)) { + return null; + } + $propertyMetadatas = []; + $this->traverseNodesWithCallable($node, function (Node $node) use(&$propertyMetadatas) : ?Node { + if (!$node instanceof MethodCall) { + return null; + } + $serviceName = $this->thisGetTypeMatcher->matchString($node); + if (!\is_string($serviceName)) { + return null; + } + $serviceType = self::SYMFONY_NAME_TO_TYPE_MAP[$serviceName] ?? null; + if ($serviceType === null) { + return null; + } + $propertyName = $this->propertyNaming->fqnToVariableName($serviceType); + $propertyMetadata = new PropertyMetadata($propertyName, new FullyQualifiedObjectType($serviceType)); + $propertyMetadatas[] = $propertyMetadata; + return $this->nodeFactory->createPropertyFetch('this', $propertyMetadata->getName()); + }); + if ($propertyMetadatas === []) { + return null; + } + foreach ($propertyMetadatas as $propertyMetadata) { + $this->classDependencyManipulator->addConstructorDependency($node, $propertyMetadata); + } + return $node; + } + private function shouldSkipClass(Class_ $class) : bool + { + $scope = ScopeFetcher::fetch($class); + $classReflection = $scope->getClassReflection(); + if (!$classReflection instanceof ClassReflection) { + return \true; + } + if ($classReflection->isSubclassOf(SymfonyClass::CONTAINER_AWARE_COMMAND)) { + return \false; + } + return !$classReflection->isSubclassOf(SymfonyClass::CONTROLLER); + } +} diff --git a/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Trait_/TraitGetByTypeToInjectRector.php b/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Trait_/TraitGetByTypeToInjectRector.php new file mode 100644 index 00000000000..e9479b9bd90 --- /dev/null +++ b/vendor/rector/rector-symfony/rules/DependencyInjection/Rector/Trait_/TraitGetByTypeToInjectRector.php @@ -0,0 +1,132 @@ +propertyNaming = $propertyNaming; + $this->thisGetTypeMatcher = $thisGetTypeMatcher; + $this->autowireClassMethodFactory = $autowireClassMethodFactory; + } + public function getRuleDefinition() : RuleDefinition + { + return new RuleDefinition('From `$this->get(SomeType::class)` in traits, to autowired method with @required', [new CodeSample(<<<'CODE_SAMPLE' +// must be used in old Controller class +trait SomeInjects +{ + public function someMethod() + { + return $this->get(SomeType::class); + } +} +CODE_SAMPLE +, <<<'CODE_SAMPLE' +trait SomeInjects +{ + private SomeType $someType; + + /** + * @required + */ + public function autowireSomeInjects(SomeType $someType): void + { + $this->someType = $someType; + } + + public function someMethod() + { + return $this->someType; + } +} +CODE_SAMPLE +)]); + } + /** + * @return array> + */ + public function getNodeTypes() : array + { + return [Trait_::class]; + } + /** + * @param Trait_ $node + */ + public function refactor(Node $node) : ?Node + { + $propertyMetadatas = []; + $this->traverseNodesWithCallable($node, function (Node $node) use(&$propertyMetadatas) : ?Node { + if (!$node instanceof MethodCall) { + return null; + } + $className = $this->thisGetTypeMatcher->match($node); + if (!\is_string($className)) { + return null; + } + $propertyName = $this->propertyNaming->fqnToVariableName($className); + $propertyMetadata = new PropertyMetadata($propertyName, new FullyQualifiedObjectType($className)); + $propertyMetadatas[] = $propertyMetadata; + return $this->nodeFactory->createPropertyFetch('this', $propertyMetadata->getName()); + }); + if ($propertyMetadatas === []) { + return null; + } + // create local properties + $autowiredProperties = $this->createAutowiredProperties($propertyMetadatas); + $autowireClassMethod = $this->autowireClassMethodFactory->create($node, $propertyMetadatas); + $node->stmts = \array_merge($autowiredProperties, [$autowireClassMethod], $node->stmts); + return $node; + } + /** + * @param PropertyMetadata[] $propertyMetadatas + * @return Property[] + */ + private function createAutowiredProperties(array $propertyMetadatas) : array + { + $autowiredProperties = []; + foreach ($propertyMetadatas as $propertyMetadata) { + $propertyType = $propertyMetadata->getType(); + if (!$propertyType instanceof ObjectType) { + throw new ShouldNotHappenException(); + } + // create property + $autowiredProperties[] = new Property(Modifiers::PRIVATE, [new PropertyItem($propertyMetadata->getName())], [], new FullyQualified($propertyType->getClassName())); + } + return $autowiredProperties; + } +} diff --git a/vendor/rector/rector-symfony/rules/DependencyInjection/ThisGetTypeMatcher.php b/vendor/rector/rector-symfony/rules/DependencyInjection/ThisGetTypeMatcher.php new file mode 100644 index 00000000000..40a1d553f2c --- /dev/null +++ b/vendor/rector/rector-symfony/rules/DependencyInjection/ThisGetTypeMatcher.php @@ -0,0 +1,70 @@ +nodeNameResolver = $nodeNameResolver; + } + public function matchString(MethodCall $methodCall) : ?string + { + $getExpr = $this->matchGetExpr($methodCall); + if (!$getExpr instanceof String_) { + return null; + } + return $getExpr->value; + } + public function match(MethodCall $methodCall) : ?string + { + $getExpr = $this->matchGetExpr($methodCall); + if (!$getExpr instanceof ClassConstFetch) { + return null; + } + // must be class const fetch + if (!$this->nodeNameResolver->isName($getExpr->name, 'class')) { + return null; + } + return $this->nodeNameResolver->getName($getExpr->class); + } + private function isValidContainerCall(MethodCall $methodCall) : bool + { + if ($methodCall->var instanceof MethodCall && $this->nodeNameResolver->isName($methodCall->var->name, 'getContainer')) { + return \true; + } + if ($methodCall->var instanceof Variable && $this->nodeNameResolver->isName($methodCall->var, 'this')) { + return \true; + } + return $methodCall->var instanceof PropertyFetch && $this->nodeNameResolver->isName($methodCall->var->var, 'this') && $this->nodeNameResolver->isName($methodCall->var->name, 'container'); + } + private function matchGetExpr(MethodCall $methodCall) : ?Expr + { + if ($methodCall->isFirstClassCallable()) { + return null; + } + if (!$this->nodeNameResolver->isName($methodCall->name, 'get')) { + return null; + } + if (!$this->isValidContainerCall($methodCall)) { + return null; + } + if (\count($methodCall->getArgs()) !== 1) { + return null; + } + $firstArg = $methodCall->getArgs()[0]; + return $firstArg->value; + } +} diff --git a/vendor/rector/rector-symfony/rules/Symfony42/Rector/MethodCall/ContainerGetToConstructorInjectionRector.php b/vendor/rector/rector-symfony/rules/Symfony42/Rector/MethodCall/ContainerGetToConstructorInjectionRector.php index 72a2457429b..0d12c8e2a8c 100644 --- a/vendor/rector/rector-symfony/rules/Symfony42/Rector/MethodCall/ContainerGetToConstructorInjectionRector.php +++ b/vendor/rector/rector-symfony/rules/Symfony42/Rector/MethodCall/ContainerGetToConstructorInjectionRector.php @@ -8,6 +8,7 @@ use PhpParser\Node\Expr\ClassConstFetch; use PhpParser\Node\Expr\MethodCall; use PhpParser\Node\Stmt\Class_; use PHPStan\Type\ObjectType; +use Rector\Configuration\Deprecation\Contract\DeprecatedInterface; use Rector\NodeManipulator\ClassDependencyManipulator; use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer; use Rector\PostRector\ValueObject\PropertyMetadata; @@ -19,9 +20,9 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** * Ref: https://github.com/symfony/symfony/blob/master/UPGRADE-4.0.md#console * - * @see \Rector\Symfony\Tests\Symfony42\Rector\MethodCall\ContainerGetToConstructorInjectionRector\ContainerGetToConstructorInjectionRectorTest + * @deprecated This rule is deprecated as too vague and causing too many changes. Use more granular @see \Rector\Symfony\Set\SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION instead */ -final class ContainerGetToConstructorInjectionRector extends AbstractRector +final class ContainerGetToConstructorInjectionRector extends AbstractRector implements DeprecatedInterface { /** * @readonly diff --git a/vendor/rector/rector-symfony/rules/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector.php b/vendor/rector/rector-symfony/rules/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector.php index b02a51608bb..6eaded4f0d2 100644 --- a/vendor/rector/rector-symfony/rules/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector.php +++ b/vendor/rector/rector-symfony/rules/Symfony43/Rector/MethodCall/ConvertRenderTemplateShortNotationToBundleSyntaxRector.php @@ -34,7 +34,10 @@ final class ConvertRenderTemplateShortNotationToBundleSyntaxRector extends Abstr public function getRuleDefinition() : RuleDefinition { return new RuleDefinition('Change Twig template short name to bundle syntax in render calls from controllers', [new CodeSample(<<<'CODE_SAMPLE' -class BaseController extends Controller { +use Symfony\Bundle\FrameworkBundle\Controller\Controller; + +class BaseController extends Controller +{ function indexAction() { $this->render('appBundle:Landing\Main:index.html.twig'); @@ -42,7 +45,10 @@ class BaseController extends Controller { } CODE_SAMPLE , <<<'CODE_SAMPLE' -class BaseController extends Controller { +use Symfony\Bundle\FrameworkBundle\Controller\Controller; + +class BaseController extends Controller +{ function indexAction() { $this->render('@app/Landing/Main/index.html.twig'); diff --git a/vendor/rector/rector-symfony/src/Enum/SymfonyClass.php b/vendor/rector/rector-symfony/src/Enum/SymfonyClass.php index 4229e9f835c..00df2298dc3 100644 --- a/vendor/rector/rector-symfony/src/Enum/SymfonyClass.php +++ b/vendor/rector/rector-symfony/src/Enum/SymfonyClass.php @@ -21,4 +21,20 @@ final class SymfonyClass * @var string */ public const CONTAINER_AWARE_COMMAND = 'Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand'; + /** + * @var string + */ + public const EVENT_DISPATCHER_INTERFACE = 'Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface'; + /** + * @var string + */ + public const VALIDATOR_INTERFACE = 'Symfony\\Component\\Validator\\Validator\\ValidatorInterface'; + /** + * @var string + */ + public const LOGGER_INTERFACE = 'Psr\\Log\\LoggerInterface'; + /** + * @var string + */ + public const SERIALIZER_INTERFACE = 'JMS\\Serializer\\SerializerInterface'; }