Updated Rector to commit 506c282f54

506c282f54 [Scoped] Exclude symfony/contracts/HttpClient/Test/HttpClientTestCase.php from parallel-lint check (#2429)
This commit is contained in:
Tomas Votruba 2022-06-04 10:45:13 +00:00
parent 70b4aeb27a
commit 6677a82eb8
157 changed files with 1429 additions and 690 deletions

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = '183493eab8bae7d784f673019e9fe5947493c3a7';
public const PACKAGE_VERSION = '506c282f5486ce09c3256f941b833926941ad3a7';
/**
* @var string
*/
public const RELEASE_DATE = '2022-06-04 11:33:15';
public const RELEASE_DATE = '2022-06-04 12:38:45';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e::getLoader();
return ComposerAutoloaderInit58cd8190dae33fe52cda172fd214e71c::getLoader();

View File

@ -762,6 +762,7 @@ return array(
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\CompletionSuggestions' => $vendorDir . '/symfony/console/Completion/CompletionSuggestions.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\Output\\BashCompletionOutput' => $vendorDir . '/symfony/console/Completion/Output/BashCompletionOutput.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\Output\\CompletionOutputInterface' => $vendorDir . '/symfony/console/Completion/Output/CompletionOutputInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\Output\\FishCompletionOutput' => $vendorDir . '/symfony/console/Completion/Output/FishCompletionOutput.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\Suggestion' => $vendorDir . '/symfony/console/Completion/Suggestion.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\ConsoleEvents' => $vendorDir . '/symfony/console/ConsoleEvents.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Cursor' => $vendorDir . '/symfony/console/Cursor.php',
@ -848,9 +849,12 @@ return array(
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocator' => $vendorDir . '/symfony/dependency-injection/Argument/ServiceLocator.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocatorArgument' => $vendorDir . '/symfony/dependency-injection/Argument/ServiceLocatorArgument.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Argument\\TaggedIteratorArgument' => $vendorDir . '/symfony/dependency-injection/Argument/TaggedIteratorArgument.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\AsDecorator' => $vendorDir . '/symfony/dependency-injection/Attribute/AsDecorator.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\AsTaggedItem' => $vendorDir . '/symfony/dependency-injection/Attribute/AsTaggedItem.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\Autoconfigure' => $vendorDir . '/symfony/dependency-injection/Attribute/Autoconfigure.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\AutoconfigureTag' => $vendorDir . '/symfony/dependency-injection/Attribute/AutoconfigureTag.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\Autowire' => $vendorDir . '/symfony/dependency-injection/Attribute/Autowire.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\MapDecorated' => $vendorDir . '/symfony/dependency-injection/Attribute/MapDecorated.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\TaggedIterator' => $vendorDir . '/symfony/dependency-injection/Attribute/TaggedIterator.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\TaggedLocator' => $vendorDir . '/symfony/dependency-injection/Attribute/TaggedLocator.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\Target' => $vendorDir . '/symfony/dependency-injection/Attribute/Target.php',
@ -861,6 +865,7 @@ return array(
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AnalyzeServiceReferencesPass' => $vendorDir . '/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AttributeAutoconfigurationPass' => $vendorDir . '/symfony/dependency-injection/Compiler/AttributeAutoconfigurationPass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutoAliasServicePass' => $vendorDir . '/symfony/dependency-injection/Compiler/AutoAliasServicePass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutowireAsDecoratorPass' => $vendorDir . '/symfony/dependency-injection/Compiler/AutowireAsDecoratorPass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutowirePass' => $vendorDir . '/symfony/dependency-injection/Compiler/AutowirePass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutowireRequiredMethodsPass' => $vendorDir . '/symfony/dependency-injection/Compiler/AutowireRequiredMethodsPass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutowireRequiredPropertiesPass' => $vendorDir . '/symfony/dependency-injection/Compiler/AutowireRequiredPropertiesPass.php',
@ -939,9 +944,12 @@ return array(
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Exception\\RuntimeException' => $vendorDir . '/symfony/dependency-injection/Exception/RuntimeException.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Exception\\ServiceCircularReferenceException' => $vendorDir . '/symfony/dependency-injection/Exception/ServiceCircularReferenceException.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException' => $vendorDir . '/symfony/dependency-injection/Exception/ServiceNotFoundException.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\AbstractExtension' => $vendorDir . '/symfony/dependency-injection/Extension/AbstractExtension.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\ConfigurableExtensionInterface' => $vendorDir . '/symfony/dependency-injection/Extension/ConfigurableExtensionInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\ConfigurationExtensionInterface' => $vendorDir . '/symfony/dependency-injection/Extension/ConfigurationExtensionInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\Extension' => $vendorDir . '/symfony/dependency-injection/Extension/Extension.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface' => $vendorDir . '/symfony/dependency-injection/Extension/ExtensionInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\ExtensionTrait' => $vendorDir . '/symfony/dependency-injection/Extension/ExtensionTrait.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\PrependExtensionInterface' => $vendorDir . '/symfony/dependency-injection/Extension/PrependExtensionInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\LazyProxy\\Instantiator\\InstantiatorInterface' => $vendorDir . '/symfony/dependency-injection/LazyProxy/Instantiator/InstantiatorInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\LazyProxy\\Instantiator\\RealServiceInstantiator' => $vendorDir . '/symfony/dependency-injection/LazyProxy/Instantiator/RealServiceInstantiator.php',
@ -1096,7 +1104,6 @@ return array(
'RectorPrefix20220604\\Symfony\\Contracts\\Translation\\TranslatorTrait' => $vendorDir . '/symfony/contracts/Translation/TranslatorTrait.php',
'RectorPrefix20220604\\Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Normalizer.php',
'RectorPrefix20220604\\Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php',
'RectorPrefix20220604\\Symfony\\Polyfill\\Php81\\Php81' => $vendorDir . '/symfony/polyfill-php81/Php81.php',
'RectorPrefix20220604\\Symplify\\Astral\\Contract\\NodeNameResolverInterface' => $vendorDir . '/symplify/astral/src/Contract/NodeNameResolverInterface.php',
'RectorPrefix20220604\\Symplify\\Astral\\Contract\\NodeValueResolver\\NodeValueResolverInterface' => $vendorDir . '/symplify/astral/src/Contract/NodeValueResolver/NodeValueResolverInterface.php',
'RectorPrefix20220604\\Symplify\\Astral\\Exception\\ShouldNotHappenException' => $vendorDir . '/symplify/astral/src/Exception/ShouldNotHappenException.php',
@ -3130,7 +3137,6 @@ return array(
'Rector\\Visibility\\Rector\\ClassMethod\\ExplicitPublicClassMethodRector' => $baseDir . '/rules/Visibility/Rector/ClassMethod/ExplicitPublicClassMethodRector.php',
'Rector\\Visibility\\ValueObject\\ChangeConstantVisibility' => $baseDir . '/rules/Visibility/ValueObject/ChangeConstantVisibility.php',
'Rector\\Visibility\\ValueObject\\ChangeMethodVisibility' => $baseDir . '/rules/Visibility/ValueObject/ChangeMethodVisibility.php',
'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php',
'Ssch\\TYPO3Rector\\Configuration\\Typo3Option' => $vendorDir . '/ssch/typo3-rector/src/Configuration/Typo3Option.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\FlexForms\\Rector\\FlexFormRectorInterface' => $vendorDir . '/ssch/typo3-rector/src/Contract/FileProcessor/FlexForms/Rector/FlexFormRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\Fluid\\Rector\\FluidRectorInterface' => $vendorDir . '/ssch/typo3-rector/src/Contract/FileProcessor/Fluid/Rector/FluidRectorInterface.php',

View File

@ -7,7 +7,6 @@ $baseDir = dirname($vendorDir);
return array(
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',

View File

@ -31,7 +31,6 @@ return array(
'RectorPrefix20220604\\Symplify\\ComposerJsonManipulator\\' => array($vendorDir . '/symplify/composer-json-manipulator/src'),
'RectorPrefix20220604\\Symplify\\AutowireArrayParameter\\' => array($vendorDir . '/symplify/autowire-array-parameter/src'),
'RectorPrefix20220604\\Symplify\\Astral\\' => array($vendorDir . '/symplify/astral/src'),
'RectorPrefix20220604\\Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'),
'RectorPrefix20220604\\Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'RectorPrefix20220604\\Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
'RectorPrefix20220604\\Symfony\\Contracts\\' => array($vendorDir . '/symfony/contracts'),

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e
class ComposerAutoloaderInit58cd8190dae33fe52cda172fd214e71c
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit58cd8190dae33fe52cda172fd214e71c', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit58cd8190dae33fe52cda172fd214e71c', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit58cd8190dae33fe52cda172fd214e71c::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit58cd8190dae33fe52cda172fd214e71c::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiredbbd139aceaca9d0c37ec18fb314ef3e($fileIdentifier, $file);
composerRequire58cd8190dae33fe52cda172fd214e71c($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e
* @param string $file
* @return void
*/
function composerRequiredbbd139aceaca9d0c37ec18fb314ef3e($fileIdentifier, $file)
function composerRequire58cd8190dae33fe52cda172fd214e71c($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,11 +4,10 @@
namespace Composer\Autoload;
class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
class ComposerStaticInit58cd8190dae33fe52cda172fd214e71c
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -51,7 +50,6 @@ class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
'RectorPrefix20220604\\Symplify\\ComposerJsonManipulator\\' => 54,
'RectorPrefix20220604\\Symplify\\AutowireArrayParameter\\' => 53,
'RectorPrefix20220604\\Symplify\\Astral\\' => 37,
'RectorPrefix20220604\\Symfony\\Polyfill\\Php81\\' => 44,
'RectorPrefix20220604\\Symfony\\Polyfill\\Mbstring\\' => 47,
'RectorPrefix20220604\\Symfony\\Polyfill\\Intl\\Normalizer\\' => 54,
'RectorPrefix20220604\\Symfony\\Contracts\\' => 39,
@ -194,10 +192,6 @@ class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
array (
0 => __DIR__ . '/..' . '/symplify/astral/src',
),
'RectorPrefix20220604\\Symfony\\Polyfill\\Php81\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php81',
),
'RectorPrefix20220604\\Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
@ -1089,6 +1083,7 @@ class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\CompletionSuggestions' => __DIR__ . '/..' . '/symfony/console/Completion/CompletionSuggestions.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\Output\\BashCompletionOutput' => __DIR__ . '/..' . '/symfony/console/Completion/Output/BashCompletionOutput.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\Output\\CompletionOutputInterface' => __DIR__ . '/..' . '/symfony/console/Completion/Output/CompletionOutputInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\Output\\FishCompletionOutput' => __DIR__ . '/..' . '/symfony/console/Completion/Output/FishCompletionOutput.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Completion\\Suggestion' => __DIR__ . '/..' . '/symfony/console/Completion/Suggestion.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\ConsoleEvents' => __DIR__ . '/..' . '/symfony/console/ConsoleEvents.php',
'RectorPrefix20220604\\Symfony\\Component\\Console\\Cursor' => __DIR__ . '/..' . '/symfony/console/Cursor.php',
@ -1175,9 +1170,12 @@ class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocator' => __DIR__ . '/..' . '/symfony/dependency-injection/Argument/ServiceLocator.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocatorArgument' => __DIR__ . '/..' . '/symfony/dependency-injection/Argument/ServiceLocatorArgument.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Argument\\TaggedIteratorArgument' => __DIR__ . '/..' . '/symfony/dependency-injection/Argument/TaggedIteratorArgument.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\AsDecorator' => __DIR__ . '/..' . '/symfony/dependency-injection/Attribute/AsDecorator.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\AsTaggedItem' => __DIR__ . '/..' . '/symfony/dependency-injection/Attribute/AsTaggedItem.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\Autoconfigure' => __DIR__ . '/..' . '/symfony/dependency-injection/Attribute/Autoconfigure.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\AutoconfigureTag' => __DIR__ . '/..' . '/symfony/dependency-injection/Attribute/AutoconfigureTag.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\Autowire' => __DIR__ . '/..' . '/symfony/dependency-injection/Attribute/Autowire.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\MapDecorated' => __DIR__ . '/..' . '/symfony/dependency-injection/Attribute/MapDecorated.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\TaggedIterator' => __DIR__ . '/..' . '/symfony/dependency-injection/Attribute/TaggedIterator.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\TaggedLocator' => __DIR__ . '/..' . '/symfony/dependency-injection/Attribute/TaggedLocator.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Attribute\\Target' => __DIR__ . '/..' . '/symfony/dependency-injection/Attribute/Target.php',
@ -1188,6 +1186,7 @@ class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AnalyzeServiceReferencesPass' => __DIR__ . '/..' . '/symfony/dependency-injection/Compiler/AnalyzeServiceReferencesPass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AttributeAutoconfigurationPass' => __DIR__ . '/..' . '/symfony/dependency-injection/Compiler/AttributeAutoconfigurationPass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutoAliasServicePass' => __DIR__ . '/..' . '/symfony/dependency-injection/Compiler/AutoAliasServicePass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutowireAsDecoratorPass' => __DIR__ . '/..' . '/symfony/dependency-injection/Compiler/AutowireAsDecoratorPass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutowirePass' => __DIR__ . '/..' . '/symfony/dependency-injection/Compiler/AutowirePass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutowireRequiredMethodsPass' => __DIR__ . '/..' . '/symfony/dependency-injection/Compiler/AutowireRequiredMethodsPass.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Compiler\\AutowireRequiredPropertiesPass' => __DIR__ . '/..' . '/symfony/dependency-injection/Compiler/AutowireRequiredPropertiesPass.php',
@ -1266,9 +1265,12 @@ class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/dependency-injection/Exception/RuntimeException.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Exception\\ServiceCircularReferenceException' => __DIR__ . '/..' . '/symfony/dependency-injection/Exception/ServiceCircularReferenceException.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException' => __DIR__ . '/..' . '/symfony/dependency-injection/Exception/ServiceNotFoundException.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\AbstractExtension' => __DIR__ . '/..' . '/symfony/dependency-injection/Extension/AbstractExtension.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\ConfigurableExtensionInterface' => __DIR__ . '/..' . '/symfony/dependency-injection/Extension/ConfigurableExtensionInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\ConfigurationExtensionInterface' => __DIR__ . '/..' . '/symfony/dependency-injection/Extension/ConfigurationExtensionInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\Extension' => __DIR__ . '/..' . '/symfony/dependency-injection/Extension/Extension.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface' => __DIR__ . '/..' . '/symfony/dependency-injection/Extension/ExtensionInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\ExtensionTrait' => __DIR__ . '/..' . '/symfony/dependency-injection/Extension/ExtensionTrait.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\Extension\\PrependExtensionInterface' => __DIR__ . '/..' . '/symfony/dependency-injection/Extension/PrependExtensionInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\LazyProxy\\Instantiator\\InstantiatorInterface' => __DIR__ . '/..' . '/symfony/dependency-injection/LazyProxy/Instantiator/InstantiatorInterface.php',
'RectorPrefix20220604\\Symfony\\Component\\DependencyInjection\\LazyProxy\\Instantiator\\RealServiceInstantiator' => __DIR__ . '/..' . '/symfony/dependency-injection/LazyProxy/Instantiator/RealServiceInstantiator.php',
@ -1423,7 +1425,6 @@ class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
'RectorPrefix20220604\\Symfony\\Contracts\\Translation\\TranslatorTrait' => __DIR__ . '/..' . '/symfony/contracts/Translation/TranslatorTrait.php',
'RectorPrefix20220604\\Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Normalizer.php',
'RectorPrefix20220604\\Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php',
'RectorPrefix20220604\\Symfony\\Polyfill\\Php81\\Php81' => __DIR__ . '/..' . '/symfony/polyfill-php81/Php81.php',
'RectorPrefix20220604\\Symplify\\Astral\\Contract\\NodeNameResolverInterface' => __DIR__ . '/..' . '/symplify/astral/src/Contract/NodeNameResolverInterface.php',
'RectorPrefix20220604\\Symplify\\Astral\\Contract\\NodeValueResolver\\NodeValueResolverInterface' => __DIR__ . '/..' . '/symplify/astral/src/Contract/NodeValueResolver/NodeValueResolverInterface.php',
'RectorPrefix20220604\\Symplify\\Astral\\Exception\\ShouldNotHappenException' => __DIR__ . '/..' . '/symplify/astral/src/Exception/ShouldNotHappenException.php',
@ -3457,7 +3458,6 @@ class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
'Rector\\Visibility\\Rector\\ClassMethod\\ExplicitPublicClassMethodRector' => __DIR__ . '/../..' . '/rules/Visibility/Rector/ClassMethod/ExplicitPublicClassMethodRector.php',
'Rector\\Visibility\\ValueObject\\ChangeConstantVisibility' => __DIR__ . '/../..' . '/rules/Visibility/ValueObject/ChangeConstantVisibility.php',
'Rector\\Visibility\\ValueObject\\ChangeMethodVisibility' => __DIR__ . '/../..' . '/rules/Visibility/ValueObject/ChangeMethodVisibility.php',
'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php',
'Ssch\\TYPO3Rector\\Configuration\\Typo3Option' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Configuration/Typo3Option.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\FlexForms\\Rector\\FlexFormRectorInterface' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Contract/FileProcessor/FlexForms/Rector/FlexFormRectorInterface.php',
'Ssch\\TYPO3Rector\\Contract\\FileProcessor\\Fluid\\Rector\\FluidRectorInterface' => __DIR__ . '/..' . '/ssch/typo3-rector/src/Contract/FileProcessor/Fluid/Rector/FluidRectorInterface.php',
@ -3792,9 +3792,9 @@ class ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitdbbd139aceaca9d0c37ec18fb314ef3e::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit58cd8190dae33fe52cda172fd214e71c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit58cd8190dae33fe52cda172fd214e71c::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit58cd8190dae33fe52cda172fd214e71c::$classMap;
}, null, ClassLoader::class);
}

View File

@ -2722,21 +2722,22 @@
},
{
"name": "symfony\/console",
"version": "v6.0.9",
"version_normalized": "6.0.9.0",
"version": "v6.1.0",
"version_normalized": "6.1.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/console.git",
"reference": "9b190bc7a19d19add1dbb3382721973836e59b50"
"reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/9b190bc7a19d19add1dbb3382721973836e59b50",
"reference": "9b190bc7a19d19add1dbb3382721973836e59b50",
"url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/c9646197ef43b0e2ff44af61e7f0571526fd4170",
"reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170",
"shasum": ""
},
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"symfony\/deprecation-contracts": "^2.1|^3",
"symfony\/polyfill-mbstring": "~1.0",
"symfony\/service-contracts": "^1.1|^2|^3",
"symfony\/string": "^5.4|^6.0"
@ -2766,7 +2767,7 @@
"symfony\/lock": "",
"symfony\/process": ""
},
"time": "2022-05-27T06:40:13+00:00",
"time": "2022-05-27T06:34:22+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -2800,7 +2801,7 @@
"terminal"
],
"support": {
"source": "https:\/\/github.com\/symfony\/console\/tree\/v6.0.9"
"source": "https:\/\/github.com\/symfony\/console\/tree\/v6.1.0"
},
"funding": [
{
@ -2820,21 +2821,21 @@
},
{
"name": "symfony\/contracts",
"version": "v3.0.1",
"version_normalized": "3.0.1.0",
"version": "v3.1.0",
"version_normalized": "3.1.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/contracts.git",
"reference": "f74917e5665e24008ac9bc3f0947a63b42e1f895"
"reference": "a4a823e4e2ed8e49c29d08e42a0e797a4306585e"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/contracts\/zipball\/f74917e5665e24008ac9bc3f0947a63b42e1f895",
"reference": "f74917e5665e24008ac9bc3f0947a63b42e1f895",
"url": "https:\/\/api.github.com\/repos\/symfony\/contracts\/zipball\/a4a823e4e2ed8e49c29d08e42a0e797a4306585e",
"reference": "a4a823e4e2ed8e49c29d08e42a0e797a4306585e",
"shasum": ""
},
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"psr\/cache": "^3.0",
"psr\/container": "^2.0",
"psr\/event-dispatcher": "^1.0"
@ -2860,11 +2861,11 @@
"symfony\/service-implementation": "",
"symfony\/translation-implementation": ""
},
"time": "2022-03-13T20:10:05+00:00",
"time": "2022-05-07T08:07:09+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
}
},
"installation-source": "dist",
@ -2904,7 +2905,7 @@
"standards"
],
"support": {
"source": "https:\/\/github.com\/symfony\/contracts\/tree\/v3.0.1"
"source": "https:\/\/github.com\/symfony\/contracts\/tree\/v3.1.0"
},
"funding": [
{
@ -2924,29 +2925,28 @@
},
{
"name": "symfony\/dependency-injection",
"version": "v6.0.9",
"version_normalized": "6.0.9.0",
"version": "v6.1.0",
"version_normalized": "6.1.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/dependency-injection.git",
"reference": "eb0945f285285861a6a6b95b8e7f5881680c0d75"
"reference": "fc1fcd2b153f585934e80055bb3254913def2a6e"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/dependency-injection\/zipball\/eb0945f285285861a6a6b95b8e7f5881680c0d75",
"reference": "eb0945f285285861a6a6b95b8e7f5881680c0d75",
"url": "https:\/\/api.github.com\/repos\/symfony\/dependency-injection\/zipball\/fc1fcd2b153f585934e80055bb3254913def2a6e",
"reference": "fc1fcd2b153f585934e80055bb3254913def2a6e",
"shasum": ""
},
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"psr\/container": "^1.1|^2.0",
"symfony\/deprecation-contracts": "^2.1|^3",
"symfony\/polyfill-php81": "^1.22",
"symfony\/service-contracts": "^1.1.6|^2.0|^3.0"
},
"conflict": {
"ext-psr": "<1.1|>=2",
"symfony\/config": "<5.4",
"symfony\/config": "<6.1",
"symfony\/finder": "<5.4",
"symfony\/proxy-manager-bridge": "<5.4",
"symfony\/yaml": "<5.4"
@ -2956,7 +2956,7 @@
"symfony\/service-implementation": "1.1|2.0|3.0"
},
"require-dev": {
"symfony\/config": "^5.4|^6.0",
"symfony\/config": "^6.1",
"symfony\/expression-language": "^5.4|^6.0",
"symfony\/yaml": "^5.4|^6.0"
},
@ -2967,7 +2967,7 @@
"symfony\/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony\/yaml": ""
},
"time": "2022-05-27T06:40:13+00:00",
"time": "2022-05-27T06:40:20+00:00",
"type": "library",
"extra": {
"patches_applied": [
@ -3001,7 +3001,7 @@
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https:\/\/symfony.com",
"support": {
"source": "https:\/\/github.com\/symfony\/dependency-injection\/tree\/v6.0.9"
"source": "https:\/\/github.com\/symfony\/dependency-injection\/tree\/v6.1.0"
},
"funding": [
{
@ -3087,23 +3087,26 @@
},
{
"name": "symfony\/finder",
"version": "v6.0.8",
"version_normalized": "6.0.8.0",
"version": "v6.1.0",
"version_normalized": "6.1.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/finder.git",
"reference": "af7edab28d17caecd1f40a9219fc646ae751c21f"
"reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/finder\/zipball\/af7edab28d17caecd1f40a9219fc646ae751c21f",
"reference": "af7edab28d17caecd1f40a9219fc646ae751c21f",
"url": "https:\/\/api.github.com\/repos\/symfony\/finder\/zipball\/45b8beb69d6eb3b05a65689ebfd4222326773f8f",
"reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f",
"shasum": ""
},
"require": {
"php": ">=8.0.2"
"php": ">=8.1"
},
"time": "2022-04-15T08:07:58+00:00",
"require-dev": {
"symfony\/filesystem": "^6.0"
},
"time": "2022-04-15T08:08:08+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -3131,7 +3134,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https:\/\/symfony.com",
"support": {
"source": "https:\/\/github.com\/symfony\/finder\/tree\/v6.0.8"
"source": "https:\/\/github.com\/symfony\/finder\/tree\/v6.1.0"
},
"funding": [
{
@ -3322,105 +3325,23 @@
],
"install-path": "..\/symfony\/polyfill-mbstring"
},
{
"name": "symfony\/polyfill-php81",
"version": "v1.26.0",
"version_normalized": "1.26.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/polyfill-php81.git",
"reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-php81\/zipball\/13f6d1271c663dc5ae9fb843a8f16521db7687a1",
"reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"time": "2022-05-24T11:49:31+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.26-dev"
},
"thanks": {
"name": "symfony\/polyfill",
"url": "https:\/\/github.com\/symfony\/polyfill"
}
},
"installation-source": "dist",
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"RectorPrefix20220604\\Symfony\\Polyfill\\Php81\\": ""
},
"classmap": [
"Resources\/stubs"
]
},
"notification-url": "https:\/\/packagist.org\/downloads\/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https:\/\/symfony.com\/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
"homepage": "https:\/\/symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https:\/\/github.com\/symfony\/polyfill-php81\/tree\/v1.26.0"
},
"funding": [
{
"url": "https:\/\/symfony.com\/sponsor",
"type": "custom"
},
{
"url": "https:\/\/github.com\/fabpot",
"type": "github"
},
{
"url": "https:\/\/tidelift.com\/funding\/github\/packagist\/symfony\/symfony",
"type": "tidelift"
}
],
"install-path": "..\/symfony\/polyfill-php81"
},
{
"name": "symfony\/string",
"version": "v6.0.9",
"version_normalized": "6.0.9.0",
"version": "v6.1.0",
"version_normalized": "6.1.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/string.git",
"reference": "df9f03d595aa2d446498ba92fe803a519b2c43cc"
"reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/string\/zipball\/df9f03d595aa2d446498ba92fe803a519b2c43cc",
"reference": "df9f03d595aa2d446498ba92fe803a519b2c43cc",
"url": "https:\/\/api.github.com\/repos\/symfony\/string\/zipball\/d3edc75baf9f1d4f94879764dda2e1ac33499529",
"reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529",
"shasum": ""
},
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"symfony\/polyfill-ctype": "~1.8",
"symfony\/polyfill-intl-grapheme": "~1.0",
"symfony\/polyfill-intl-normalizer": "~1.0",
@ -3435,7 +3356,7 @@
"symfony\/translation-contracts": "^2.0|^3.0",
"symfony\/var-exporter": "^5.4|^6.0"
},
"time": "2022-04-22T08:18:02+00:00",
"time": "2022-04-22T08:18:23+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -3474,7 +3395,7 @@
"utf8"
],
"support": {
"source": "https:\/\/github.com\/symfony\/string\/tree\/v6.0.9"
"source": "https:\/\/github.com\/symfony\/string\/tree\/v6.1.0"
},
"funding": [
{

File diff suppressed because one or more lines are too long

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220604\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e', false) && !interface_exists('ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e', false) && !trait_exists('ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e', false)) {
spl_autoload_call('RectorPrefix20220604\ComposerAutoloaderInitdbbd139aceaca9d0c37ec18fb314ef3e');
if (!class_exists('ComposerAutoloaderInit58cd8190dae33fe52cda172fd214e71c', false) && !interface_exists('ComposerAutoloaderInit58cd8190dae33fe52cda172fd214e71c', false) && !trait_exists('ComposerAutoloaderInit58cd8190dae33fe52cda172fd214e71c', false)) {
spl_autoload_call('RectorPrefix20220604\ComposerAutoloaderInit58cd8190dae33fe52cda172fd214e71c');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220604\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -27,9 +27,6 @@ if (!class_exists('Symfony\Component\DependencyInjection\Loader\Configurator\Con
if (!class_exists('Normalizer', false) && !interface_exists('Normalizer', false) && !trait_exists('Normalizer', false)) {
spl_autoload_call('RectorPrefix20220604\Normalizer');
}
if (!class_exists('ReturnTypeWillChange', false) && !interface_exists('ReturnTypeWillChange', false) && !trait_exists('ReturnTypeWillChange', false)) {
spl_autoload_call('RectorPrefix20220604\ReturnTypeWillChange');
}
if (!class_exists('Symplify\ComposerJsonManipulator\ValueObject\ComposerJson', false) && !interface_exists('Symplify\ComposerJsonManipulator\ValueObject\ComposerJson', false) && !trait_exists('Symplify\ComposerJsonManipulator\ValueObject\ComposerJson', false)) {
spl_autoload_call('RectorPrefix20220604\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson');
}
@ -59,9 +56,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220604\print_node(...func_get_args());
}
}
if (!function_exists('composerRequiredbbd139aceaca9d0c37ec18fb314ef3e')) {
function composerRequiredbbd139aceaca9d0c37ec18fb314ef3e() {
return \RectorPrefix20220604\composerRequiredbbd139aceaca9d0c37ec18fb314ef3e(...func_get_args());
if (!function_exists('composerRequire58cd8190dae33fe52cda172fd214e71c')) {
function composerRequire58cd8190dae33fe52cda172fd214e71c() {
return \RectorPrefix20220604\composerRequire58cd8190dae33fe52cda172fd214e71c(...func_get_args());
}
}
if (!function_exists('scanPath')) {
@ -169,11 +166,6 @@ if (!function_exists('trigger_deprecation')) {
return \RectorPrefix20220604\trigger_deprecation(...func_get_args());
}
}
if (!function_exists('enum_exists')) {
function enum_exists() {
return \RectorPrefix20220604\enum_exists(...func_get_args());
}
}
if (!function_exists('includeIfExists')) {
function includeIfExists() {
return \RectorPrefix20220604\includeIfExists(...func_get_args());

View File

@ -76,7 +76,10 @@ class Application implements \RectorPrefix20220604\Symfony\Contracts\Service\Res
* @var bool
*/
private $wantHelps = \false;
private $runningCommand = null;
/**
* @var \Symfony\Component\Console\Command\Command|null
*/
private $runningCommand;
/**
* @var string
*/
@ -85,7 +88,10 @@ class Application implements \RectorPrefix20220604\Symfony\Contracts\Service\Res
* @var string
*/
private $version;
private $commandLoader = null;
/**
* @var \Symfony\Component\Console\CommandLoader\CommandLoaderInterface|null
*/
private $commandLoader;
/**
* @var bool
*/
@ -94,9 +100,21 @@ class Application implements \RectorPrefix20220604\Symfony\Contracts\Service\Res
* @var bool
*/
private $autoExit = \true;
/**
* @var \Symfony\Component\Console\Input\InputDefinition
*/
private $definition;
/**
* @var \Symfony\Component\Console\Helper\HelperSet
*/
private $helperSet;
private $dispatcher = null;
/**
* @var \Symfony\Contracts\EventDispatcher\EventDispatcherInterface|null
*/
private $dispatcher;
/**
* @var \Symfony\Component\Console\Terminal
*/
private $terminal;
/**
* @var string
@ -110,6 +128,9 @@ class Application implements \RectorPrefix20220604\Symfony\Contracts\Service\Res
* @var bool
*/
private $initialized = \false;
/**
* @var \Symfony\Component\Console\SignalRegistry\SignalRegistry
*/
private $signalRegistry;
/**
* @var mixed[]
@ -236,7 +257,7 @@ class Application implements \RectorPrefix20220604\Symfony\Contracts\Service\Res
try {
// Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument.
$input->bind($this->getDefinition());
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\ExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\ExceptionInterface $exception) {
// Errors must be ignored, full binding/validation happens later when the command is known.
}
$name = $this->getCommandName($input);
@ -508,7 +529,7 @@ class Application implements \RectorPrefix20220604\Symfony\Contracts\Service\Res
public function has(string $name) : bool
{
$this->init();
return isset($this->commands[$name]) || $this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name));
return isset($this->commands[$name]) || (($commandLoader = $this->commandLoader) ? $commandLoader->has($name) : null) && $this->add($this->commandLoader->get($name));
}
/**
* Returns an array of all unique namespaces used by currently registered commands.
@ -873,7 +894,7 @@ class Application implements \RectorPrefix20220604\Symfony\Contracts\Service\Res
try {
$command->mergeApplicationDefinition();
$input->bind($command->getDefinition());
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\ExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\ExceptionInterface $exception) {
// ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition
}
$event = new \RectorPrefix20220604\Symfony\Component\Console\Event\ConsoleCommandEvent($command, $input, $output);

View File

@ -1,6 +1,14 @@
CHANGELOG
=========
6.1
---
* Add support to display table vertically when calling setVertical()
* Add method `__toString()` to `InputInterface`
* Deprecate `Command::$defaultName` and `Command::$defaultDescription`, use the `AsCommand` attribute instead
* Add suggested values for arguments and options in input definition, for input completion
6.0
---

View File

@ -18,6 +18,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface;
*/
class GithubActionReporter
{
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $output;
/**
* @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85

View File

@ -14,6 +14,7 @@ use RectorPrefix20220604\Symfony\Component\Console\Application;
use RectorPrefix20220604\Symfony\Component\Console\Attribute\AsCommand;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions;
use RectorPrefix20220604\Symfony\Component\Console\Completion\Suggestion;
use RectorPrefix20220604\Symfony\Component\Console\Exception\ExceptionInterface;
use RectorPrefix20220604\Symfony\Component\Console\Exception\InvalidArgumentException;
use RectorPrefix20220604\Symfony\Component\Console\Exception\LogicException;
@ -36,13 +37,20 @@ class Command
public const INVALID = 2;
/**
* @var string|null The default command name
*
* @deprecated since Symfony 6.1, use the AsCommand attribute instead
*/
protected static $defaultName;
/**
* @var string|null The default command description
*
* @deprecated since Symfony 6.1, use the AsCommand attribute instead
*/
protected static $defaultDescription;
private $application = null;
/**
* @var \Symfony\Component\Console\Application|null
*/
private $application;
/**
* @var string|null
*/
@ -55,6 +63,9 @@ class Command
* @var mixed[]
*/
private $aliases = [];
/**
* @var \Symfony\Component\Console\Input\InputDefinition
*/
private $definition;
/**
* @var bool
@ -68,7 +79,10 @@ class Command
* @var string
*/
private $description = '';
private $fullDefinition = null;
/**
* @var \Symfony\Component\Console\Input\InputDefinition|null
*/
private $fullDefinition;
/**
* @var bool
*/
@ -85,7 +99,10 @@ class Command
* @var mixed[]
*/
private $usages = [];
private $helperSet = null;
/**
* @var \Symfony\Component\Console\Helper\HelperSet|null
*/
private $helperSet;
public static function getDefaultName() : ?string
{
$class = static::class;
@ -93,7 +110,11 @@ class Command
return $attribute[0]->newInstance()->name;
}
$r = new \ReflectionProperty($class, 'defaultName');
return $class === $r->class ? static::$defaultName : null;
if ($class !== $r->class || null === static::$defaultName) {
return null;
}
trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultName" for setting a command name is deprecated. Add the "%s" attribute to the "%s" class instead.', \RectorPrefix20220604\Symfony\Component\Console\Attribute\AsCommand::class, static::class);
return static::$defaultName;
}
public static function getDefaultDescription() : ?string
{
@ -102,7 +123,11 @@ class Command
return $attribute[0]->newInstance()->description;
}
$r = new \ReflectionProperty($class, 'defaultDescription');
return $class === $r->class ? static::$defaultDescription : null;
if ($class !== $r->class || null === static::$defaultDescription) {
return null;
}
trigger_deprecation('symfony/console', '6.1', 'Relying on the static property "$defaultDescription" for setting a command description is deprecated. Add the "%s" attribute to the "%s" class instead.', \RectorPrefix20220604\Symfony\Component\Console\Attribute\AsCommand::class, static::class);
return static::$defaultDescription;
}
/**
* @param string|null $name The name of the command; passing null means it must be set in configure()
@ -291,6 +316,12 @@ class Command
*/
public function complete(\RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput $input, \RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
{
$definition = $this->getDefinition();
if (\RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput::TYPE_OPTION_VALUE === $input->getCompletionType() && $definition->hasOption($input->getCompletionName())) {
$definition->getOption($input->getCompletionName())->complete($input, $suggestions);
} elseif (\RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() && $definition->hasArgument($input->getCompletionName())) {
$definition->getArgument($input->getCompletionName())->complete($input, $suggestions);
}
}
/**
* Sets the code to execute when running this command.
@ -392,8 +423,9 @@ class Command
/**
* Adds an argument.
*
* @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
* @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
* @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
* @param $default The default value (for InputArgument::OPTIONAL mode only)
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
*
* @throws InvalidArgumentException When argument mode is not valid
*
@ -401,10 +433,12 @@ class Command
*/
public function addArgument(string $name, int $mode = null, string $description = '', $default = null)
{
$this->definition->addArgument(new \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument($name, $mode, $description, $default));
if (null !== $this->fullDefinition) {
$this->fullDefinition->addArgument(new \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument($name, $mode, $description, $default));
$suggestedValues = 5 <= \func_num_args() ? \func_get_arg(4) : [];
if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) {
throw new \TypeError(\sprintf('Argument 5 passed to "%s()" must be array or \\Closure, "%s" given.', __METHOD__, \get_debug_type($suggestedValues)));
}
$this->definition->addArgument(new \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument($name, $mode, $description, $default, $suggestedValues));
($fullDefinition = $this->fullDefinition) ? $fullDefinition->addArgument(new \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument($name, $mode, $description, $default, $suggestedValues)) : null;
return $this;
}
/**
@ -413,6 +447,7 @@ class Command
* @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param $mode The option mode: One of the InputOption::VALUE_* constants
* @param $default The default value (must be null for InputOption::VALUE_NONE)
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*
@ -420,10 +455,12 @@ class Command
*/
public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
{
$this->definition->addOption(new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption($name, $shortcut, $mode, $description, $default));
if (null !== $this->fullDefinition) {
$this->fullDefinition->addOption(new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption($name, $shortcut, $mode, $description, $default));
$suggestedValues = 6 <= \func_num_args() ? \func_get_arg(5) : [];
if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) {
throw new \TypeError(\sprintf('Argument 5 passed to "%s()" must be array or \\Closure, "%s" given.', __METHOD__, \get_debug_type($suggestedValues)));
}
$this->definition->addOption(new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues));
($fullDefinition = $this->fullDefinition) ? $fullDefinition->addOption(new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)) : null;
return $this;
}
/**
@ -522,7 +559,7 @@ class Command
public function getProcessedHelp() : string
{
$name = $this->name;
$isSingleCommand = $this->application && $this->application->isSingleCommand();
$isSingleCommand = ($application = $this->application) ? $application->isSingleCommand() : null;
$placeholders = ['%command.name%', '%command.full_name%'];
$replacements = [$name, $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'] . ' ' . $name];
return \str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());

View File

@ -10,10 +10,12 @@
*/
namespace RectorPrefix20220604\Symfony\Component\Console\Command;
use RectorPrefix20220604\Symfony\Component\Console\Attribute\AsCommand;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions;
use RectorPrefix20220604\Symfony\Component\Console\Completion\Output\BashCompletionOutput;
use RectorPrefix20220604\Symfony\Component\Console\Completion\Output\CompletionOutputInterface;
use RectorPrefix20220604\Symfony\Component\Console\Completion\Output\FishCompletionOutput;
use RectorPrefix20220604\Symfony\Component\Console\Exception\CommandNotFoundException;
use RectorPrefix20220604\Symfony\Component\Console\Exception\ExceptionInterface;
use RectorPrefix20220604\Symfony\Component\Console\Input\InputInterface;
@ -24,9 +26,16 @@ use RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface;
*
* @author Wouter de Jong <wouter@wouterj.nl>
*/
#[AsCommand(name: '|_complete', description: 'Internal command to provide shell completion suggestions')]
final class CompleteCommand extends \RectorPrefix20220604\Symfony\Component\Console\Command\Command
{
/**
* @deprecated since Symfony 6.1
*/
protected static $defaultName = '|_complete';
/**
* @deprecated since Symfony 6.1
*/
protected static $defaultDescription = 'Internal command to provide shell completion suggestions';
private $completionOutputs;
private $isDebug = \false;
@ -36,7 +45,7 @@ final class CompleteCommand extends \RectorPrefix20220604\Symfony\Component\Cons
public function __construct(array $completionOutputs = [])
{
// must be set before the parent constructor, as the property value is used in configure()
$this->completionOutputs = $completionOutputs + ['bash' => \RectorPrefix20220604\Symfony\Component\Console\Completion\Output\BashCompletionOutput::class];
$this->completionOutputs = $completionOutputs + ['bash' => \RectorPrefix20220604\Symfony\Component\Console\Completion\Output\BashCompletionOutput::class, 'fish' => \RectorPrefix20220604\Symfony\Component\Console\Completion\Output\FishCompletionOutput::class];
parent::__construct();
}
protected function configure() : void
@ -121,7 +130,7 @@ final class CompleteCommand extends \RectorPrefix20220604\Symfony\Component\Cons
$completionInput = \RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput::fromTokens($input->getOption('input'), (int) $currentIndex);
try {
$completionInput->bind($this->getApplication()->getDefinition());
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\ExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\ExceptionInterface $exception) {
}
return $completionInput;
}
@ -133,7 +142,7 @@ final class CompleteCommand extends \RectorPrefix20220604\Symfony\Component\Cons
return null;
}
return $this->getApplication()->find($inputName);
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\CommandNotFoundException $e) {
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\CommandNotFoundException $exception) {
}
return null;
}

View File

@ -10,8 +10,7 @@
*/
namespace RectorPrefix20220604\Symfony\Component\Console\Command;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions;
use RectorPrefix20220604\Symfony\Component\Console\Attribute\AsCommand;
use RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument;
use RectorPrefix20220604\Symfony\Component\Console\Input\InputInterface;
use RectorPrefix20220604\Symfony\Component\Console\Input\InputOption;
@ -23,50 +22,64 @@ use RectorPrefix20220604\Symfony\Component\Process\Process;
*
* @author Wouter de Jong <wouter@wouterj.nl>
*/
#[AsCommand(name: 'completion', description: 'Dump the shell completion script')]
final class DumpCompletionCommand extends \RectorPrefix20220604\Symfony\Component\Console\Command\Command
{
/**
* @deprecated since Symfony 6.1
*/
protected static $defaultName = 'completion';
/**
* @deprecated since Symfony 6.1
*/
protected static $defaultDescription = 'Dump the shell completion script';
public function complete(\RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput $input, \RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
{
if ($input->mustSuggestArgumentValuesFor('shell')) {
$suggestions->suggestValues($this->getSupportedShells());
}
}
/**
* @var mixed[]
*/
private $supportedShells;
protected function configure()
{
$fullCommand = $_SERVER['PHP_SELF'];
$commandName = \basename($fullCommand);
$fullCommand = @\realpath($fullCommand) ?: $fullCommand;
$shell = $this->guessShell();
switch ($shell) {
case 'fish':
[$rcFile, $completionFile] = ['~/.config/fish/config.fish', "/etc/fish/completions/{$commandName}.fish"];
break;
default:
[$rcFile, $completionFile] = ['~/.bashrc', "/etc/bash_completion.d/{$commandName}"];
break;
}
$this->setHelp(<<<EOH
The <info>%command.name%</> command dumps the shell completion script required
to use shell autocompletion (currently only bash completion is supported).
to use shell autocompletion (currently, bash and fish completion is supported).
<comment>Static installation
-------------------</>
Dump the script to a global completion file and restart your shell:
<info>%command.full_name% bash | sudo tee /etc/bash_completion.d/{$commandName}</>
<info>%command.full_name% {$shell} | sudo tee {$completionFile}</>
Or dump the script to a local file and source it:
<info>%command.full_name% bash > completion.sh</>
<info>%command.full_name% {$shell} > completion.sh</>
<comment># source the file whenever you use the project</>
<info>source completion.sh</>
<comment># or add this line at the end of your "~/.bashrc" file:</>
<comment># or add this line at the end of your "{$rcFile}" file:</>
<info>source /path/to/completion.sh</>
<comment>Dynamic installation
--------------------</>
Add this to the end of your shell configuration file (e.g. <info>"~/.bashrc"</>):
Add this to the end of your shell configuration file (e.g. <info>"{$rcFile}"</>):
<info>eval "\$({$fullCommand} completion bash)"</>
<info>eval "\$({$fullCommand} completion {$shell})"</>
EOH
)->addArgument('shell', \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given')->addOption('debug', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_NONE, 'Tail the completion debug log');
)->addArgument('shell', \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given', null, \Closure::fromCallable([$this, 'getSupportedShells']))->addOption('debug', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_NONE, 'Tail the completion debug log');
}
protected function execute(\RectorPrefix20220604\Symfony\Component\Console\Input\InputInterface $input, \RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface $output) : int
{
@ -105,7 +118,7 @@ EOH
*/
private function getSupportedShells() : array
{
return \array_map(function ($f) {
return $this->supportedShells = $this->supportedShells ?? \array_map(function ($f) {
return \pathinfo($f, \PATHINFO_EXTENSION);
}, \glob(__DIR__ . '/../Resources/completion.*'));
}

View File

@ -10,8 +10,6 @@
*/
namespace RectorPrefix20220604\Symfony\Component\Console\Command;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions;
use RectorPrefix20220604\Symfony\Component\Console\Descriptor\ApplicationDescription;
use RectorPrefix20220604\Symfony\Component\Console\Helper\DescriptorHelper;
use RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument;
@ -25,6 +23,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface;
*/
class HelpCommand extends \RectorPrefix20220604\Symfony\Component\Console\Command\Command
{
/**
* @var \Symfony\Component\Console\Command\Command
*/
private $command;
/**
* {@inheritdoc}
@ -32,7 +33,11 @@ class HelpCommand extends \RectorPrefix20220604\Symfony\Component\Console\Comman
protected function configure()
{
$this->ignoreValidationErrors();
$this->setName('help')->setDefinition([new \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument('command_name', \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument::OPTIONAL, 'The command name', 'help'), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('format', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('raw', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_NONE, 'To output raw command help')])->setDescription('Display help for a command')->setHelp(<<<'EOF'
$this->setName('help')->setDefinition([new \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument('command_name', \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument::OPTIONAL, 'The command name', 'help', function () {
return \array_keys((new \RectorPrefix20220604\Symfony\Component\Console\Descriptor\ApplicationDescription($this->getApplication()))->getCommands());
}), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('format', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () {
return (new \RectorPrefix20220604\Symfony\Component\Console\Helper\DescriptorHelper())->getFormats();
}), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('raw', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_NONE, 'To output raw command help')])->setDescription('Display help for a command')->setHelp(<<<'EOF'
The <info>%command.name%</info> command displays help for a given command:
<info>%command.full_name% list</info>
@ -60,16 +65,4 @@ EOF
unset($this->command);
return 0;
}
public function complete(\RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput $input, \RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
{
if ($input->mustSuggestArgumentValuesFor('command_name')) {
$descriptor = new \RectorPrefix20220604\Symfony\Component\Console\Descriptor\ApplicationDescription($this->getApplication());
$suggestions->suggestValues(\array_keys($descriptor->getCommands()));
return;
}
if ($input->mustSuggestOptionValuesFor('format')) {
$helper = new \RectorPrefix20220604\Symfony\Component\Console\Helper\DescriptorHelper();
$suggestions->suggestValues($helper->getFormats());
}
}
}

View File

@ -13,6 +13,7 @@ namespace RectorPrefix20220604\Symfony\Component\Console\Command;
use RectorPrefix20220604\Symfony\Component\Console\Application;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions;
use RectorPrefix20220604\Symfony\Component\Console\Completion\Suggestion;
use RectorPrefix20220604\Symfony\Component\Console\Helper\HelperSet;
use RectorPrefix20220604\Symfony\Component\Console\Input\InputDefinition;
use RectorPrefix20220604\Symfony\Component\Console\Input\InputInterface;
@ -22,6 +23,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface;
*/
final class LazyCommand extends \RectorPrefix20220604\Symfony\Component\Console\Command\Command
{
/**
* @var \Closure|\Symfony\Component\Console\Command\Command
*/
private $command;
/**
* @var bool|null
@ -96,22 +100,30 @@ final class LazyCommand extends \RectorPrefix20220604\Symfony\Component\Console\
return $this->getCommand()->getNativeDefinition();
}
/**
* {@inheritdoc}
*
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
* @param mixed $default
* @return $this
*/
public function addArgument(string $name, int $mode = null, string $description = '', $default = null)
{
$this->getCommand()->addArgument($name, $mode, $description, $default);
$suggestedValues = 5 <= \func_num_args() ? \func_get_arg(4) : [];
$this->getCommand()->addArgument($name, $mode, $description, $default, $suggestedValues);
return $this;
}
/**
* {@inheritdoc}
*
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
* @param string|mixed[] $shortcut
* @param mixed $default
* @return $this
*/
public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
{
$this->getCommand()->addOption($name, $shortcut, $mode, $description, $default);
$suggestedValues = 6 <= \func_num_args() ? \func_get_arg(5) : [];
$this->getCommand()->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues);
return $this;
}
/**

View File

@ -10,8 +10,6 @@
*/
namespace RectorPrefix20220604\Symfony\Component\Console\Command;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions;
use RectorPrefix20220604\Symfony\Component\Console\Descriptor\ApplicationDescription;
use RectorPrefix20220604\Symfony\Component\Console\Helper\DescriptorHelper;
use RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument;
@ -30,7 +28,11 @@ class ListCommand extends \RectorPrefix20220604\Symfony\Component\Console\Comman
*/
protected function configure()
{
$this->setName('list')->setDefinition([new \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument('namespace', \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument::OPTIONAL, 'The namespace name'), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('raw', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_NONE, 'To output raw command list'), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('format', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('short', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_NONE, 'To skip describing commands\' arguments')])->setDescription('List commands')->setHelp(<<<'EOF'
$this->setName('list')->setDefinition([new \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument('namespace', \RectorPrefix20220604\Symfony\Component\Console\Input\InputArgument::OPTIONAL, 'The namespace name', null, function () {
return \array_keys((new \RectorPrefix20220604\Symfony\Component\Console\Descriptor\ApplicationDescription($this->getApplication()))->getNamespaces());
}), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('raw', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_NONE, 'To output raw command list'), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('format', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () {
return (new \RectorPrefix20220604\Symfony\Component\Console\Helper\DescriptorHelper())->getFormats();
}), new \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption('short', null, \RectorPrefix20220604\Symfony\Component\Console\Input\InputOption::VALUE_NONE, 'To skip describing commands\' arguments')])->setDescription('List commands')->setHelp(<<<'EOF'
The <info>%command.name%</info> command lists all commands:
<info>%command.full_name%</info>
@ -58,16 +60,4 @@ EOF
$helper->describe($output, $this->getApplication(), ['format' => $input->getOption('format'), 'raw_text' => $input->getOption('raw'), 'namespace' => $input->getArgument('namespace'), 'short' => $input->getOption('short')]);
return 0;
}
public function complete(\RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput $input, \RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
{
if ($input->mustSuggestArgumentValuesFor('namespace')) {
$descriptor = new \RectorPrefix20220604\Symfony\Component\Console\Descriptor\ApplicationDescription($this->getApplication());
$suggestions->suggestValues(\array_keys($descriptor->getNamespaces()));
return;
}
if ($input->mustSuggestOptionValuesFor('format')) {
$helper = new \RectorPrefix20220604\Symfony\Component\Console\Helper\DescriptorHelper();
$suggestions->suggestValues($helper->getFormats());
}
}
}

View File

@ -12,6 +12,7 @@ namespace RectorPrefix20220604\Symfony\Component\Console\Command;
use RectorPrefix20220604\Symfony\Component\Console\Exception\LogicException;
use RectorPrefix20220604\Symfony\Component\Lock\LockFactory;
use RectorPrefix20220604\Symfony\Component\Lock\LockInterface;
use RectorPrefix20220604\Symfony\Component\Lock\Store\FlockStore;
use RectorPrefix20220604\Symfony\Component\Lock\Store\SemaphoreStore;
/**
@ -21,7 +22,10 @@ use RectorPrefix20220604\Symfony\Component\Lock\Store\SemaphoreStore;
*/
trait LockableTrait
{
private $lock = null;
/**
* @var \Symfony\Component\Lock\LockInterface|null
*/
private $lock;
/**
* Locks a command.
*/

View File

@ -20,6 +20,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Exception\CommandNotFoundExce
*/
class ContainerCommandLoader implements \RectorPrefix20220604\Symfony\Component\Console\CommandLoader\CommandLoaderInterface
{
/**
* @var \Psr\Container\ContainerInterface
*/
private $container;
/**
* @var mixed[]

View File

@ -72,7 +72,7 @@ final class CompletionInput extends \RectorPrefix20220604\Symfony\Component\Cons
$this->completionValue = $relevantToken;
return;
}
if (null !== $option && $option->acceptValue()) {
if (($option2 = $option) ? $option2->acceptValue() : null) {
$this->completionType = self::TYPE_OPTION_VALUE;
$this->completionName = $option->getName();
$this->completionValue = $optionValue ?: (\strncmp($optionToken, '--', \strlen('--')) !== 0 ? \substr($optionToken, 2) : '');
@ -83,7 +83,7 @@ final class CompletionInput extends \RectorPrefix20220604\Symfony\Component\Cons
if ('-' === $previousToken[0] && '' !== \trim($previousToken, '-')) {
// check if previous option accepted a value
$previousOption = $this->getOptionFromToken($previousToken);
if (null !== $previousOption && $previousOption->acceptValue()) {
if (($previousOption2 = $previousOption) ? $previousOption2->acceptValue() : null) {
$this->completionType = self::TYPE_OPTION_VALUE;
$this->completionName = $previousOption->getName();
$this->completionValue = $relevantToken;
@ -159,7 +159,7 @@ final class CompletionInput extends \RectorPrefix20220604\Symfony\Component\Cons
{
try {
return parent::parseToken($token, $parseOptions);
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\RuntimeException $e) {
} catch (\RectorPrefix20220604\Symfony\Component\Console\Exception\RuntimeException $exception) {
// suppress errors, completed input is almost never valid
}
return $parseOptions;

View File

@ -0,0 +1,31 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace RectorPrefix20220604\Symfony\Component\Console\Completion\Output;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions;
use RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface;
/**
* @author Guillaume Aveline <guillaume.aveline@pm.me>
*/
class FishCompletionOutput implements \RectorPrefix20220604\Symfony\Component\Console\Completion\Output\CompletionOutputInterface
{
public function write(\RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions $suggestions, \RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface $output) : void
{
$values = $suggestions->getValueSuggestions();
foreach ($suggestions->getOptionSuggestions() as $option) {
$values[] = '--' . $option->getName();
if ($option->isNegatable()) {
$values[] = '--no-' . $option->getName();
}
}
$output->write(\implode("\n", $values));
}
}

View File

@ -16,6 +16,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface;
*/
final class Cursor
{
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $output;
private $input;
/**

View File

@ -21,6 +21,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Exception\CommandNotFoundExce
class ApplicationDescription
{
public const GLOBAL_NAMESPACE = '_global';
/**
* @var \Symfony\Component\Console\Application
*/
private $application;
/**
* @var string|null

View File

@ -15,6 +15,9 @@ namespace RectorPrefix20220604\Symfony\Component\Console\Formatter;
*/
final class NullOutputFormatter implements \RectorPrefix20220604\Symfony\Component\Console\Formatter\OutputFormatterInterface
{
/**
* @var \Symfony\Component\Console\Formatter\NullOutputFormatterStyle
*/
private $style;
/**
* {@inheritdoc}
@ -29,7 +32,7 @@ final class NullOutputFormatter implements \RectorPrefix20220604\Symfony\Compone
public function getStyle(string $name) : \RectorPrefix20220604\Symfony\Component\Console\Formatter\OutputFormatterStyleInterface
{
// to comply with the interface we must return a OutputFormatterStyleInterface
return $this->style ?? ($this->style = new \RectorPrefix20220604\Symfony\Component\Console\Formatter\NullOutputFormatterStyle());
return $this->style = $this->style ?? new \RectorPrefix20220604\Symfony\Component\Console\Formatter\NullOutputFormatterStyle();
}
/**
* {@inheritdoc}

View File

@ -27,6 +27,9 @@ class OutputFormatter implements \RectorPrefix20220604\Symfony\Component\Console
* @var mixed[]
*/
private $styles = [];
/**
* @var \Symfony\Component\Console\Formatter\OutputFormatterStyleStack
*/
private $styleStack;
public function __clone()
{
@ -224,7 +227,7 @@ class OutputFormatter implements \RectorPrefix20220604\Symfony\Component\Console
\preg_match('~(\\n)$~', $text, $matches);
$text = $prefix . \preg_replace('~([^\\n]{' . $width . '})\\ *~', "\$1\n", $text);
$text = \rtrim($text, "\n") . ($matches[1] ?? '');
if (!$currentLineLength && '' !== $current && "\n" !== \substr($current, -1)) {
if (!$currentLineLength && '' !== $current && \substr_compare($current, "\n", -\strlen("\n")) !== 0) {
$text = "\n" . $text;
}
$lines = \explode("\n", $text);

View File

@ -18,6 +18,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Color;
*/
class OutputFormatterStyle implements \RectorPrefix20220604\Symfony\Component\Console\Formatter\OutputFormatterStyleInterface
{
/**
* @var \Symfony\Component\Console\Color
*/
private $color;
/**
* @var string

View File

@ -21,6 +21,9 @@ class OutputFormatterStyleStack implements \RectorPrefix20220604\Symfony\Contrac
* @var OutputFormatterStyleInterface[]
*/
private $styles = [];
/**
* @var \Symfony\Component\Console\Formatter\OutputFormatterStyleInterface
*/
private $emptyStyle;
public function __construct(\RectorPrefix20220604\Symfony\Component\Console\Formatter\OutputFormatterStyleInterface $emptyStyle = null)
{

View File

@ -19,6 +19,8 @@ interface WrappableOutputFormatterInterface extends \RectorPrefix20220604\Symfon
{
/**
* Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping).
*
* @return string
*/
public function formatAndWrap(?string $message, int $width);
}

View File

@ -19,8 +19,17 @@ use RectorPrefix20220604\Symfony\Component\VarDumper\Dumper\CliDumper;
*/
final class Dumper
{
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $output;
/**
* @var \Symfony\Component\VarDumper\Dumper\CliDumper|null
*/
private $dumper;
/**
* @var \Symfony\Component\VarDumper\Cloner\ClonerInterface|null
*/
private $cloner;
/**
* @var \Closure
@ -33,9 +42,9 @@ final class Dumper
$this->cloner = $cloner;
if (\class_exists(\RectorPrefix20220604\Symfony\Component\VarDumper\Dumper\CliDumper::class)) {
$this->handler = function ($var) : string {
$dumper = $this->dumper ?? ($this->dumper = new \RectorPrefix20220604\Symfony\Component\VarDumper\Dumper\CliDumper(null, null, \RectorPrefix20220604\Symfony\Component\VarDumper\Dumper\CliDumper::DUMP_LIGHT_ARRAY | \RectorPrefix20220604\Symfony\Component\VarDumper\Dumper\CliDumper::DUMP_COMMA_SEPARATOR));
$dumper = $this->dumper = $this->dumper ?? new \RectorPrefix20220604\Symfony\Component\VarDumper\Dumper\CliDumper(null, null, \RectorPrefix20220604\Symfony\Component\VarDumper\Dumper\CliDumper::DUMP_LIGHT_ARRAY | \RectorPrefix20220604\Symfony\Component\VarDumper\Dumper\CliDumper::DUMP_COMMA_SEPARATOR);
$dumper->setColors($this->output->isDecorated());
return \rtrim($dumper->dump(($this->cloner ?? ($this->cloner = new \RectorPrefix20220604\Symfony\Component\VarDumper\Cloner\VarCloner()))->cloneVar($var)->withRefHandles(\false), \true));
return \rtrim($dumper->dump(($this->cloner = $this->cloner ?? new \RectorPrefix20220604\Symfony\Component\VarDumper\Cloner\VarCloner())->cloneVar($var)->withRefHandles(\false), \true));
};
} else {
$this->handler = function ($var) : string {

View File

@ -40,7 +40,7 @@ abstract class Helper implements \RectorPrefix20220604\Symfony\Component\Console
*/
public static function width(?string $string) : int
{
$string ?? ($string = '');
$string = $string ?? '';
if (\preg_match('//u', $string)) {
return (new \RectorPrefix20220604\Symfony\Component\String\UnicodeString($string))->width(\false);
}
@ -55,7 +55,7 @@ abstract class Helper implements \RectorPrefix20220604\Symfony\Component\Console
*/
public static function length(?string $string) : int
{
$string ?? ($string = '');
$string = $string ?? '';
if (\preg_match('//u', $string)) {
return (new \RectorPrefix20220604\Symfony\Component\String\UnicodeString($string))->length();
}
@ -69,7 +69,7 @@ abstract class Helper implements \RectorPrefix20220604\Symfony\Component\Console
*/
public static function substr(?string $string, int $from, int $length = null) : string
{
$string ?? ($string = '');
$string = $string ?? '';
if (\false === ($encoding = \mb_detect_encoding($string, null, \true))) {
return \substr($string, $from, $length);
}

View File

@ -76,6 +76,9 @@ final class ProgressBar
* @var float
*/
private $maxSecondsBetweenRedraws = 1;
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $output;
/**
* @var int
@ -109,11 +112,17 @@ final class ProgressBar
* @var bool
*/
private $overwrite = \true;
/**
* @var \Symfony\Component\Console\Terminal
*/
private $terminal;
/**
* @var string|null
*/
private $previousMessage;
/**
* @var \Symfony\Component\Console\Cursor
*/
private $cursor;
/**
* @var mixed[]
@ -479,7 +488,6 @@ final class ProgressBar
private function determineBestFormat() : string
{
switch ($this->output->getVerbosity()) {
// OutputInterface::VERBOSITY_QUIET: display is disabled anyway
case \RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERBOSE:
return $this->max ? self::FORMAT_VERBOSE : self::FORMAT_VERBOSE_NOMAX;
case \RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERY_VERBOSE:

View File

@ -19,6 +19,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface;
class ProgressIndicator
{
private const FORMATS = ['normal' => ' %indicator% %message%', 'normal_no_ansi' => ' %message%', 'verbose' => ' %indicator% %message% (%elapsed:6s%)', 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)'];
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $output;
/**
* @var int
@ -175,7 +178,6 @@ class ProgressIndicator
private function determineBestFormat() : string
{
switch ($this->output->getVerbosity()) {
// OutputInterface::VERBOSITY_QUIET: display is disabled anyway
case \RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERBOSE:
return $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi';
case \RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERY_VERBOSE:

View File

@ -341,7 +341,7 @@ class QuestionHelper extends \RectorPrefix20220604\Symfony\Component\Console\Hel
if ('\\' === \DIRECTORY_SEPARATOR) {
$exe = __DIR__ . '/../Resources/bin/hiddeninput.exe';
// handle code running from a phar
if ('phar:' === \substr(__FILE__, 0, 5)) {
if (\strncmp(__FILE__, 'phar:', \strlen('phar:')) === 0) {
$tmpExe = \sys_get_temp_dir() . '/hiddeninput.exe';
\copy($exe, $tmpExe);
$exe = $tmpExe;

View File

@ -33,6 +33,9 @@ class Table
private const SEPARATOR_BOTTOM = 3;
private const BORDER_OUTSIDE = 0;
private const BORDER_INSIDE = 1;
private const DISPLAY_ORIENTATION_DEFAULT = 'default';
private const DISPLAY_ORIENTATION_HORIZONTAL = 'horizontal';
private const DISPLAY_ORIENTATION_VERTICAL = 'vertical';
/**
* @var string|null
*/
@ -49,10 +52,6 @@ class Table
* @var mixed[]
*/
private $rows = [];
/**
* @var bool
*/
private $horizontal = \false;
/**
* @var mixed[]
*/
@ -61,7 +60,13 @@ class Table
* @var int
*/
private $numberOfColumns;
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $output;
/**
* @var \Symfony\Component\Console\Helper\TableStyle
*/
private $style;
/**
* @var mixed[]
@ -79,6 +84,10 @@ class Table
* @var bool
*/
private $rendered = \false;
/**
* @var string
*/
private $displayOrientation = self::DISPLAY_ORIENTATION_DEFAULT;
/**
* @var mixed[]
*/
@ -274,7 +283,15 @@ class Table
*/
public function setHorizontal(bool $horizontal = \true)
{
$this->horizontal = $horizontal;
$this->displayOrientation = $horizontal ? self::DISPLAY_ORIENTATION_HORIZONTAL : self::DISPLAY_ORIENTATION_DEFAULT;
return $this;
}
/**
* @return $this
*/
public function setVertical(bool $vertical = \true)
{
$this->displayOrientation = $vertical ? self::DISPLAY_ORIENTATION_VERTICAL : self::DISPLAY_ORIENTATION_DEFAULT;
return $this;
}
/**
@ -293,8 +310,13 @@ class Table
public function render()
{
$divider = new \RectorPrefix20220604\Symfony\Component\Console\Helper\TableSeparator();
if ($this->horizontal) {
$rows = [];
$isCellWithColspan = static function ($cell) {
return $cell instanceof \RectorPrefix20220604\Symfony\Component\Console\Helper\TableCell && $cell->getColspan() >= 2;
};
$horizontal = self::DISPLAY_ORIENTATION_HORIZONTAL === $this->displayOrientation;
$vertical = self::DISPLAY_ORIENTATION_VERTICAL === $this->displayOrientation;
$rows = [];
if ($horizontal) {
foreach ($this->headers[0] ?? [] as $i => $header) {
$rows[$i] = [$header];
foreach ($this->rows as $row) {
@ -303,21 +325,50 @@ class Table
}
if (isset($row[$i])) {
$rows[$i][] = $row[$i];
} elseif ($rows[$i][0] instanceof \RectorPrefix20220604\Symfony\Component\Console\Helper\TableCell && $rows[$i][0]->getColspan() >= 2) {
} elseif ($isCellWithColspan($rows[$i][0])) {
// Noop, there is a "title"
} else {
$rows[$i][] = null;
}
}
}
} elseif ($vertical) {
$formatter = $this->output->getFormatter();
$maxHeaderLength = \array_reduce($this->headers[0] ?? [], static function ($max, $header) use($formatter) {
return \max($max, \RectorPrefix20220604\Symfony\Component\Console\Helper\Helper::width(\RectorPrefix20220604\Symfony\Component\Console\Helper\Helper::removeDecoration($formatter, $header)));
}, 0);
foreach ($this->rows as $row) {
if ($row instanceof \RectorPrefix20220604\Symfony\Component\Console\Helper\TableSeparator) {
continue;
}
if ($rows) {
$rows[] = [$divider];
}
$containsColspan = \false;
foreach ($row as $cell) {
if ($containsColspan = $isCellWithColspan($cell)) {
break;
}
}
$headers = $this->headers[0] ?? [];
$maxRows = \max(\count($headers), \count($row));
for ($i = 0; $i < $maxRows; ++$i) {
$cell = (string) ($row[$i] ?? '');
if ($headers && !$containsColspan) {
$rows[] = [\sprintf('<comment>%s</>: %s', \str_pad($headers[$i] ?? '', $maxHeaderLength, ' ', \STR_PAD_LEFT), $cell)];
} elseif ('' !== $cell) {
$rows[] = [$cell];
}
}
}
} else {
$rows = \array_merge($this->headers, [$divider], $this->rows);
}
$this->calculateNumberOfColumns($rows);
$rowGroups = $this->buildTableRows($rows);
$this->calculateColumnsWidth($rowGroups);
$isHeader = !$this->horizontal;
$isFirstRow = $this->horizontal;
$isHeader = !$horizontal;
$isFirstRow = $horizontal;
$hasTitle = (bool) $this->headerTitle;
foreach ($rowGroups as $rowGroup) {
$isHeaderSeparatorRendered = \false;
@ -344,7 +395,11 @@ class Table
$isFirstRow = \false;
$hasTitle = \false;
}
if ($this->horizontal) {
if ($vertical) {
$isHeader = \false;
$isFirstRow = \false;
}
if ($horizontal) {
$this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat());
} else {
$this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat());
@ -364,7 +419,7 @@ class Table
*/
private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null)
{
if (0 === ($count = $this->numberOfColumns)) {
if (!($count = $this->numberOfColumns)) {
return;
}
$borders = $this->style->getBorderChars();
@ -465,11 +520,11 @@ class Table
$tag = \http_build_query($cell->getStyle()->getTagOptions(), '', ';');
$cellFormat = '<' . $tag . '>%s</>';
}
if (\strstr($content, '</>')) {
if (\strpos($content, '</>') !== \false) {
$content = \str_replace('</>', '', $content);
$width -= 3;
}
if (\strstr($content, '<fg=default;bg=default>')) {
if (\strpos($content, '<fg=default;bg=default>') !== \false) {
$content = \str_replace('<fg=default;bg=default>', '', $content);
$width -= \strlen('<fg=default;bg=default>');
}
@ -505,7 +560,7 @@ class Table
if (isset($this->columnMaxWidths[$column]) && \RectorPrefix20220604\Symfony\Component\Console\Helper\Helper::width(\RectorPrefix20220604\Symfony\Component\Console\Helper\Helper::removeDecoration($formatter, $cell)) > $this->columnMaxWidths[$column]) {
$cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan);
}
if (!\strstr($cell ?? '', "\n")) {
if (\strpos($cell ?? '', "\n") === \false) {
continue;
}
$escaped = \implode("\n", \array_map([\RectorPrefix20220604\Symfony\Component\Console\Formatter\OutputFormatter::class, 'escapeTrailingBackslash'], \explode("\n", $cell)));
@ -545,7 +600,7 @@ class Table
++$numberOfRows;
// Add row for header separator
}
if (\count($this->rows) > 0) {
if ($this->rows) {
++$numberOfRows;
// Add row for footer separator
}
@ -566,7 +621,7 @@ class Table
if ($cell instanceof \RectorPrefix20220604\Symfony\Component\Console\Helper\TableCell && $cell->getRowspan() > 1) {
$nbLines = $cell->getRowspan() - 1;
$lines = [$cell];
if (\strstr($cell, "\n")) {
if (\strpos($cell, "\n") !== \false) {
$lines = \explode("\n", \str_replace("\n", "<fg=default;bg=default>\n</>", $cell));
$nbLines = \count($lines) > $nbLines ? \substr_count($cell, "\n") : $nbLines;
$rows[$line][$column] = new \RectorPrefix20220604\Symfony\Component\Console\Helper\TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]);

View File

@ -105,7 +105,7 @@ class ArrayInput extends \RectorPrefix20220604\Symfony\Component\Console\Input\I
$params[] = $param . ('' != $val ? $glue . $this->escapeToken($val) : '');
}
} else {
$params[] = \is_array($val) ? \implode(' ', \array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val);
$params[] = \is_array($val) ? \implode(' ', \array_map(\Closure::fromCallable([$this, 'escapeToken']), $val)) : $this->escapeToken($val);
}
}
return \implode(' ', $params);

View File

@ -10,6 +10,10 @@
*/
namespace RectorPrefix20220604\Symfony\Component\Console\Input;
use RectorPrefix20220604\Symfony\Component\Console\Command\Command;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions;
use RectorPrefix20220604\Symfony\Component\Console\Completion\Suggestion;
use RectorPrefix20220604\Symfony\Component\Console\Exception\InvalidArgumentException;
use RectorPrefix20220604\Symfony\Component\Console\Exception\LogicException;
/**
@ -34,6 +38,10 @@ class InputArgument
* @var string|int|bool|mixed[]|null|float
*/
private $default;
/**
* @var mixed[]|\Closure
*/
private $suggestedValues;
/**
* @var string
*/
@ -43,10 +51,11 @@ class InputArgument
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
* @param string $description A description text
* @param string|bool|int|float|mixed[] $default The default value (for self::OPTIONAL mode only)
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
*
* @throws InvalidArgumentException When argument mode is not valid
*/
public function __construct(string $name, int $mode = null, string $description = '', $default = null)
public function __construct(string $name, int $mode = null, string $description = '', $default = null, $suggestedValues = [])
{
if (null === $mode) {
$mode = self::OPTIONAL;
@ -56,6 +65,7 @@ class InputArgument
$this->name = $name;
$this->mode = $mode;
$this->description = $description;
$this->suggestedValues = $suggestedValues;
$this->setDefault($default);
}
/**
@ -111,6 +121,25 @@ class InputArgument
{
return $this->default;
}
public function hasCompletion() : bool
{
return [] !== $this->suggestedValues;
}
/**
* Adds suggestions to $suggestions for the current completion input.
*
* @see Command::complete()
*/
public function complete(\RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput $input, \RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
{
$values = $this->suggestedValues;
if ($values instanceof \Closure && !\is_array($values = $values($input))) {
throw new \RectorPrefix20220604\Symfony\Component\Console\Exception\LogicException(\sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, \get_debug_type($values)));
}
if ($values) {
$suggestions->suggestValues($values);
}
}
/**
* Returns the description text.
*/

View File

@ -34,8 +34,14 @@ class InputDefinition
* @var int
*/
private $requiredCount = 0;
private $lastArrayArgument = null;
private $lastOptionalArgument = null;
/**
* @var \Symfony\Component\Console\Input\InputArgument|null
*/
private $lastArrayArgument;
/**
* @var \Symfony\Component\Console\Input\InputArgument|null
*/
private $lastOptionalArgument;
/**
* @var mixed[]
*/

View File

@ -16,6 +16,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Exception\RuntimeException;
* InputInterface is the interface implemented by all input classes.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @method string __toString() Returns a stringified representation of the args passed to the command.
* InputArguments MUST be escaped as well as the InputOption values passed to the command.
*/
interface InputInterface
{

View File

@ -10,6 +10,10 @@
*/
namespace RectorPrefix20220604\Symfony\Component\Console\Input;
use RectorPrefix20220604\Symfony\Component\Console\Command\Command;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput;
use RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions;
use RectorPrefix20220604\Symfony\Component\Console\Completion\Suggestion;
use RectorPrefix20220604\Symfony\Component\Console\Exception\InvalidArgumentException;
use RectorPrefix20220604\Symfony\Component\Console\Exception\LogicException;
/**
@ -55,6 +59,10 @@ class InputOption
* @var string|int|bool|mixed[]|null|float
*/
private $default;
/**
* @var mixed[]|\Closure
*/
private $suggestedValues;
/**
* @var string
*/
@ -63,10 +71,11 @@ class InputOption
* @param string|mixed[] $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
* @param int|null $mode The option mode: One of the VALUE_* constants
* @param string|bool|int|float|mixed[] $default The default value (must be null for self::VALUE_NONE)
* @param array|\Closure(CompletionInput,CompletionSuggestions):list<string|Suggestion> $suggestedValues The values used for input completion
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*/
public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null, $suggestedValues = [])
{
if (\strncmp($name, '--', \strlen('--')) === 0) {
$name = \substr($name, 2);
@ -97,6 +106,10 @@ class InputOption
$this->shortcut = $shortcut;
$this->mode = $mode;
$this->description = $description;
$this->suggestedValues = $suggestedValues;
if ($suggestedValues && !$this->acceptValue()) {
throw new \RectorPrefix20220604\Symfony\Component\Console\Exception\LogicException('Cannot set suggested values if the option does not accept a value.');
}
if ($this->isArray() && !$this->acceptValue()) {
throw new \RectorPrefix20220604\Symfony\Component\Console\Exception\InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.');
}
@ -191,6 +204,25 @@ class InputOption
{
return $this->description;
}
public function hasCompletion() : bool
{
return [] !== $this->suggestedValues;
}
/**
* Adds suggestions to $suggestions for the current completion input.
*
* @see Command::complete()
*/
public function complete(\RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionInput $input, \RectorPrefix20220604\Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
{
$values = $this->suggestedValues;
if ($values instanceof \Closure && !\is_array($values = $values($input))) {
throw new \RectorPrefix20220604\Symfony\Component\Console\Exception\LogicException(\sprintf('Closure for option "%s" must return an array. Got "%s".', $this->name, \get_debug_type($values)));
}
if ($values) {
$suggestions->suggestValues($values);
}
}
/**
* Checks whether the given option equals this one.
*/

View File

@ -22,6 +22,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Exception\InvalidArgumentExce
*/
class StringInput extends \RectorPrefix20220604\Symfony\Component\Console\Input\ArgvInput
{
/**
* @deprecated since Symfony 6.1
*/
public const REGEX_STRING = '([^\\s]+?)(?:\\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
public const REGEX_UNQUOTED_STRING = '([^\\s\\\\]+?)';
public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';

View File

@ -26,6 +26,9 @@ class ConsoleLogger extends \RectorPrefix20220604\Psr\Log\AbstractLogger
{
public const INFO = 'info';
public const ERROR = 'error';
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $output;
/**
* @var mixed[]

View File

@ -27,6 +27,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Formatter\OutputFormatterInte
*/
class ConsoleOutput extends \RectorPrefix20220604\Symfony\Component\Console\Output\StreamOutput implements \RectorPrefix20220604\Symfony\Component\Console\Output\ConsoleOutputInterface
{
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $stderr;
/**
* @var mixed[]

View File

@ -31,6 +31,9 @@ class ConsoleSectionOutput extends \RectorPrefix20220604\Symfony\Component\Conso
* @var mixed[]
*/
private $sections;
/**
* @var \Symfony\Component\Console\Terminal
*/
private $terminal;
/**
* @param resource $stream

View File

@ -22,6 +22,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Formatter\OutputFormatterInte
*/
class NullOutput implements \RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface
{
/**
* @var \Symfony\Component\Console\Formatter\NullOutputFormatter
*/
private $formatter;
/**
* {@inheritdoc}

View File

@ -31,6 +31,9 @@ abstract class Output implements \RectorPrefix20220604\Symfony\Component\Console
* @var int
*/
private $verbosity;
/**
* @var \Symfony\Component\Console\Formatter\OutputFormatterInterface
*/
private $formatter;
/**
* @param int|null $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)

View File

@ -164,7 +164,7 @@ class Question
} elseif ($values instanceof \Traversable) {
$valueCache = null;
$callback = static function () use($values, &$valueCache) {
return $valueCache ?? ($valueCache = \iterator_to_array($values, \false));
return $valueCache = $valueCache ?? \iterator_to_array($values, \false);
};
} else {
$callback = null;
@ -190,7 +190,7 @@ class Question
if ($this->hidden && null !== $callback) {
throw new \RectorPrefix20220604\Symfony\Component\Console\Exception\LogicException('A hidden question cannot use the autocompleter.');
}
$this->autocompleterCallback = null === $callback || $callback instanceof \Closure ? $callback : \Closure::fromCallable($callback);
$this->autocompleterCallback = null === $callback ? null : \Closure::fromCallable($callback);
return $this;
}
/**
@ -200,7 +200,7 @@ class Question
*/
public function setValidator(callable $validator = null)
{
$this->validator = null === $validator || $validator instanceof \Closure ? $validator : \Closure::fromCallable($validator);
$this->validator = null === $validator ? null : \Closure::fromCallable($validator);
return $this;
}
/**
@ -245,7 +245,7 @@ class Question
*/
public function setNormalizer(callable $normalizer)
{
$this->normalizer = $normalizer instanceof \Closure ? $normalizer : \Closure::fromCallable($normalizer);
$this->normalizer = \Closure::fromCallable($normalizer);
return $this;
}
/**

View File

@ -4,18 +4,6 @@ Console Component
The Console component eases the creation of beautiful and testable command line
interfaces.
Sponsor
-------
The Console component for Symfony 5.4/6.0 is [backed][1] by [Les-Tilleuls.coop][2].
Les-Tilleuls.coop is a team of 50+ Symfony experts who can help you design, develop and
fix your projects. We provide a wide range of professional services including development,
consulting, coaching, training and audits. We also are highly skilled in JS, Go and DevOps.
We are a worker cooperative!
Help Symfony by [sponsoring][3] its development!
Resources
---------
@ -30,7 +18,3 @@ Credits
`Resources/bin/hiddeninput.exe` is a third party binary provided within this
component. Find sources and license at https://github.com/Seldaek/hidden-input.
[1]: https://symfony.com/backers
[2]: https://les-tilleuls.coop
[3]: https://symfony.com/sponsor

View File

@ -0,0 +1,29 @@
# This file is part of the Symfony package.
#
# (c) Fabien Potencier <fabien@symfony.com>
#
# For the full copyright and license information, please view
# https://symfony.com/doc/current/contributing/code/license.html
function _sf_{{ COMMAND_NAME }}
set sf_cmd (commandline -o)
set c (count (commandline -oc))
set completecmd "$sf_cmd[1]" "_complete" "-sfish" "-S{{ VERSION }}"
for i in $sf_cmd
if [ $i != "" ]
set completecmd $completecmd "-i$i"
end
end
set completecmd $completecmd "-c$c"
set sfcomplete ($completecmd)
for i in $sfcomplete
echo $i
end
end
complete -c '{{ COMMAND_NAME }}' -a '(_sf_{{ COMMAND_NAME }})' -f

View File

@ -31,17 +31,11 @@ final class SignalRegistry
}
}
$this->signalHandlers[$signal][] = $signalHandler;
\pcntl_signal($signal, [$this, 'handle']);
\pcntl_signal($signal, \Closure::fromCallable([$this, 'handle']));
}
public static function isSupported() : bool
{
if (!\function_exists('pcntl_signal')) {
return \false;
}
if (\in_array('pcntl_signal', \explode(',', \ini_get('disable_functions')))) {
return \false;
}
return \true;
return \function_exists('pcntl_signal');
}
/**
* @internal

View File

@ -21,6 +21,9 @@ use RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface;
*/
abstract class OutputStyle implements \RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface, \RectorPrefix20220604\Symfony\Component\Console\Style\StyleInterface
{
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $output;
public function __construct(\RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface $output)
{

View File

@ -35,14 +35,29 @@ use RectorPrefix20220604\Symfony\Component\Console\Terminal;
class SymfonyStyle extends \RectorPrefix20220604\Symfony\Component\Console\Style\OutputStyle
{
public const MAX_LINE_LENGTH = 120;
/**
* @var \Symfony\Component\Console\Input\InputInterface
*/
private $input;
/**
* @var \Symfony\Component\Console\Output\OutputInterface
*/
private $output;
/**
* @var \Symfony\Component\Console\Helper\SymfonyQuestionHelper
*/
private $questionHelper;
/**
* @var \Symfony\Component\Console\Helper\ProgressBar
*/
private $progressBar;
/**
* @var int
*/
private $lineLength;
/**
* @var \Symfony\Component\Console\Output\TrimmedBufferOutput
*/
private $bufferedOutput;
public function __construct(\RectorPrefix20220604\Symfony\Component\Console\Input\InputInterface $input, \RectorPrefix20220604\Symfony\Component\Console\Output\OutputInterface $output)
{

View File

@ -21,7 +21,8 @@
}
],
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"symfony\/deprecation-contracts": "^2.1|^3",
"symfony\/polyfill-mbstring": "~1.0",
"symfony\/service-contracts": "^1.1|^2|^3",
"symfony\/string": "^5.4|^6.0"

View File

@ -38,7 +38,7 @@ trait CacheTrait
}
private function doGet(\RectorPrefix20220604\Psr\Cache\CacheItemPoolInterface $pool, string $key, callable $callback, ?float $beta, array &$metadata = null, \RectorPrefix20220604\Psr\Log\LoggerInterface $logger = null) : mixed
{
if (0 > ($beta = $beta ?? 1.0)) {
if (0 > ($beta ??= 1.0)) {
throw new class(\sprintf('Argument "$beta" provided to "%s::get()" must be a positive number, %f given.', static::class, $beta)) extends \InvalidArgumentException implements \RectorPrefix20220604\Psr\Cache\InvalidArgumentException
{
};
@ -52,7 +52,7 @@ trait CacheTrait
if ($recompute = $ctime && $expiry && $expiry <= ($now = \microtime(\true)) - $ctime / 1000 * $beta * \log(\random_int(1, \PHP_INT_MAX) / \PHP_INT_MAX)) {
// force applying defaultLifetime to expiry
$item->expiresAt(null);
$logger && $logger->info('Item "{key}" elected for early recomputation {delta}s before its expiration', ['key' => $key, 'delta' => \sprintf('%.1f', $expiry - $now)]);
$logger?->info('Item "{key}" elected for early recomputation {delta}s before its expiration', ['key' => $key, 'delta' => \sprintf('%.1f', $expiry - $now)]);
}
}
if ($recompute) {

View File

@ -23,7 +23,7 @@
}
],
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"psr\/cache": "^3.0"
},
"suggest": {
@ -37,7 +37,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
},
"thanks": {
"name": "symfony\/contracts",

View File

@ -15,7 +15,7 @@
}
],
"require": {
"php": ">=8.0.2"
"php": ">=8.1"
},
"autoload": {
"files": [
@ -25,7 +25,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
},
"thanks": {
"name": "symfony\/contracts",

View File

@ -19,11 +19,13 @@ interface EventDispatcherInterface extends \RectorPrefix20220604\Psr\EventDispat
/**
* Dispatches an event to all registered listeners.
*
* @param object $event The event to pass to the event handlers/listeners
* @template T of object
*
* @param T $event The event to pass to the event handlers/listeners
* @param string|null $eventName The name of the event to dispatch. If not supplied,
* the class of $event should be used instead.
*
* @return object The passed $event MUST be returned
* @return T The passed $event MUST be returned
*/
public function dispatch(object $event, string $eventName = null) : object;
}

View File

@ -23,7 +23,7 @@
}
],
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"psr\/event-dispatcher": "^1"
},
"suggest": {
@ -37,7 +37,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
},
"thanks": {
"name": "symfony\/contracts",

View File

@ -14,7 +14,7 @@ if (!$_POST) {
foreach ($_SERVER as $k => $v) {
switch ($k) {
default:
if (0 !== \strpos($k, 'HTTP_')) {
if (!\str_starts_with($k, 'HTTP_')) {
continue 2;
}
// no break

View File

@ -160,12 +160,12 @@ abstract class HttpClientTestCase extends \RectorPrefix20220604\PHPUnit\Framewor
try {
$response->getHeaders();
$this->fail(\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface::class . ' expected');
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface) {
}
try {
$response->getContent();
$this->fail(\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface::class . ' expected');
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface) {
}
$this->assertSame(404, $response->getStatusCode());
$this->assertSame(['application/json'], $response->getHeaders(\false)['content-type']);
@ -176,7 +176,7 @@ abstract class HttpClientTestCase extends \RectorPrefix20220604\PHPUnit\Framewor
$this->assertTrue($chunk->isFirst());
}
$this->fail(\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface::class . ' expected');
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface) {
}
}
public function testIgnoreErrors()
@ -192,13 +192,13 @@ abstract class HttpClientTestCase extends \RectorPrefix20220604\PHPUnit\Framewor
try {
$response->getStatusCode();
$this->fail(\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface::class . ' expected');
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface) {
$this->addToAssertionCount(1);
}
try {
$response->getStatusCode();
$this->fail(\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface::class . ' still expected');
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface) {
$this->addToAssertionCount(1);
}
$response = $client->request('GET', 'http://localhost:8057/301/bad-tld');
@ -206,7 +206,7 @@ abstract class HttpClientTestCase extends \RectorPrefix20220604\PHPUnit\Framewor
foreach ($client->stream($response) as $r => $chunk) {
}
$this->fail(\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface::class . ' expected');
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface) {
$this->addToAssertionCount(1);
}
$this->assertSame($response, $r);
@ -239,10 +239,14 @@ abstract class HttpClientTestCase extends \RectorPrefix20220604\PHPUnit\Framewor
$this->assertSame(304, $response->getStatusCode());
$this->assertSame('', $response->getContent(\false));
}
public function testRedirects()
/**
* @testWith [[]]
* [["Content-Length: 7"]]
*/
public function testRedirects(array $headers = [])
{
$client = $this->getHttpClient(__FUNCTION__);
$response = $client->request('POST', 'http://localhost:8057/301', ['auth_basic' => 'foo:bar', 'body' => function () {
$response = $client->request('POST', 'http://localhost:8057/301', ['auth_basic' => 'foo:bar', 'headers' => $headers, 'body' => function () {
(yield 'foo=bar');
}]);
$body = $response->toArray();
@ -297,7 +301,7 @@ abstract class HttpClientTestCase extends \RectorPrefix20220604\PHPUnit\Framewor
try {
$response->getHeaders();
$this->fail(\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface::class . ' expected');
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface) {
}
$this->assertSame(302, $response->getStatusCode());
$this->assertSame(1, $response->getInfo('redirect_count'));
@ -594,7 +598,7 @@ abstract class HttpClientTestCase extends \RectorPrefix20220604\PHPUnit\Framewor
try {
$response->getContent();
$this->fail(\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface::class . ' expected');
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface) {
}
}
$responses = [];
@ -621,7 +625,7 @@ abstract class HttpClientTestCase extends \RectorPrefix20220604\PHPUnit\Framewor
try {
unset($response);
$this->fail(\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface::class . ' expected');
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface) {
}
}
$duration = \microtime(\true) - $start;
@ -781,7 +785,7 @@ abstract class HttpClientTestCase extends \RectorPrefix20220604\PHPUnit\Framewor
$start = \microtime(\true);
try {
$response->getContent();
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface $e) {
} catch (\RectorPrefix20220604\Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface) {
$this->addToAssertionCount(1);
}
$duration = \microtime(\true) - $start;

View File

@ -23,7 +23,7 @@
}
],
"require": {
"php": ">=8.0.2"
"php": ">=8.1"
},
"suggest": {
"symfony\/http-client-implementation": ""
@ -31,12 +31,15 @@
"autoload": {
"psr-4": {
"RectorPrefix20220604\\Symfony\\Contracts\\HttpClient\\": ""
}
},
"exclude-from-classmap": [
"\/Test\/"
]
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
},
"thanks": {
"name": "symfony\/contracts",

View File

@ -16,9 +16,21 @@ use RectorPrefix20220604\Psr\Container\ContainerInterface;
*
* @author Nicolas Grekas <p@tchwork.com>
* @author Mateusz Sip <mateusz.sip@gmail.com>
*
* @template T of mixed
*/
interface ServiceProviderInterface extends \RectorPrefix20220604\Psr\Container\ContainerInterface
{
/**
* {@inheritdoc}
*
* @return mixed
*/
public function get(string $id);
/**
* {@inheritdoc}
*/
public function has(string $id) : bool;
/**
* Returns an associative array of service types keyed by the identifiers provided by the current container.
*

View File

@ -11,6 +11,7 @@
namespace RectorPrefix20220604\Symfony\Contracts\Service;
use RectorPrefix20220604\Psr\Container\ContainerInterface;
use RectorPrefix20220604\Symfony\Contracts\Service\Attribute\Required;
use RectorPrefix20220604\Symfony\Contracts\Service\Attribute\SubscribedService;
/**
* Implementation of ServiceSubscriberInterface that determines subscribed services from

View File

@ -23,7 +23,7 @@
}
],
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"psr\/container": "^2.0"
},
"conflict": {
@ -35,12 +35,15 @@
"autoload": {
"psr-4": {
"RectorPrefix20220604\\Symfony\\Contracts\\Service\\": ""
}
},
"exclude-from-classmap": [
"\/Test\/"
]
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
},
"thanks": {
"name": "symfony\/contracts",

View File

@ -23,7 +23,7 @@
}
],
"require": {
"php": ">=8.0.2"
"php": ">=8.1"
},
"suggest": {
"symfony\/translation-implementation": ""
@ -31,12 +31,15 @@
"autoload": {
"psr-4": {
"RectorPrefix20220604\\Symfony\\Contracts\\Translation\\": ""
}
},
"exclude-from-classmap": [
"\/Test\/"
]
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
},
"thanks": {
"name": "symfony\/contracts",

View File

@ -23,7 +23,7 @@
}
],
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"psr\/cache": "^3.0",
"psr\/container": "^2.0",
"psr\/event-dispatcher": "^1.0"
@ -63,7 +63,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
}
}
}

View File

@ -17,5 +17,20 @@ namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument;
*/
class IteratorArgument implements \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ArgumentInterface
{
use ReferenceSetArgumentTrait;
/**
* @var mixed[]
*/
private $values;
public function __construct(array $values)
{
$this->setValues($values);
}
public function getValues() : array
{
return $this->values;
}
public function setValues(array $values)
{
$this->values = $values;
}
}

View File

@ -10,11 +10,14 @@
*/
namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument;
trigger_deprecation('symfony/dependency-injection', '6.1', '"%s" is deprecated.', \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ReferenceSetArgumentTrait::class);
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference;
/**
* @author Titouan Galopin <galopintitouan@gmail.com>
* @author Nicolas Grekas <p@tchwork.com>
*
* @deprecated since Symfony 6.1
*/
trait ReferenceSetArgumentTrait
{

View File

@ -28,8 +28,8 @@ class RewindableGenerator implements \IteratorAggregate, \Countable
*/
public function __construct(callable $generator, $count)
{
$this->generator = $generator instanceof \Closure ? $generator : \Closure::fromCallable($generator);
$this->count = \is_callable($count) && !$count instanceof \Closure ? \Closure::fromCallable($count) : $count;
$this->generator = \Closure::fromCallable($generator);
$this->count = \is_int($count) ? $count : \Closure::fromCallable($count);
}
public function getIterator() : \Traversable
{
@ -38,7 +38,7 @@ class RewindableGenerator implements \IteratorAggregate, \Countable
}
public function count() : int
{
if (\is_callable($count = $this->count)) {
if (!\is_int($count = $this->count)) {
$this->count = $count();
}
return $this->count;

View File

@ -11,7 +11,6 @@
namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference;
/**
* Represents a service wrapped in a memoizing closure.
*
@ -23,9 +22,12 @@ class ServiceClosureArgument implements \RectorPrefix20220604\Symfony\Component\
* @var mixed[]
*/
private $values;
public function __construct(\RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference $reference)
/**
* @param mixed $value
*/
public function __construct($value)
{
$this->values = [$reference];
$this->values = [$value];
}
/**
* {@inheritdoc}
@ -39,8 +41,8 @@ class ServiceClosureArgument implements \RectorPrefix20220604\Symfony\Component\
*/
public function setValues(array $values)
{
if ([0] !== \array_keys($values) || !($values[0] instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference || null === $values[0])) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException('A ServiceClosureArgument must hold one and only one Reference.');
if ([0] !== \array_keys($values)) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException('A ServiceClosureArgument must hold one and only one value.');
}
$this->values = $values;
}

View File

@ -43,15 +43,22 @@ class ServiceLocator extends \RectorPrefix20220604\Symfony\Component\DependencyI
*/
public function get(string $id)
{
return isset($this->serviceMap[$id]) ? ($this->factory)(...$this->serviceMap[$id]) : parent::get($id);
switch (\count($this->serviceMap[$id] ?? [])) {
case 0:
return parent::get($id);
case 1:
return $this->serviceMap[$id][0];
default:
return ($this->factory)(...$this->serviceMap[$id]);
}
}
/**
* {@inheritdoc}
*/
public function getProvidedServices() : array
{
return $this->serviceTypes ?? ($this->serviceTypes = \array_map(function () {
return $this->serviceTypes = $this->serviceTypes ?? \array_map(function () {
return '?';
}, $this->serviceMap));
}, $this->serviceMap);
}
}

View File

@ -10,7 +10,6 @@
*/
namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference;
/**
* Represents a closure acting as a service locator.
*
@ -18,22 +17,35 @@ use RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference;
*/
class ServiceLocatorArgument implements \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ArgumentInterface
{
use ReferenceSetArgumentTrait;
private $taggedIteratorArgument = null;
/**
* @param Reference[]|TaggedIteratorArgument $values
* @var mixed[]
*/
private $values;
/**
* @var \Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument|null
*/
private $taggedIteratorArgument;
/**
* @param mixed[]|\Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument $values
*/
public function __construct($values = [])
{
if ($values instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument) {
$this->taggedIteratorArgument = $values;
$this->values = [];
} else {
$this->setValues($values);
$values = [];
}
$this->setValues($values);
}
public function getTaggedIteratorArgument() : ?\RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument
{
return $this->taggedIteratorArgument;
}
public function getValues() : array
{
return $this->values;
}
public function setValues(array $values)
{
$this->values = $values;
}
}

View File

@ -37,14 +37,19 @@ class TaggedIteratorArgument extends \RectorPrefix20220604\Symfony\Component\Dep
* @var bool
*/
private $needsIndexes;
/**
* @var mixed[]
*/
private $exclude;
/**
* @param string $tag The name of the tag identifying the target services
* @param string|null $indexAttribute The name of the attribute that defines the key referencing each service in the tagged collection
* @param string|null $defaultIndexMethod The static method that should be called to get each service's key when their tag doesn't define the previous attribute
* @param bool $needsIndexes Whether indexes are required and should be generated when computing the map
* @param string|null $defaultPriorityMethod The static method that should be called to get each service's priority when their tag doesn't define the "priority" attribute
* @param array $exclude Services to exclude from the iterator
*/
public function __construct(string $tag, string $indexAttribute = null, string $defaultIndexMethod = null, bool $needsIndexes = \false, string $defaultPriorityMethod = null)
public function __construct(string $tag, string $indexAttribute = null, string $defaultIndexMethod = null, bool $needsIndexes = \false, string $defaultPriorityMethod = null, array $exclude = [])
{
parent::__construct([]);
if (null === $indexAttribute && $needsIndexes) {
@ -55,6 +60,7 @@ class TaggedIteratorArgument extends \RectorPrefix20220604\Symfony\Component\Dep
$this->defaultIndexMethod = $defaultIndexMethod ?: ($indexAttribute ? 'getDefault' . \str_replace(' ', '', \ucwords(\preg_replace('/[^a-zA-Z0-9\\x7f-\\xff]++/', ' ', $indexAttribute))) . 'Name' : null);
$this->needsIndexes = $needsIndexes;
$this->defaultPriorityMethod = $defaultPriorityMethod ?: ($indexAttribute ? 'getDefault' . \str_replace(' ', '', \ucwords(\preg_replace('/[^a-zA-Z0-9\\x7f-\\xff]++/', ' ', $indexAttribute))) . 'Priority' : null);
$this->exclude = $exclude;
}
public function getTag()
{
@ -76,4 +82,8 @@ class TaggedIteratorArgument extends \RectorPrefix20220604\Symfony\Component\Dep
{
return $this->defaultPriorityMethod;
}
public function getExclude() : array
{
return $this->exclude;
}
}

View File

@ -0,0 +1,35 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerInterface;
#[\Attribute(\Attribute::TARGET_CLASS)]
class AsDecorator
{
/**
* @var string
*/
public $decorates;
/**
* @var int
*/
public $priority = 0;
/**
* @var int
*/
public $onInvalid = \RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
public function __construct(string $decorates, int $priority = 0, int $onInvalid = \RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
{
$this->decorates = $decorates;
$this->priority = $priority;
$this->onInvalid = $onInvalid;
}
}

View File

@ -0,0 +1,69 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\LogicException;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference;
use RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression;
/**
* Attribute to tell a parameter how to be autowired.
*
* @author Kevin Bond <kevinbond@gmail.com>
*/
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class Autowire
{
/**
* @readonly
* @var string|\Symfony\Component\ExpressionLanguage\Expression|\Symfony\Component\DependencyInjection\Reference
*/
public $value;
/**
* Use only ONE of the following.
*
* @param string|null $value Parameter value (ie "%kernel.project_dir%/some/path")
* @param string|null $service Service ID (ie "some.service")
* @param string|null $expression Expression (ie 'service("some.service").someMethod()')
*/
public function __construct(?string $value = null, ?string $service = null, ?string $expression = null)
{
if (!($service xor $expression xor null !== $value)) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\LogicException('#[Autowire] attribute must declare exactly one of $service, $expression, or $value.');
}
if (null !== $value && \strncmp($value, '@', \strlen('@')) === 0) {
switch (\true) {
case \strncmp($value, '@@', \strlen('@@')) === 0:
$value = \substr($value, 1);
break;
case \strncmp($value, '@=', \strlen('@=')) === 0:
$expression = \substr($value, 2);
break;
default:
$service = \substr($value, 1);
break;
}
}
switch (\true) {
case null !== $service:
$this->value = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference($service);
break;
case null !== $expression:
if (!\class_exists(\RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression::class)) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
}
$this->value = new \RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression($expression);
break;
case null !== $value:
$this->value = $value;
break;
}
}
}

View File

@ -0,0 +1,16 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute;
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class MapDecorated
{
}

View File

@ -29,11 +29,19 @@ class TaggedIterator
* @var string|null
*/
public $defaultPriorityMethod;
public function __construct(string $tag, ?string $indexAttribute = null, ?string $defaultIndexMethod = null, ?string $defaultPriorityMethod = null)
/**
* @var string|mixed[]
*/
public $exclude = [];
/**
* @param string|mixed[] $exclude
*/
public function __construct(string $tag, ?string $indexAttribute = null, ?string $defaultIndexMethod = null, ?string $defaultPriorityMethod = null, $exclude = [])
{
$this->tag = $tag;
$this->indexAttribute = $indexAttribute;
$this->defaultIndexMethod = $defaultIndexMethod;
$this->defaultPriorityMethod = $defaultPriorityMethod;
$this->exclude = $exclude;
}
}

View File

@ -29,11 +29,19 @@ class TaggedLocator
* @var string|null
*/
public $defaultPriorityMethod;
public function __construct(string $tag, ?string $indexAttribute = null, ?string $defaultIndexMethod = null, ?string $defaultPriorityMethod = null)
/**
* @var string|mixed[]
*/
public $exclude = [];
/**
* @param string|mixed[] $exclude
*/
public function __construct(string $tag, ?string $indexAttribute = null, ?string $defaultIndexMethod = null, ?string $defaultPriorityMethod = null, $exclude = [])
{
$this->tag = $tag;
$this->indexAttribute = $indexAttribute;
$this->defaultIndexMethod = $defaultIndexMethod;
$this->defaultPriorityMethod = $defaultPriorityMethod;
$this->exclude = $exclude;
}
}

View File

@ -1,6 +1,20 @@
CHANGELOG
=========
6.1
---
* Add `#[MapDecorated]` attribute telling to which parameter the decorated service should be mapped in a decorator
* Add `#[AsDecorator]` attribute to make a service decorates another
* Add `$exclude` to `TaggedIterator` and `TaggedLocator` attributes
* Add `$exclude` to `tagged_iterator` and `tagged_locator` configurator
* Add an `env` function to the expression language provider
* Add an `Autowire` attribute to tell a parameter how to be autowired
* Allow using expressions as service factories
* Add argument type `closure` to help passing closures to services
* Deprecate `ReferenceSetArgumentTrait`
* Add `AbstractExtension` class for DI configuration/definition on a single file
6.0
---

View File

@ -33,6 +33,9 @@ abstract class AbstractRecursivePass implements \RectorPrefix20220604\Symfony\Co
* @var bool
*/
private $processExpressions = \false;
/**
* @var \Symfony\Component\DependencyInjection\ExpressionLanguage
*/
private $expressionLanguage;
/**
* @var bool
@ -82,14 +85,23 @@ abstract class AbstractRecursivePass implements \RectorPrefix20220604\Symfony\Co
} elseif ($value instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ArgumentInterface) {
$value->setValues($this->processValue($value->getValues()));
} elseif ($value instanceof \RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression && $this->processExpressions) {
$this->getExpressionLanguage()->compile((string) $value, ['this' => 'container']);
$this->getExpressionLanguage()->compile((string) $value, ['this' => 'container', 'args' => 'args']);
} elseif ($value instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Definition) {
$value->setArguments($this->processValue($value->getArguments()));
$value->setProperties($this->processValue($value->getProperties()));
$value->setMethodCalls($this->processValue($value->getMethodCalls()));
$changes = $value->getChanges();
if (isset($changes['factory'])) {
$value->setFactory($this->processValue($value->getFactory()));
if (\is_string($factory = $value->getFactory()) && \strncmp($factory, '@=', \strlen('@=')) === 0) {
if (!\class_exists(\RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression::class)) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\LogicException('Expressions cannot be used in service factories without the ExpressionLanguage component. Try running "composer require symfony/expression-language".');
}
$factory = new \RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression(\substr($factory, 2));
}
if (($factory = $this->processValue($factory)) instanceof \RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression) {
$factory = '@=' . $factory;
}
$value->setFactory($factory);
}
if (isset($changes['configurator'])) {
$value->setConfigurator($this->processValue($value->getConfigurator()));
@ -106,6 +118,10 @@ abstract class AbstractRecursivePass implements \RectorPrefix20220604\Symfony\Co
return null;
}
if (\is_string($factory = $definition->getFactory())) {
if (\strncmp($factory, '@=', \strlen('@=')) === 0) {
return new \ReflectionFunction(static function (...$args) {
});
}
if (!\function_exists($factory)) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\RuntimeException(\sprintf('Invalid service "%s": function "%s" does not exist.', $this->currentId, $factory));
}

View File

@ -15,7 +15,9 @@ use RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\Iterator
use RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerBuilder;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerInterface;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Definition;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\LogicException;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference;
use RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression;
/**
* Run this pass before passes that need to know more about the relation of
* your services.
@ -28,8 +30,14 @@ use RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference;
*/
class AnalyzeServiceReferencesPass extends \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass
{
/**
* @var \Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraph
*/
private $graph;
private $currentDefinition = null;
/**
* @var \Symfony\Component\DependencyInjection\Definition|null
*/
private $currentDefinition;
/**
* @var bool
*/
@ -107,9 +115,9 @@ class AnalyzeServiceReferencesPass extends \RectorPrefix20220604\Symfony\Compone
if ($value instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference) {
$targetId = $this->getDefinitionId((string) $value);
$targetDefinition = null !== $targetId ? $this->container->getDefinition($targetId) : null;
$this->graph->connect($this->currentId, $this->currentDefinition, $targetId, $targetDefinition, $value, $this->lazy || $this->hasProxyDumper && $targetDefinition && $targetDefinition->isLazy(), \RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $value->getInvalidBehavior(), $this->byConstructor);
$this->graph->connect($this->currentId, $this->currentDefinition, $targetId, $targetDefinition, $value, $this->lazy || $this->hasProxyDumper && (($targetDefinition2 = $targetDefinition) ? $targetDefinition2->isLazy() : null), \RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $value->getInvalidBehavior(), $this->byConstructor);
if ($inExpression) {
$this->graph->connect('.internal.reference_in_expression', null, $targetId, $targetDefinition, $value, $this->lazy || $targetDefinition && $targetDefinition->isLazy(), \true);
$this->graph->connect('.internal.reference_in_expression', null, $targetId, $targetDefinition, $value, $this->lazy || (($targetDefinition2 = $targetDefinition) ? $targetDefinition2->isLazy() : null), \true);
}
return $value;
}
@ -129,7 +137,13 @@ class AnalyzeServiceReferencesPass extends \RectorPrefix20220604\Symfony\Compone
$this->byConstructor = $isRoot || $byConstructor;
$byFactory = $this->byFactory;
$this->byFactory = \true;
$this->processValue($value->getFactory());
if (\is_string($factory = $value->getFactory()) && \strncmp($factory, '@=', \strlen('@=')) === 0) {
if (!\class_exists(\RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression::class)) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\LogicException('Expressions cannot be used in service factories without the ExpressionLanguage component. Try running "composer require symfony/expression-language".');
}
$factory = new \RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression(\substr($factory, 2));
}
$this->processValue($factory);
$this->byFactory = $byFactory;
$this->processValue($value->getArguments());
$properties = $value->getProperties();

View File

@ -49,7 +49,7 @@ final class AttributeAutoconfigurationPass extends \RectorPrefix20220604\Symfony
}
try {
$attributeReflector = new \ReflectionClass($attributeName);
} catch (\ReflectionException $e) {
} catch (\ReflectionException $exception) {
continue;
}
$targets = (\method_exists($attributeReflector, 'getAttributes') ? $attributeReflector->getAttributes(\Attribute::class) : [])[0] ?? 0;
@ -89,7 +89,7 @@ final class AttributeAutoconfigurationPass extends \RectorPrefix20220604\Symfony
if ($this->parameterAttributeConfigurators) {
try {
$constructorReflector = $this->getConstructor($value, \false);
} catch (\RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\RuntimeException $e) {
} catch (\RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\RuntimeException $exception) {
$constructorReflector = null;
}
if ($constructorReflector) {

View File

@ -0,0 +1,44 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\AsDecorator;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerBuilder;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Definition;
/**
* Reads #[AsDecorator] attributes on definitions that are autowired
* and don't have the "container.ignore_attributes" tag.
*/
final class AutowireAsDecoratorPass implements \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(\RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerBuilder $container)
{
foreach ($container->getDefinitions() as $definition) {
if ($this->accept($definition) && ($reflectionClass = $container->getReflectionClass($definition->getClass(), \false))) {
$this->processClass($definition, $reflectionClass);
}
}
}
private function accept(\RectorPrefix20220604\Symfony\Component\DependencyInjection\Definition $definition) : bool
{
return !$definition->hasTag('container.ignore_attributes') && $definition->isAutowired();
}
private function processClass(\RectorPrefix20220604\Symfony\Component\DependencyInjection\Definition $definition, \ReflectionClass $reflectionClass)
{
foreach (\method_exists($reflectionClass, 'getAttributes') ? $reflectionClass->getAttributes(\RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\AsDecorator::class, \ReflectionAttribute::IS_INSTANCEOF) : [] as $attribute) {
$attribute = $attribute->newInstance();
$definition->setDecoratedService($attribute->decorates, null, $attribute->priority, $attribute->onInvalid);
}
}
}

View File

@ -13,14 +13,18 @@ namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler;
use RectorPrefix20220604\Symfony\Component\Config\Resource\ClassExistenceResource;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\Autowire;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\MapDecorated;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\TaggedLocator;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\Target;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerBuilder;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerInterface;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Definition;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\AutowiringFailedException;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\RuntimeException;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\LazyProxy\ProxyHelper;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\TypedReference;
/**
* Inspects existing service definitions and wires the autowired ones using the type hints of their classes.
@ -222,7 +226,7 @@ class AutowirePass extends \RectorPrefix20220604\Symfony\Component\DependencyInj
if ($namedArguments || !$value instanceof $this->defaultArgument) {
continue;
}
if (\PHP_VERSION_ID >= 80100 && (\is_array($value->value) ? $value->value : \is_object($value->value))) {
if (\is_array($value->value) ? $value->value : \is_object($value->value)) {
unset($arguments[$j]);
$namedArguments = $value->names;
} else {
@ -257,12 +261,26 @@ class AutowirePass extends \RectorPrefix20220604\Symfony\Component\DependencyInj
foreach (\method_exists($parameter, 'getAttributes') ? $parameter->getAttributes() : [] as $attribute) {
if (\RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\TaggedIterator::class === $attribute->getName()) {
$attribute = $attribute->newInstance();
$arguments[$index] = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument($attribute->tag, $attribute->indexAttribute, $attribute->defaultIndexMethod, \false, $attribute->defaultPriorityMethod);
$arguments[$index] = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument($attribute->tag, $attribute->indexAttribute, $attribute->defaultIndexMethod, \false, $attribute->defaultPriorityMethod, (array) $attribute->exclude);
break;
}
if (\RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\TaggedLocator::class === $attribute->getName()) {
$attribute = $attribute->newInstance();
$arguments[$index] = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument(new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument($attribute->tag, $attribute->indexAttribute, $attribute->defaultIndexMethod, \true, $attribute->defaultPriorityMethod));
$arguments[$index] = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument(new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument($attribute->tag, $attribute->indexAttribute, $attribute->defaultIndexMethod, \true, $attribute->defaultPriorityMethod, (array) $attribute->exclude));
break;
}
if (\RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\Autowire::class === $attribute->getName()) {
$value = $attribute->newInstance()->value;
$value = $this->container->getParameterBag()->resolveValue($value);
if ($value instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference && $parameter->allowsNull()) {
$value = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference($value, \RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerInterface::NULL_ON_INVALID_REFERENCE);
}
$arguments[$index] = $value;
break;
}
if (\RectorPrefix20220604\Symfony\Component\DependencyInjection\Attribute\MapDecorated::class === $attribute->getName()) {
$definition = $this->container->getDefinition($this->currentId);
$arguments[$index] = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference($definition->innerServiceId ?? $this->currentId . '.inner', $definition->decorationOnInvalid ?? \RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerInterface::NULL_ON_INVALID_REFERENCE);
break;
}
}

View File

@ -67,7 +67,7 @@ class AutowireRequiredMethodsPass extends \RectorPrefix20220604\Symfony\Componen
}
try {
$r = $r->getPrototype();
} catch (\ReflectionException $e) {
} catch (\ReflectionException $exception) {
break;
// method has no prototype
}

View File

@ -89,7 +89,7 @@ class CheckExceptionOnInvalidReferenceBehaviorPass extends \RectorPrefix20220604
continue;
}
$lev = \levenshtein($id, $knownId);
if ($lev <= \strlen($id) / 3 || \false !== \strpos($knownId, $id)) {
if ($lev <= \strlen($id) / 3 || \strpos($knownId, $id) !== \false) {
$alternatives[] = $knownId;
}
}

View File

@ -49,6 +49,9 @@ final class CheckTypeDeclarationsPass extends \RectorPrefix20220604\Symfony\Comp
* @var mixed[]
*/
private $skippedIds;
/**
* @var \Symfony\Component\DependencyInjection\ExpressionLanguage
*/
private $expressionLanguage;
/**
* @param bool $autoload Whether services who's class in not loaded should be checked or not.
@ -183,7 +186,7 @@ final class CheckTypeDeclarationsPass extends \RectorPrefix20220604\Symfony\Comp
} elseif ($value instanceof \RectorPrefix20220604\Symfony\Component\ExpressionLanguage\Expression) {
try {
$value = $this->getExpressionLanguage()->evaluate($value, ['container' => $this->container]);
} catch (\Exception $e) {
} catch (\Exception $exception) {
// If a service from the expression cannot be fetched from the container, we skip the validation.
return;
}
@ -197,7 +200,7 @@ final class CheckTypeDeclarationsPass extends \RectorPrefix20220604\Symfony\Comp
if ('' === \preg_replace('/' . $envPlaceholderUniquePrefix . '_\\w+_[a-f0-9]{32}/U', '', $value, -1, $c) && 1 === $c) {
try {
$value = $this->container->resolveEnvPlaceholders($value, \true);
} catch (\Exception $e) {
} catch (\Exception $exception) {
// If an env placeholder cannot be resolved, we skip the validation.
return;
}

View File

@ -19,11 +19,17 @@ use RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\EnvPara
*/
class Compiler
{
/**
* @var \Symfony\Component\DependencyInjection\Compiler\PassConfig
*/
private $passConfig;
/**
* @var mixed[]
*/
private $log = [];
/**
* @var \Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraph
*/
private $serviceReferenceGraph;
public function __construct()
{
@ -72,7 +78,6 @@ class Compiler
$msg = $prev->getMessage();
if ($msg !== ($resolvedMsg = $container->resolveEnvPlaceholders($msg, null, $usedEnvs))) {
$r = new \ReflectionProperty($prev, 'message');
$r->setAccessible(\true);
$r->setValue($prev, $resolvedMsg);
}
} while ($prev = $prev->getPrevious());

View File

@ -71,7 +71,7 @@ class DecoratorServicePass extends \RectorPrefix20220604\Symfony\Component\Depen
} else {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException($inner, $id);
}
if ($decoratedDefinition && $decoratedDefinition->isSynthetic()) {
if (($decoratedDefinition2 = $decoratedDefinition) ? $decoratedDefinition2->isSynthetic() : null) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException(\sprintf('A synthetic service cannot be decorated: service "%s" cannot decorate "%s".', $id, $inner));
}
if (isset($decoratingDefinitions[$inner])) {

View File

@ -22,6 +22,9 @@ use RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference;
*/
class InlineServiceDefinitionsPass extends \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass
{
/**
* @var \Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass|null
*/
private $analyzingPass;
/**
* @var mixed[]
@ -43,7 +46,10 @@ class InlineServiceDefinitionsPass extends \RectorPrefix20220604\Symfony\Compone
* @var mixed[]
*/
private $notInlinableIds = [];
private $graph = null;
/**
* @var \Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraph|null
*/
private $graph;
public function __construct(\RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass $analyzingPass = null)
{
$this->analyzingPass = $analyzingPass;

View File

@ -25,6 +25,9 @@ class PassConfig
public const TYPE_BEFORE_REMOVING = 'beforeRemoving';
public const TYPE_OPTIMIZE = 'optimization';
public const TYPE_REMOVE = 'removing';
/**
* @var \Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass
*/
private $mergePass;
/**
* @var mixed[]
@ -49,7 +52,7 @@ class PassConfig
public function __construct()
{
$this->mergePass = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass();
$this->beforeOptimizationPasses = [100 => [new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveClassPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\RegisterAutoconfigureAttributesPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AttributeAutoconfigurationPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\RegisterEnvVarProcessorsPass()], -1000 => [new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ExtensionCompilerPass()]];
$this->beforeOptimizationPasses = [100 => [new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveClassPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\RegisterAutoconfigureAttributesPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AutowireAsDecoratorPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AttributeAutoconfigurationPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\RegisterEnvVarProcessorsPass()], -1000 => [new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ExtensionCompilerPass()]];
$this->optimizationPasses = [[new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AutoAliasServicePass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveDecoratorStackPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\RegisterServiceSubscribersPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass(\false, \false), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveFactoryClassPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveNamedArgumentsPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AutowireRequiredMethodsPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AutowireRequiredPropertiesPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveBindingsPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\DecoratorServicePass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\CheckDefinitionValidityPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AutowirePass(\false), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveTaggedIteratorArgumentPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveServiceSubscribersPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveInvalidReferencesPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass(\true), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\CheckArgumentsValidityPass(\false)]];
$this->removingPasses = [[new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass(new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass()), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass()]];
$this->afterRemovingPasses = [[new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveHotPathPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\ResolveNoPreloadPass(), new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AliasDeprecatedPublicServicesPass()]];

View File

@ -38,17 +38,22 @@ trait PriorityTaggedServiceTrait
*/
private function findAndSortTaggedServices($tagName, \RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerBuilder $container) : array
{
$exclude = [];
$indexAttribute = $defaultIndexMethod = $needsIndexes = $defaultPriorityMethod = null;
if ($tagName instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument) {
$indexAttribute = $tagName->getIndexAttribute();
$defaultIndexMethod = $tagName->getDefaultIndexMethod();
$needsIndexes = $tagName->needsIndexes();
$defaultPriorityMethod = $tagName->getDefaultPriorityMethod() ?? 'getDefaultPriority';
$exclude = $tagName->getExclude();
$tagName = $tagName->getTag();
}
$i = 0;
$services = [];
foreach ($container->findTaggedServiceIds($tagName, \true) as $serviceId => $attributes) {
if (\in_array($serviceId, $exclude, \true)) {
continue;
}
$defaultPriority = null;
$defaultIndex = null;
$definition = $container->getDefinition($serviceId);
@ -62,7 +67,7 @@ trait PriorityTaggedServiceTrait
} elseif (null === $defaultPriority && $defaultPriorityMethod && $class) {
$defaultPriority = \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceUtil::getDefault($container, $serviceId, $class, $defaultPriorityMethod, $tagName, 'priority', $checkTaggedItem);
}
$priority = $priority ?? $defaultPriority ?? ($defaultPriority = 0);
$priority = $priority ?? ($defaultPriority = $defaultPriority ?? 0);
if (null === $indexAttribute && !$defaultIndexMethod && !$needsIndexes) {
$services[] = [$priority, ++$i, null, $serviceId, null];
continue 2;
@ -72,7 +77,7 @@ trait PriorityTaggedServiceTrait
} elseif (null === $defaultIndex && $defaultPriorityMethod && $class) {
$defaultIndex = \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceUtil::getDefault($container, $serviceId, $class, $defaultIndexMethod ?? 'getDefaultName', $tagName, $indexAttribute, $checkTaggedItem);
}
$index = $index ?? $defaultIndex ?? ($defaultIndex = $serviceId);
$index = $index ?? ($defaultIndex = $defaultIndex ?? $serviceId);
$services[] = [$priority, ++$i, $index, $serviceId, $class];
}
}

View File

@ -50,7 +50,6 @@ final class RegisterAutoconfigureAttributesPass implements \RectorPrefix20220604
return (self::$registerForAutoconfiguration)($container, $class, $attribute);
}
$parseDefinitions = new \ReflectionMethod(\RectorPrefix20220604\Symfony\Component\DependencyInjection\Loader\YamlFileLoader::class, 'parseDefinitions');
$parseDefinitions->setAccessible(\true);
$yamlLoader = $parseDefinitions->getDeclaringClass()->newInstanceWithoutConstructor();
self::$registerForAutoconfiguration = static function (\RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerBuilder $container, \ReflectionClass $class, \ReflectionAttribute $attribute) use($parseDefinitions, $yamlLoader) {
$attribute = (array) $attribute->newInstance();

View File

@ -65,7 +65,6 @@ class ResolveChildDefinitionsPass extends \RectorPrefix20220604\Symfony\Componen
throw $e;
} catch (\RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\ExceptionInterface $e) {
$r = new \ReflectionProperty($e, 'message');
$r->setAccessible(\true);
$r->setValue($e, \sprintf('Service "%s": %s', $this->currentId, $e->getMessage()));
throw $e;
}

View File

@ -62,7 +62,7 @@ class ResolveInstanceofConditionalsPass implements \RectorPrefix20220604\Symfony
$reflectionClass = null;
$parent = $definition instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\ChildDefinition ? $definition->getParent() : null;
foreach ($conditionals as $interface => $instanceofDefs) {
if ($interface !== $class && !($reflectionClass ?? ($reflectionClass = $container->getReflectionClass($class, \false) ?: \false))) {
if ($interface !== $class && !($reflectionClass = $reflectionClass ?? ($container->getReflectionClass($class, \false) ?: \false))) {
continue;
}
if ($interface !== $class && !\is_subclass_of($class, $interface)) {

View File

@ -27,7 +27,13 @@ use RectorPrefix20220604\Symfony\Component\DependencyInjection\TypedReference;
*/
class ResolveInvalidReferencesPass implements \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface
{
/**
* @var \Symfony\Component\DependencyInjection\ContainerBuilder
*/
private $container;
/**
* @var \Symfony\Component\DependencyInjection\Exception\RuntimeException
*/
private $signalingException;
/**
* @var string

View File

@ -13,6 +13,7 @@ namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerBuilder;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Definition;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
use RectorPrefix20220604\Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
/**
* Resolves all parameter placeholders "%somevalue%" to their real values.
*
@ -20,6 +21,9 @@ use RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\Paramet
*/
class ResolveParameterPlaceHoldersPass extends \RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass
{
/**
* @var \Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface
*/
private $bag;
/**
* @var bool

View File

@ -57,12 +57,11 @@ final class ServiceLocatorTagPass extends \RectorPrefix20220604\Symfony\Componen
if ($v instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument) {
continue;
}
if (!$v instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException(\sprintf('Invalid definition for service "%s": an array of references is expected as first argument when the "container.service_locator" tag is set, "%s" found for key "%s".', $this->currentId, \get_debug_type($v), $k));
}
if ($i === $k) {
unset($services[$k]);
$k = (string) $v;
if ($v instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference) {
unset($services[$k]);
$k = (string) $v;
}
++$i;
} elseif (\is_int($k)) {
$i = null;
@ -81,18 +80,12 @@ final class ServiceLocatorTagPass extends \RectorPrefix20220604\Symfony\Componen
$this->container->setDefinition($id, $value->setPublic(\false));
return new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference($id);
}
/**
* @param Reference[] $refMap
*/
public static function register(\RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerBuilder $container, array $refMap, string $callerId = null) : \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference
public static function register(\RectorPrefix20220604\Symfony\Component\DependencyInjection\ContainerBuilder $container, array $map, string $callerId = null) : \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference
{
foreach ($refMap as $id => $ref) {
if (!$ref instanceof \RectorPrefix20220604\Symfony\Component\DependencyInjection\Reference) {
throw new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException(\sprintf('Invalid service locator definition: only services can be referenced, "%s" found for key "%s". Inject parameter values using constructors instead.', \get_debug_type($ref), $id));
}
$refMap[$id] = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument($ref);
foreach ($map as $k => $v) {
$map[$k] = new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument($v);
}
$locator = (new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Definition(\RectorPrefix20220604\Symfony\Component\DependencyInjection\ServiceLocator::class))->addArgument($refMap)->addTag('container.service_locator');
$locator = (new \RectorPrefix20220604\Symfony\Component\DependencyInjection\Definition(\RectorPrefix20220604\Symfony\Component\DependencyInjection\ServiceLocator::class))->addArgument($map)->addTag('container.service_locator');
if (null !== $callerId && $container->hasDefinition($callerId)) {
$locator->setBindings($container->getDefinition($callerId)->getBindings());
}

View File

@ -19,7 +19,13 @@ namespace RectorPrefix20220604\Symfony\Component\DependencyInjection\Compiler;
*/
class ServiceReferenceGraphEdge
{
/**
* @var \Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode
*/
private $sourceNode;
/**
* @var \Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode
*/
private $destNode;
/**
* @var mixed

Some files were not shown because too many files have changed in this diff Show More