mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 4e02f78d6b8352fd24afc670f285453468742c3f
4e02f78d6b
temporarily exclude autowire, to skip throws
This commit is contained in:
parent
0bd97bc048
commit
57b6546504
|
@ -45,7 +45,7 @@ final class RegexMatcher
|
|||
return null;
|
||||
}
|
||||
$delimiter = $pattern[0];
|
||||
$delimiter = $delimiter === '(' ? ')' : ($delimiter === '<' ? '>' : $delimiter);
|
||||
$delimiter = $delimiter === '(' ? ')' : ($delimiter === '{' ? '}' : ($delimiter === '[' ? ']' : ($delimiter === '<' ? '>' : $delimiter)));
|
||||
/** @var string $modifiers */
|
||||
$modifiers = $this->resolveModifiers((string) Strings::after($pattern, $delimiter, -1));
|
||||
if (\strpos($modifiers, 'e') === \false) {
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '7f7ebef0b14bb356151c5a8ddffd30a0bcc6f9fd';
|
||||
public const PACKAGE_VERSION = '4e02f78d6b8352fd24afc670f285453468742c3f';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-12 01:24:23';
|
||||
public const RELEASE_DATE = '2023-06-12 01:38:52';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -15,7 +15,7 @@ final class RectorKernel
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
private const CACHE_KEY = 'v106';
|
||||
private const CACHE_KEY = 'v107';
|
||||
/**
|
||||
* @var \Symfony\Component\DependencyInjection\ContainerInterface|null
|
||||
*/
|
||||
|
|
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit48ef3f86093389b1bb0ca767ab77a764::getLoader();
|
||||
return ComposerAutoloaderInitaa7edf409cf12ac16f10fd0271a45f2c::getLoader();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit48ef3f86093389b1bb0ca767ab77a764
|
||||
class ComposerAutoloaderInitaa7edf409cf12ac16f10fd0271a45f2c
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInit48ef3f86093389b1bb0ca767ab77a764
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit48ef3f86093389b1bb0ca767ab77a764', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitaa7edf409cf12ac16f10fd0271a45f2c', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit48ef3f86093389b1bb0ca767ab77a764', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitaa7edf409cf12ac16f10fd0271a45f2c', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit48ef3f86093389b1bb0ca767ab77a764::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitaa7edf409cf12ac16f10fd0271a45f2c::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit48ef3f86093389b1bb0ca767ab77a764::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitaa7edf409cf12ac16f10fd0271a45f2c::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit48ef3f86093389b1bb0ca767ab77a764
|
||||
class ComposerStaticInitaa7edf409cf12ac16f10fd0271a45f2c
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
|
@ -3124,9 +3124,9 @@ class ComposerStaticInit48ef3f86093389b1bb0ca767ab77a764
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit48ef3f86093389b1bb0ca767ab77a764::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit48ef3f86093389b1bb0ca767ab77a764::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit48ef3f86093389b1bb0ca767ab77a764::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitaa7edf409cf12ac16f10fd0271a45f2c::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitaa7edf409cf12ac16f10fd0271a45f2c::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitaa7edf409cf12ac16f10fd0271a45f2c::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
|
@ -1986,12 +1986,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
|
||||
"reference": "ead32cf6bcf78048eeac0d472e17e05f54b85b32"
|
||||
"reference": "5d564602660473dc188850f1f7e5f84ec601c2c1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/ead32cf6bcf78048eeac0d472e17e05f54b85b32",
|
||||
"reference": "ead32cf6bcf78048eeac0d472e17e05f54b85b32",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/5d564602660473dc188850f1f7e5f84ec601c2c1",
|
||||
"reference": "5d564602660473dc188850f1f7e5f84ec601c2c1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -2015,7 +2015,7 @@
|
|||
"tomasvotruba\/type-coverage": "^0.2",
|
||||
"tomasvotruba\/unused-public": "^0.1"
|
||||
},
|
||||
"time": "2023-06-11T23:17:53+00:00",
|
||||
"time": "2023-06-11T23:30:01+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
|||
*/
|
||||
final class GeneratedConfig
|
||||
{
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ca01799'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ead32cf'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main a842ca4'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 65e2e8d'));
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ca01799'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 5d56460'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main a842ca4'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 65e2e8d'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -89,6 +89,6 @@ CODE_SAMPLE
|
|||
}
|
||||
private function getLeftSubNode(Node $node) : ?Node
|
||||
{
|
||||
return \true === $node instanceof ArrayDimFetch ? $node->var : (\true === $node instanceof FuncCall ? $node->name : null);
|
||||
return \true === $node instanceof ArrayDimFetch ? $node->var : (\true === $node instanceof PropertyFetch ? $node->var : (\true === $node instanceof MethodCall ? $node->var : (\true === $node instanceof StaticPropertyFetch ? $node->class : (\true === $node instanceof StaticCall ? $node->class : (\true === $node instanceof FuncCall ? $node->name : null)))));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,17 +80,13 @@ CODE_SAMPLE
|
|||
if ($defaultExpr instanceof Throw_ && $this->phpVersionProvider->provide() < PhpVersion::PHP_80) {
|
||||
$defaultExpr = new ConstFetch(new Name('null'));
|
||||
}
|
||||
$firstTernary = null;
|
||||
$currentTernary = null;
|
||||
foreach ($reversedMatchArms as $matchArm) {
|
||||
if ($matchArm->conds === null) {
|
||||
continue;
|
||||
}
|
||||
$cond = $this->createCond($matchArm->conds, $node);
|
||||
$currentTernary = new Ternary($cond, $matchArm->body, $firstTernary ?: $defaultExpr);
|
||||
if ($firstTernary === null) {
|
||||
$firstTernary = $currentTernary;
|
||||
}
|
||||
$currentTernary = new Ternary($cond, $matchArm->body, $currentTernary ?: $defaultExpr);
|
||||
}
|
||||
return $currentTernary;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public function NAME(): string
|
|||
throw new \LogicException('The node was expected to be an ArrayNode. This Configuration includes an edge case not supported yet.');
|
||||
}
|
||||
foreach ($node->getChildren() as $child) {
|
||||
\true === $child instanceof ScalarNode ? $this->handleScalarNode($child, $class) : (\true === $child instanceof ArrayNode ? $this->handleArrayNode($child, $class, $namespace) : null);
|
||||
\true === $child instanceof ScalarNode ? $this->handleScalarNode($child, $class) : (\true === $child instanceof PrototypedArrayNode ? $this->handlePrototypedArrayNode($child, $class, $namespace) : (\true === $child instanceof VariableNode ? $this->handleVariableNode($child, $class) : (\true === $child instanceof ArrayNode ? $this->handleArrayNode($child, $class, $namespace) : null)));
|
||||
}
|
||||
}
|
||||
private function handleArrayNode(ArrayNode $node, ClassBuilder $class, string $namespace) : void
|
||||
|
|
|
@ -97,7 +97,7 @@ class XmlReferenceDumper
|
|||
if ($prototype->hasDefaultValue()) {
|
||||
$prototypeValue = $prototype->getDefaultValue();
|
||||
} else {
|
||||
$prototypeValue = \get_class($prototype) === ScalarNode::class ? 'scalar value' : ($prototype::class === EnumNode::class ? $prototype->getPermissibleValues('|') : 'value');
|
||||
$prototypeValue = \get_class($prototype) === ScalarNode::class ? 'scalar value' : ($prototype::class === FloatNode::class || $prototype::class === IntegerNode::class ? 'numeric value' : ($prototype::class === BooleanNode::class ? 'true|false' : ($prototype::class === EnumNode::class ? $prototype->getPermissibleValues('|') : 'value')));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ class DefinitionFileLoader extends FileLoader
|
|||
if (!$reflectionType instanceof \ReflectionNamedType) {
|
||||
throw new \InvalidArgumentException(\sprintf('Could not resolve argument "$%s" for "%s". You must typehint it (for example with "%s").', $parameter->getName(), $path, DefinitionConfigurator::class));
|
||||
}
|
||||
$arguments[] = $reflectionType->getName() === DefinitionConfigurator::class ? $configurator : ($reflectionType->getName() === FileLoader::class || $reflectionType->getName() === self::class ? $this : null);
|
||||
$arguments[] = $reflectionType->getName() === DefinitionConfigurator::class ? $configurator : ($reflectionType->getName() === TreeBuilder::class ? $this->treeBuilder : ($reflectionType->getName() === FileLoader::class || $reflectionType->getName() === self::class ? $this : null));
|
||||
}
|
||||
$callback(...$arguments);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ abstract class Descriptor implements DescriptorInterface
|
|||
public function describe(OutputInterface $output, object $object, array $options = []) : void
|
||||
{
|
||||
$this->output = $output;
|
||||
\true === $object instanceof InputArgument ? $this->describeInputArgument($object, $options) : (\true === $object instanceof Application ? $this->describeApplication($object, $options) : null);
|
||||
\true === $object instanceof InputArgument ? $this->describeInputArgument($object, $options) : (\true === $object instanceof InputOption ? $this->describeInputOption($object, $options) : (\true === $object instanceof InputDefinition ? $this->describeInputDefinition($object, $options) : (\true === $object instanceof Command ? $this->describeCommand($object, $options) : (\true === $object instanceof Application ? $this->describeApplication($object, $options) : null))));
|
||||
}
|
||||
protected function write(string $content, bool $decorated = \false) : void
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ final class Dumper
|
|||
};
|
||||
} else {
|
||||
$this->handler = function ($var) : string {
|
||||
return \true === (null === $var) ? 'null' : (\true === \is_string($var) ? '"' . $var . '"' : \rtrim(\print_r($var, \true)));
|
||||
return \true === (null === $var) ? 'null' : (\true === (\true === $var) ? 'true' : (\true === (\false === $var) ? 'false' : (\true === \is_string($var) ? '"' . $var . '"' : \rtrim(\print_r($var, \true)))));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -511,7 +511,7 @@ final class ProgressBar
|
|||
}
|
||||
private function determineBestFormat() : string
|
||||
{
|
||||
return $this->output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE ? $this->max ? self::FORMAT_VERBOSE : self::FORMAT_VERBOSE_NOMAX : ($this->output->getVerbosity() === OutputInterface::VERBOSITY_DEBUG ? $this->max ? self::FORMAT_DEBUG : self::FORMAT_DEBUG_NOMAX : ($this->max ? self::FORMAT_NORMAL : self::FORMAT_NORMAL_NOMAX));
|
||||
return $this->output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE ? $this->max ? self::FORMAT_VERBOSE : self::FORMAT_VERBOSE_NOMAX : ($this->output->getVerbosity() === OutputInterface::VERBOSITY_VERY_VERBOSE ? $this->max ? self::FORMAT_VERY_VERBOSE : self::FORMAT_VERY_VERBOSE_NOMAX : ($this->output->getVerbosity() === OutputInterface::VERBOSITY_DEBUG ? $this->max ? self::FORMAT_DEBUG : self::FORMAT_DEBUG_NOMAX : ($this->max ? self::FORMAT_NORMAL : self::FORMAT_NORMAL_NOMAX)));
|
||||
}
|
||||
private static function initPlaceholderFormatters() : array
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ class AnsiColorMode
|
|||
$r = $color >> 16 & 255;
|
||||
$g = $color >> 8 & 255;
|
||||
$b = $color & 255;
|
||||
return $this === self::Ansi4 ? (string) $this->convertFromRGB($r, $g, $b) : ($this === self::Ansi24 ? \sprintf('8;2;%d;%d;%d', $r, $g, $b) : null);
|
||||
return $this === self::Ansi4 ? (string) $this->convertFromRGB($r, $g, $b) : ($this === self::Ansi8 ? '8;5;' . (string) $this->convertFromRGB($r, $g, $b) : ($this === self::Ansi24 ? \sprintf('8;2;%d;%d;%d', $r, $g, $b) : null));
|
||||
}
|
||||
private function convertFromRGB(int $r, int $g, int $b) : int
|
||||
{
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -41,6 +41,6 @@ class Autowire
|
|||
if (null !== $value && \strncmp($value, '@', \strlen('@')) === 0) {
|
||||
\true === (\strncmp($value, '@@', \strlen('@@')) === 0) ? $value = \substr($value, 1) : (\true === (\strncmp($value, '@=', \strlen('@=')) === 0) ? $expression = \substr($value, 2) : ($service = \substr($value, 1)));
|
||||
}
|
||||
$this->value = \true === (null !== $service) ? new Reference($service) : (\true === (null !== $value) ? $value : null);
|
||||
$this->value = \true === (null !== $service) ? new Reference($service) : (\true === (null !== $expression) ? \class_exists(Expression::class) ? new Expression($expression) : throw new LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".') : (\true === (null !== $value) ? $value : null));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,6 +74,6 @@ class IniFileLoader extends FileLoader
|
|||
$value = '""' === \substr_replace($v, '', 1, -1) ? \substr($v, 1, -1) : $v;
|
||||
}
|
||||
$lowercaseValue = \strtolower($value);
|
||||
return \true === \defined($value) ? \constant($value) : (\true === (isset($value[1]) && ("'" === $value[0] && "'" === $value[\strlen($value) - 1] || '"' === $value[0] && '"' === $value[\strlen($value) - 1])) ? \substr($value, 1, -1) : XmlUtils::phpize($value));
|
||||
return \true === \defined($value) ? \constant($value) : (\true === ('yes' === $lowercaseValue) || \true === ('on' === $lowercaseValue) ? \true : (\true === ('no' === $lowercaseValue) || \true === ('off' === $lowercaseValue) || \true === ('none' === $lowercaseValue) ? \false : (\true === (isset($value[1]) && ("'" === $value[0] && "'" === $value[\strlen($value) - 1] || '"' === $value[0] && '"' === $value[\strlen($value) - 1])) ? \substr($value, 1, -1) : XmlUtils::phpize($value))));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,6 +51,6 @@ class Comparator
|
|||
*/
|
||||
public function test($test) : bool
|
||||
{
|
||||
return $this->operator === '>' ? $test > $this->target : ($this->operator === '!=' ? $test != $this->target : $test == $this->target);
|
||||
return $this->operator === '>' ? $test > $this->target : ($this->operator === '>=' ? $test >= $this->target : ($this->operator === '<' ? $test < $this->target : ($this->operator === '<=' ? $test <= $this->target : ($this->operator === '!=' ? $test != $this->target : $test == $this->target))));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue