From 8360fa1a7a63c21634bb6919c7b45d8e3cc31a2d Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 17 Nov 2022 10:44:46 +0000 Subject: [PATCH] Updated Rector to commit a8f322ad7e93f7902fca0a057e8d604482f71080 https://github.com/rectorphp/rector-src/commit/a8f322ad7e93f7902fca0a057e8d604482f71080 [Core] Remove BetterStandardPrinter::pStmt_Class() (#3072) --- .../SimplifyEmptyCheckOnEmptyArrayRector.php | 8 +- .../Rector/Class_/RemoveTraitUseRector.php | 13 +- src/Application/VersionResolver.php | 4 +- .../Printer/BetterStandardPrinter.php | 19 --- vendor/autoload.php | 2 +- vendor/composer/autoload_classmap.php | 3 + vendor/composer/autoload_real.php | 14 +- vendor/composer/autoload_static.php | 11 +- vendor/composer/installed.json | 14 +- vendor/composer/installed.php | 2 +- vendor/composer/pcre/README.md | 17 +++ vendor/composer/pcre/src/MatchAllResult.php | 4 +- .../pcre/src/MatchAllStrictGroupsResult.php | 42 ++++++ .../pcre/src/MatchAllWithOffsetsResult.php | 2 +- vendor/composer/pcre/src/MatchResult.php | 2 +- .../pcre/src/MatchStrictGroupsResult.php | 36 +++++ .../pcre/src/MatchWithOffsetsResult.php | 2 +- vendor/composer/pcre/src/Preg.php | 131 +++++++++++++++++- vendor/composer/pcre/src/Regex.php | 60 ++++++-- vendor/composer/pcre/src/ReplaceResult.php | 3 +- .../pcre/src/UnexpectedNullMatchException.php | 19 +++ 21 files changed, 333 insertions(+), 75 deletions(-) create mode 100644 vendor/composer/pcre/src/MatchAllStrictGroupsResult.php create mode 100644 vendor/composer/pcre/src/MatchStrictGroupsResult.php create mode 100644 vendor/composer/pcre/src/UnexpectedNullMatchException.php diff --git a/rules/CodeQuality/Rector/Empty_/SimplifyEmptyCheckOnEmptyArrayRector.php b/rules/CodeQuality/Rector/Empty_/SimplifyEmptyCheckOnEmptyArrayRector.php index 887b6fb2918..539dddd0c85 100644 --- a/rules/CodeQuality/Rector/Empty_/SimplifyEmptyCheckOnEmptyArrayRector.php +++ b/rules/CodeQuality/Rector/Empty_/SimplifyEmptyCheckOnEmptyArrayRector.php @@ -4,6 +4,7 @@ declare (strict_types=1); namespace Rector\CodeQuality\Rector\Empty_; use PhpParser\Node; +use PhpParser\Node\Expr; use PhpParser\Node\Expr\Array_; use PhpParser\Node\Expr\BinaryOp\Identical; use PhpParser\Node\Expr\Empty_; @@ -44,7 +45,7 @@ final class SimplifyEmptyCheckOnEmptyArrayRector extends AbstractScopeAwareRecto } return new Identical($node->expr, new Array_()); } - private function isAllowedExpr(Node\Expr $expr) : bool + private function isAllowedExpr(Expr $expr) : bool { if ($expr instanceof Variable) { return \true; @@ -52,9 +53,6 @@ final class SimplifyEmptyCheckOnEmptyArrayRector extends AbstractScopeAwareRecto if ($expr instanceof PropertyFetch) { return \true; } - if ($expr instanceof StaticPropertyFetch) { - return \true; - } - return \false; + return $expr instanceof StaticPropertyFetch; } } diff --git a/rules/Removing/Rector/Class_/RemoveTraitUseRector.php b/rules/Removing/Rector/Class_/RemoveTraitUseRector.php index f2a71cdbf0e..0f3afcb4d82 100644 --- a/rules/Removing/Rector/Class_/RemoveTraitUseRector.php +++ b/rules/Removing/Rector/Class_/RemoveTraitUseRector.php @@ -8,7 +8,6 @@ use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\Trait_; use Rector\Core\Contract\Rector\ConfigurableRectorInterface; use Rector\Core\Rector\AbstractRector; -use Rector\NodeTypeResolver\Node\AttributeKey; use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; use RectorPrefix202211\Webmozart\Assert\Assert; @@ -17,10 +16,6 @@ use RectorPrefix202211\Webmozart\Assert\Assert; */ final class RemoveTraitUseRector extends AbstractRector implements ConfigurableRectorInterface { - /** - * @var bool - */ - private $classHasChanged = \false; /** * @var string[] */ @@ -52,19 +47,17 @@ CODE_SAMPLE */ public function refactor(Node $node) : ?Node { - $this->classHasChanged = \false; + $classHasChanged = \false; foreach ($node->getTraitUses() as $traitUse) { foreach ($traitUse->traits as $trait) { if (!$this->isNames($trait, $this->traitsToRemove)) { continue; } $this->removeNode($traitUse); - $this->classHasChanged = \true; + $classHasChanged = \true; } } - // invoke re-print - if ($this->classHasChanged) { - $node->setAttribute(AttributeKey::ORIGINAL_NODE, null); + if ($classHasChanged) { return $node; } return null; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 650fa2100d9..8ded2f3f149 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -17,12 +17,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '8ac960d30cd26f5e071cda5835e4df5c26d30314'; + public const PACKAGE_VERSION = 'a8f322ad7e93f7902fca0a057e8d604482f71080'; /** * @api * @var string */ - public const RELEASE_DATE = '2022-11-16 22:12:09'; + public const RELEASE_DATE = '2022-11-17 11:40:00'; /** * @var int */ diff --git a/src/PhpParser/Printer/BetterStandardPrinter.php b/src/PhpParser/Printer/BetterStandardPrinter.php index cbe433c1ae3..57d3faaf5ce 100644 --- a/src/PhpParser/Printer/BetterStandardPrinter.php +++ b/src/PhpParser/Printer/BetterStandardPrinter.php @@ -24,7 +24,6 @@ use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Declare_; use PhpParser\Node\Stmt\Nop; -use PhpParser\Node\Stmt\TraitUse; use PhpParser\Node\Stmt\Use_; use PhpParser\PrettyPrinter\Standard; use Rector\Comments\NodeDocBlock\DocBlockUpdater; @@ -302,24 +301,6 @@ final class BetterStandardPrinter extends Standard implements NodePrinterInterfa // this approach is chosen, to keep changes in parent pStmt_ClassMethod() updated return Strings::replace($content, self::REPLACE_COLON_WITH_SPACE_REGEX, '$1: '); } - /** - * Clean class and trait from empty "use x;" for traits causing invalid code - */ - protected function pStmt_Class(Class_ $class) : string - { - $shouldReindex = \false; - foreach ($class->stmts as $key => $stmt) { - // remove empty ones - if ($stmt instanceof TraitUse && $stmt->traits === []) { - unset($class->stmts[$key]); - $shouldReindex = \true; - } - } - if ($shouldReindex) { - $class->stmts = \array_values($class->stmts); - } - return parent::pStmt_Class($class); - } /** * It remove all spaces extra to parent */ diff --git a/vendor/autoload.php b/vendor/autoload.php index db23d6c143d..a69bca694ca 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitcf51f0b01cfda16e7ca58972956089b5::getLoader(); +return ComposerAutoloaderInitf3d946c54bdbd2e959f0f6c3f35bf397::getLoader(); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index d8f3dd2e7ae..29e5858d5f5 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -342,13 +342,16 @@ return array( 'RectorPrefix202211\\Clue\\React\\NDJson\\Decoder' => $vendorDir . '/clue/ndjson-react/src/Decoder.php', 'RectorPrefix202211\\Clue\\React\\NDJson\\Encoder' => $vendorDir . '/clue/ndjson-react/src/Encoder.php', 'RectorPrefix202211\\Composer\\Pcre\\MatchAllResult' => $vendorDir . '/composer/pcre/src/MatchAllResult.php', + 'RectorPrefix202211\\Composer\\Pcre\\MatchAllStrictGroupsResult' => $vendorDir . '/composer/pcre/src/MatchAllStrictGroupsResult.php', 'RectorPrefix202211\\Composer\\Pcre\\MatchAllWithOffsetsResult' => $vendorDir . '/composer/pcre/src/MatchAllWithOffsetsResult.php', 'RectorPrefix202211\\Composer\\Pcre\\MatchResult' => $vendorDir . '/composer/pcre/src/MatchResult.php', + 'RectorPrefix202211\\Composer\\Pcre\\MatchStrictGroupsResult' => $vendorDir . '/composer/pcre/src/MatchStrictGroupsResult.php', 'RectorPrefix202211\\Composer\\Pcre\\MatchWithOffsetsResult' => $vendorDir . '/composer/pcre/src/MatchWithOffsetsResult.php', 'RectorPrefix202211\\Composer\\Pcre\\PcreException' => $vendorDir . '/composer/pcre/src/PcreException.php', 'RectorPrefix202211\\Composer\\Pcre\\Preg' => $vendorDir . '/composer/pcre/src/Preg.php', 'RectorPrefix202211\\Composer\\Pcre\\Regex' => $vendorDir . '/composer/pcre/src/Regex.php', 'RectorPrefix202211\\Composer\\Pcre\\ReplaceResult' => $vendorDir . '/composer/pcre/src/ReplaceResult.php', + 'RectorPrefix202211\\Composer\\Pcre\\UnexpectedNullMatchException' => $vendorDir . '/composer/pcre/src/UnexpectedNullMatchException.php', 'RectorPrefix202211\\Composer\\Semver\\Comparator' => $vendorDir . '/composer/semver/src/Comparator.php', 'RectorPrefix202211\\Composer\\Semver\\CompilingMatcher' => $vendorDir . '/composer/semver/src/CompilingMatcher.php', 'RectorPrefix202211\\Composer\\Semver\\Constraint\\Bound' => $vendorDir . '/composer/semver/src/Constraint/Bound.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 8c683a50182..22cce8f47e6 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitcf51f0b01cfda16e7ca58972956089b5 +class ComposerAutoloaderInitf3d946c54bdbd2e959f0f6c3f35bf397 { private static $loader; @@ -22,19 +22,19 @@ class ComposerAutoloaderInitcf51f0b01cfda16e7ca58972956089b5 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitcf51f0b01cfda16e7ca58972956089b5', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitf3d946c54bdbd2e959f0f6c3f35bf397', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitcf51f0b01cfda16e7ca58972956089b5', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitf3d946c54bdbd2e959f0f6c3f35bf397', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitcf51f0b01cfda16e7ca58972956089b5::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitf3d946c54bdbd2e959f0f6c3f35bf397::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInitcf51f0b01cfda16e7ca58972956089b5::$files; + $includeFiles = \Composer\Autoload\ComposerStaticInitf3d946c54bdbd2e959f0f6c3f35bf397::$files; foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirecf51f0b01cfda16e7ca58972956089b5($fileIdentifier, $file); + composerRequiref3d946c54bdbd2e959f0f6c3f35bf397($fileIdentifier, $file); } return $loader; @@ -46,7 +46,7 @@ class ComposerAutoloaderInitcf51f0b01cfda16e7ca58972956089b5 * @param string $file * @return void */ -function composerRequirecf51f0b01cfda16e7ca58972956089b5($fileIdentifier, $file) +function composerRequiref3d946c54bdbd2e959f0f6c3f35bf397($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 30712477417..da7824740b2 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitcf51f0b01cfda16e7ca58972956089b5 +class ComposerStaticInitf3d946c54bdbd2e959f0f6c3f35bf397 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -587,13 +587,16 @@ class ComposerStaticInitcf51f0b01cfda16e7ca58972956089b5 'RectorPrefix202211\\Clue\\React\\NDJson\\Decoder' => __DIR__ . '/..' . '/clue/ndjson-react/src/Decoder.php', 'RectorPrefix202211\\Clue\\React\\NDJson\\Encoder' => __DIR__ . '/..' . '/clue/ndjson-react/src/Encoder.php', 'RectorPrefix202211\\Composer\\Pcre\\MatchAllResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchAllResult.php', + 'RectorPrefix202211\\Composer\\Pcre\\MatchAllStrictGroupsResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchAllStrictGroupsResult.php', 'RectorPrefix202211\\Composer\\Pcre\\MatchAllWithOffsetsResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchAllWithOffsetsResult.php', 'RectorPrefix202211\\Composer\\Pcre\\MatchResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchResult.php', + 'RectorPrefix202211\\Composer\\Pcre\\MatchStrictGroupsResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchStrictGroupsResult.php', 'RectorPrefix202211\\Composer\\Pcre\\MatchWithOffsetsResult' => __DIR__ . '/..' . '/composer/pcre/src/MatchWithOffsetsResult.php', 'RectorPrefix202211\\Composer\\Pcre\\PcreException' => __DIR__ . '/..' . '/composer/pcre/src/PcreException.php', 'RectorPrefix202211\\Composer\\Pcre\\Preg' => __DIR__ . '/..' . '/composer/pcre/src/Preg.php', 'RectorPrefix202211\\Composer\\Pcre\\Regex' => __DIR__ . '/..' . '/composer/pcre/src/Regex.php', 'RectorPrefix202211\\Composer\\Pcre\\ReplaceResult' => __DIR__ . '/..' . '/composer/pcre/src/ReplaceResult.php', + 'RectorPrefix202211\\Composer\\Pcre\\UnexpectedNullMatchException' => __DIR__ . '/..' . '/composer/pcre/src/UnexpectedNullMatchException.php', 'RectorPrefix202211\\Composer\\Semver\\Comparator' => __DIR__ . '/..' . '/composer/semver/src/Comparator.php', 'RectorPrefix202211\\Composer\\Semver\\CompilingMatcher' => __DIR__ . '/..' . '/composer/semver/src/CompilingMatcher.php', 'RectorPrefix202211\\Composer\\Semver\\Constraint\\Bound' => __DIR__ . '/..' . '/composer/semver/src/Constraint/Bound.php', @@ -3033,9 +3036,9 @@ class ComposerStaticInitcf51f0b01cfda16e7ca58972956089b5 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitcf51f0b01cfda16e7ca58972956089b5::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitcf51f0b01cfda16e7ca58972956089b5::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitcf51f0b01cfda16e7ca58972956089b5::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitf3d946c54bdbd2e959f0f6c3f35bf397::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitf3d946c54bdbd2e959f0f6c3f35bf397::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInitf3d946c54bdbd2e959f0f6c3f35bf397::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 21139f025c5..8f05b2cfb92 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -69,17 +69,17 @@ }, { "name": "composer\/pcre", - "version": "3.0.2", - "version_normalized": "3.0.2.0", + "version": "3.1.0", + "version_normalized": "3.1.0.0", "source": { "type": "git", "url": "https:\/\/github.com\/composer\/pcre.git", - "reference": "4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb" + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/composer\/pcre\/zipball\/4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb", - "reference": "4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb", + "url": "https:\/\/api.github.com\/repos\/composer\/pcre\/zipball\/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", "shasum": "" }, "require": { @@ -90,7 +90,7 @@ "phpstan\/phpstan-strict-rules": "^1.1", "symfony\/phpunit-bridge": "^5" }, - "time": "2022-11-03T20:24:16+00:00", + "time": "2022-11-17T09:50:14+00:00", "type": "library", "extra": { "branch-alias": { @@ -123,7 +123,7 @@ ], "support": { "issues": "https:\/\/github.com\/composer\/pcre\/issues", - "source": "https:\/\/github.com\/composer\/pcre\/tree\/3.0.2" + "source": "https:\/\/github.com\/composer\/pcre\/tree\/3.1.0" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index d131918e197..9c5021678b5 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202211; -return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(0 => '0.14.x-dev'), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => '708411c7e45ac85371a99d50f52284971494bede', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.0.2', 'version' => '3.0.2.0', 'reference' => '4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.3.2', 'version' => '3.3.2.0', 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => 'ced299686f41dce890debac69273b47ffe98a40c', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.6', 'version' => '2.0.6.0', 'reference' => 'd9d313a36c872fd6ee06d9a6cbcf713eaa40f024', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.1', 'version' => '3.0.1.0', 'reference' => '531bfb9d15f8aa57454f5f0285b18bec903b8fb7', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.8', 'version' => '3.2.8.0', 'reference' => '02a54c4c872b99e4ec05c4aec54b5a06eb0f6368', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.15.2', 'version' => '4.15.2.0', 'reference' => 'f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.1.0', 'version' => '4.1.0.0', 'reference' => '8a4b664e916df82ff26a44709942dfd593fa6f30', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '1.13.0', 'version' => '1.13.0.0', 'reference' => '33aefcdab42900e36366d0feab6206e2dd68f947', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.9.2', 'version' => '1.9.2.0', 'reference' => 'd6fdf01c53978b6429f1393ba4afeca39cc68afa', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan-phpunit' => array('pretty_version' => '1.2.2', 'version' => '1.2.2.0', 'reference' => 'dea1f87344c6964c607d9076dee42d891f3923f0', 'type' => 'phpstan-extension', 'install_path' => __DIR__ . '/../phpstan/phpstan-phpunit', 'aliases' => array(), 'dev_requirement' => \false), 'psr/cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/cache', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/event-dispatcher' => array('pretty_version' => '1.0.0', 'version' => '1.0.0.0', 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/event-dispatcher', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'react/cache' => array('pretty_version' => 'v1.1.1', 'version' => '1.1.1.0', 'reference' => '4bf736a2cccec7298bdf745db77585966fc2ca7e', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.10.0', 'version' => '1.10.0.0', 'reference' => 'a5427e7dfa47713e438016905605819d101f238c', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '187fb56f46d424afb6ec4ad089269c72eec2e137', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v2.9.0', 'version' => '2.9.0.0', 'reference' => '234f8fd1023c9158e2314fa9d7d0e6a83db42910', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise-timer' => array('pretty_version' => 'v1.9.0', 'version' => '1.9.0.0', 'reference' => 'aa7a73c74b8d8c0f622f5982ff7b0351bc29e495', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise-timer', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.12.0', 'version' => '1.12.0.0', 'reference' => '81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => '7a423506ee1903e89f1e08ec5f0ed430ff784ae9', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => '0.14.x-dev', 1 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'bf394eec1e4612ceae5b6ee3c574e37f81f422b7', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'da1013feacd1f27dbd414734fd2768d9258a5f7b', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-php-parser' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '9ea5f622c1ed47addb197ded25a6bac39c39c596', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-php-parser', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '769064fc1622bb6e31da6d6802b1bcdaea08e007', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(0 => '0.14.x-dev'), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '695c960e7713438ef1077bebcbc6d298a95020d1', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '4.0.4', 'version' => '4.0.4.0', 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/cache-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/config' => array('pretty_version' => 'v6.1.3', 'version' => '6.1.3.0', 'reference' => 'a0645dc585d378b73c01115dd7ab9348f7d40c85', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.1.7', 'version' => '6.1.7.0', 'reference' => 'a1282bd0c096e0bdb8800b104177e2ce404d8815', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/contracts' => array('pretty_version' => 'v3.1.1', 'version' => '3.1.1.0', 'reference' => '8656c9e7f44435eaf428f2aa7f083c65297fb22f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/dependency-injection' => array('pretty_version' => 'v6.1.5', 'version' => '6.1.5.0', 'reference' => 'b9c797c9d56afc290d4265854bafd01b4e379240', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dependency-injection', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/event-dispatcher-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/filesystem' => array('pretty_version' => 'v6.1.5', 'version' => '6.1.5.0', 'reference' => '4d216a2beef096edf040a070117c39ca2abce307', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.1.3', 'version' => '6.1.3.0', 'reference' => '39696bff2c2970b3779a5cac7bf9f0b88fc2b709', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/http-client-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-normalizer' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/service-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0|3.0')), 'symfony/string' => array('pretty_version' => 'v6.1.7', 'version' => '6.1.7.0', 'reference' => '823f143370880efcbdfa2dbca946b3358c4707e5', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/translation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symplify/autowire-array-parameter' => array('pretty_version' => '11.1.17', 'version' => '11.1.17.0', 'reference' => '55242ce6403e25590bbffa581471f097c4a7109d', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/autowire-array-parameter', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/easy-parallel' => array('pretty_version' => '11.1.17', 'version' => '11.1.17.0', 'reference' => '451d792f838028cd83dcf157abdb3ed2d9192286', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.1.17', 'version' => '11.1.17.0', 'reference' => 'db548865295b95fcd5f868f0782fedef1e96fcb1', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); +return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(0 => '0.14.x-dev'), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => '708411c7e45ac85371a99d50f52284971494bede', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.1.0', 'version' => '3.1.0.0', 'reference' => '4bff79ddd77851fe3cdd11616ed3f92841ba5bd2', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.3.2', 'version' => '3.3.2.0', 'reference' => '3953f23262f2bff1919fc82183ad9acb13ff62c9', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.3', 'version' => '3.0.3.0', 'reference' => 'ced299686f41dce890debac69273b47ffe98a40c', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.6', 'version' => '2.0.6.0', 'reference' => 'd9d313a36c872fd6ee06d9a6cbcf713eaa40f024', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.1', 'version' => '3.0.1.0', 'reference' => '531bfb9d15f8aa57454f5f0285b18bec903b8fb7', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.8', 'version' => '3.2.8.0', 'reference' => '02a54c4c872b99e4ec05c4aec54b5a06eb0f6368', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.15.2', 'version' => '4.15.2.0', 'reference' => 'f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.1.0', 'version' => '4.1.0.0', 'reference' => '8a4b664e916df82ff26a44709942dfd593fa6f30', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '1.13.0', 'version' => '1.13.0.0', 'reference' => '33aefcdab42900e36366d0feab6206e2dd68f947', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.9.2', 'version' => '1.9.2.0', 'reference' => 'd6fdf01c53978b6429f1393ba4afeca39cc68afa', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan-phpunit' => array('pretty_version' => '1.2.2', 'version' => '1.2.2.0', 'reference' => 'dea1f87344c6964c607d9076dee42d891f3923f0', 'type' => 'phpstan-extension', 'install_path' => __DIR__ . '/../phpstan/phpstan-phpunit', 'aliases' => array(), 'dev_requirement' => \false), 'psr/cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/cache', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/event-dispatcher' => array('pretty_version' => '1.0.0', 'version' => '1.0.0.0', 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/event-dispatcher', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'react/cache' => array('pretty_version' => 'v1.1.1', 'version' => '1.1.1.0', 'reference' => '4bf736a2cccec7298bdf745db77585966fc2ca7e', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.10.0', 'version' => '1.10.0.0', 'reference' => 'a5427e7dfa47713e438016905605819d101f238c', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '187fb56f46d424afb6ec4ad089269c72eec2e137', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v2.9.0', 'version' => '2.9.0.0', 'reference' => '234f8fd1023c9158e2314fa9d7d0e6a83db42910', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise-timer' => array('pretty_version' => 'v1.9.0', 'version' => '1.9.0.0', 'reference' => 'aa7a73c74b8d8c0f622f5982ff7b0351bc29e495', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise-timer', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.12.0', 'version' => '1.12.0.0', 'reference' => '81e1b4d7f5450ebd8d2e9a95bb008bb15ca95a7b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => '7a423506ee1903e89f1e08ec5f0ed430ff784ae9', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => '0.14.x-dev', 1 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'bf394eec1e4612ceae5b6ee3c574e37f81f422b7', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'da1013feacd1f27dbd414734fd2768d9258a5f7b', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-php-parser' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '9ea5f622c1ed47addb197ded25a6bac39c39c596', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-php-parser', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '769064fc1622bb6e31da6d6802b1bcdaea08e007', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(0 => '0.14.x-dev'), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '695c960e7713438ef1077bebcbc6d298a95020d1', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '4.0.4', 'version' => '4.0.4.0', 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/cache-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/config' => array('pretty_version' => 'v6.1.3', 'version' => '6.1.3.0', 'reference' => 'a0645dc585d378b73c01115dd7ab9348f7d40c85', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.1.7', 'version' => '6.1.7.0', 'reference' => 'a1282bd0c096e0bdb8800b104177e2ce404d8815', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/contracts' => array('pretty_version' => 'v3.1.1', 'version' => '3.1.1.0', 'reference' => '8656c9e7f44435eaf428f2aa7f083c65297fb22f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/dependency-injection' => array('pretty_version' => 'v6.1.5', 'version' => '6.1.5.0', 'reference' => 'b9c797c9d56afc290d4265854bafd01b4e379240', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dependency-injection', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/event-dispatcher-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/filesystem' => array('pretty_version' => 'v6.1.5', 'version' => '6.1.5.0', 'reference' => '4d216a2beef096edf040a070117c39ca2abce307', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.1.3', 'version' => '6.1.3.0', 'reference' => '39696bff2c2970b3779a5cac7bf9f0b88fc2b709', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/http-client-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-normalizer' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.27.0', 'version' => '1.27.0.0', 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symfony/service-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0|3.0')), 'symfony/string' => array('pretty_version' => 'v6.1.7', 'version' => '6.1.7.0', 'reference' => '823f143370880efcbdfa2dbca946b3358c4707e5', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/translation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.1.1')), 'symplify/autowire-array-parameter' => array('pretty_version' => '11.1.17', 'version' => '11.1.17.0', 'reference' => '55242ce6403e25590bbffa581471f097c4a7109d', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/autowire-array-parameter', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/easy-parallel' => array('pretty_version' => '11.1.17', 'version' => '11.1.17.0', 'reference' => '451d792f838028cd83dcf157abdb3ed2d9192286', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.1.17', 'version' => '11.1.17.0', 'reference' => 'db548865295b95fcd5f868f0782fedef1e96fcb1', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); diff --git a/vendor/composer/pcre/README.md b/vendor/composer/pcre/README.md index 6cfdec1740d..973b17d8dad 100644 --- a/vendor/composer/pcre/README.md +++ b/vendor/composer/pcre/README.md @@ -84,6 +84,23 @@ if (Preg::isMatch('{fo+}', $string, $matches)) // bool if (Preg::isMatchAll('{fo+}', $string, $matches)) // bool ``` +Finally the `Preg` class provides a few `*StrictGroups` method variants that ensure match groups +are always present and thus non-nullable, making it easier to write type-safe code: + +```php +use Composer\Pcre\Preg; + +// $matches is guaranteed to be an array of strings, if a subpattern does not match and produces a null it will throw +if (Preg::matchStrictGroups('{fo+}', $string, $matches)) +if (Preg::matchAllStrictGroups('{fo+}', $string, $matches)) +``` + +**Note:** This is generally safe to use as long as you do not have optional subpatterns (i.e. `(something)?` +or `(something)*` or branches with a `|` that result in some groups not being matched at all). +A subpattern that can match an empty string like `(.*)` is **not** optional, it will be present as an +empty string in the matches. A non-matching subpattern, even if optional like `(?:foo)?` will anyway not be present in +matches so it is also not a problem to use these with `*StrictGroups` methods. + If you would prefer a slightly more verbose usage, replacing by-ref arguments by result objects, you can use the `Regex` class: ```php diff --git a/vendor/composer/pcre/src/MatchAllResult.php b/vendor/composer/pcre/src/MatchAllResult.php index 7458fcece7e..de96b80556a 100644 --- a/vendor/composer/pcre/src/MatchAllResult.php +++ b/vendor/composer/pcre/src/MatchAllResult.php @@ -31,9 +31,9 @@ final class MatchAllResult public $matched; /** * @param 0|positive-int $count - * @param array> $matches + * @param array> $matches */ - public function __construct($count, array $matches) + public function __construct(int $count, array $matches) { $this->matches = $matches; $this->matched = (bool) $count; diff --git a/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php b/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php new file mode 100644 index 00000000000..f439098e282 --- /dev/null +++ b/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ +namespace RectorPrefix202211\Composer\Pcre; + +final class MatchAllStrictGroupsResult +{ + /** + * An array of match group => list of matched strings + * + * @readonly + * @var array> + */ + public $matches; + /** + * @readonly + * @var 0|positive-int + */ + public $count; + /** + * @readonly + * @var bool + */ + public $matched; + /** + * @param 0|positive-int $count + * @param array> $matches + */ + public function __construct(int $count, array $matches) + { + $this->matches = $matches; + $this->matched = (bool) $count; + $this->count = $count; + } +} diff --git a/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php b/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php index 03807a01784..64d6d44cb46 100644 --- a/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php +++ b/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php @@ -35,7 +35,7 @@ final class MatchAllWithOffsetsResult * @param array> $matches * @phpstan-param array}>> $matches */ - public function __construct($count, array $matches) + public function __construct(int $count, array $matches) { $this->matches = $matches; $this->matched = (bool) $count; diff --git a/vendor/composer/pcre/src/MatchResult.php b/vendor/composer/pcre/src/MatchResult.php index 34667f084a4..76e56f51227 100644 --- a/vendor/composer/pcre/src/MatchResult.php +++ b/vendor/composer/pcre/src/MatchResult.php @@ -28,7 +28,7 @@ final class MatchResult * @param 0|positive-int $count * @param array $matches */ - public function __construct($count, array $matches) + public function __construct(int $count, array $matches) { $this->matches = $matches; $this->matched = (bool) $count; diff --git a/vendor/composer/pcre/src/MatchStrictGroupsResult.php b/vendor/composer/pcre/src/MatchStrictGroupsResult.php new file mode 100644 index 00000000000..a8769291dec --- /dev/null +++ b/vendor/composer/pcre/src/MatchStrictGroupsResult.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ +namespace RectorPrefix202211\Composer\Pcre; + +final class MatchStrictGroupsResult +{ + /** + * An array of match group => string matched + * + * @readonly + * @var array + */ + public $matches; + /** + * @readonly + * @var bool + */ + public $matched; + /** + * @param 0|positive-int $count + * @param array $matches + */ + public function __construct(int $count, array $matches) + { + $this->matches = $matches; + $this->matched = (bool) $count; + } +} diff --git a/vendor/composer/pcre/src/MatchWithOffsetsResult.php b/vendor/composer/pcre/src/MatchWithOffsetsResult.php index 411fc26fd87..512c53f7207 100644 --- a/vendor/composer/pcre/src/MatchWithOffsetsResult.php +++ b/vendor/composer/pcre/src/MatchWithOffsetsResult.php @@ -30,7 +30,7 @@ final class MatchWithOffsetsResult * @param array $matches * @phpstan-param array}> $matches */ - public function __construct($count, array $matches) + public function __construct(int $count, array $matches) { $this->matches = $matches; $this->matched = (bool) $count; diff --git a/vendor/composer/pcre/src/Preg.php b/vendor/composer/pcre/src/Preg.php index b759f1d73cf..71025b847f8 100644 --- a/vendor/composer/pcre/src/Preg.php +++ b/vendor/composer/pcre/src/Preg.php @@ -33,6 +33,23 @@ class Preg } return $result; } + /** + * Variant of `match()` which outputs non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param array $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @return 0|1 + * @throws UnexpectedNullMatchException + * + * @param-out array $matches + */ + public static function matchStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0) : int + { + $result = self::match($pattern, $subject, $matchesInternal, $flags, $offset); + $matches = self::enforceNonNullMatches($pattern, $matchesInternal, 'match'); + return $result; + } /** * Runs preg_match with PREG_OFFSET_CAPTURE * @@ -54,7 +71,7 @@ class Preg /** * @param non-empty-string $pattern * @param array> $matches Set by method - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported * @return 0|positive-int * * @param-out array> $matches @@ -62,9 +79,7 @@ class Preg public static function matchAll(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0) : int { self::checkOffsetCapture($flags, 'matchAllWithOffsets'); - if (($flags & \PREG_SET_ORDER) !== 0) { - throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the type of $matches'); - } + self::checkSetOrder($flags); $result = \preg_match_all($pattern, $subject, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset); if (!\is_int($result)) { // PHP < 8 may return null, 8+ returns int|false @@ -72,6 +87,23 @@ class Preg } return $result; } + /** + * Variant of `match()` which outputs non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param array> $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @return 0|positive-int + * @throws UnexpectedNullMatchException + * + * @param-out array> $matches + */ + public static function matchAllStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0) : int + { + $result = self::matchAll($pattern, $subject, $matchesInternal, $flags, $offset); + $matches = self::enforceNonNullMatchAll($pattern, $matchesInternal, 'matchAll'); + return $result; + } /** * Runs preg_match_all with PREG_OFFSET_CAPTURE * @@ -84,6 +116,7 @@ class Preg */ public static function matchAllWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0) : int { + self::checkSetOrder($flags); $result = \preg_match_all($pattern, $subject, $matches, $flags | \PREG_UNMATCHED_AS_NULL | \PREG_OFFSET_CAPTURE, $offset); if (!\is_int($result)) { // PHP < 8 may return null, 8+ returns int|false @@ -136,6 +169,23 @@ class Preg } return $result; } + /** + * Variant of `replaceCallback()` which outputs non-null matches (or throws) + * + * @param string $pattern + * @param callable(array): string $replacement + * @param string $subject + * @param int $count Set by method + * @param int-mask $flags PREG_OFFSET_CAPTURE or PREG_UNMATCHED_AS_NULL, only available on PHP 7.4+ + * + * @param-out int<0, max> $count + */ + public static function replaceCallbackStrictGroups(string $pattern, callable $replacement, $subject, int $limit = -1, int &$count = null, int $flags = 0) : string + { + return self::replaceCallback($pattern, function (array $matches) use($pattern, $replacement) { + return $replacement(self::enforceNonNullMatches($pattern, $matches, 'replaceCallback')); + }, $subject, $limit, $count, $flags); + } /** * @param array): string> $pattern * @param string $subject @@ -203,6 +253,8 @@ class Preg return $result; } /** + * Variant of match() which returns a bool instead of int + * * @param non-empty-string $pattern * @param array $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported @@ -214,6 +266,22 @@ class Preg return (bool) static::match($pattern, $subject, $matches, $flags, $offset); } /** + * Variant of `isMatch()` which outputs non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param array $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @throws UnexpectedNullMatchException + * + * @param-out array $matches + */ + public static function isMatchStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0) : bool + { + return (bool) self::matchStrictGroups($pattern, $subject, $matches, $flags, $offset); + } + /** + * Variant of matchAll() which returns a bool instead of int + * * @param non-empty-string $pattern * @param array> $matches Set by method * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported @@ -225,6 +293,21 @@ class Preg return (bool) static::matchAll($pattern, $subject, $matches, $flags, $offset); } /** + * Variant of `isMatchAll()` which outputs non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param array> $matches Set by method + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * + * @param-out array> $matches + */ + public static function isMatchAllStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0) : bool + { + return (bool) self::matchAllStrictGroups($pattern, $subject, $matches, $flags, $offset); + } + /** + * Variant of matchWithOffsets() which returns a bool instead of int + * * Runs preg_match with PREG_OFFSET_CAPTURE * * @param non-empty-string $pattern @@ -238,6 +321,8 @@ class Preg return (bool) static::matchWithOffsets($pattern, $subject, $matches, $flags, $offset); } /** + * Variant of matchAllWithOffsets() which returns a bool instead of int + * * Runs preg_match_all with PREG_OFFSET_CAPTURE * * @param non-empty-string $pattern @@ -256,4 +341,42 @@ class Preg throw new \InvalidArgumentException('PREG_OFFSET_CAPTURE is not supported as it changes the type of $matches, use ' . $useFunctionName . '() instead'); } } + private static function checkSetOrder(int $flags) : void + { + if (($flags & \PREG_SET_ORDER) !== 0) { + throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the type of $matches'); + } + } + /** + * @param array $matches + * @return array + * @throws UnexpectedNullMatchException + */ + private static function enforceNonNullMatches(string $pattern, array $matches, string $variantMethod) + { + foreach ($matches as $group => $match) { + if (null === $match) { + throw new UnexpectedNullMatchException('Pattern "' . $pattern . '" had an unexpected unmatched group "' . $group . '", make sure the pattern always matches or use ' . $variantMethod . '() instead.'); + } + } + /** @var array */ + return $matches; + } + /** + * @param array> $matches + * @return array> + * @throws UnexpectedNullMatchException + */ + private static function enforceNonNullMatchAll(string $pattern, array $matches, string $variantMethod) + { + foreach ($matches as $group => $groupMatches) { + foreach ($groupMatches as $match) { + if (null === $match) { + throw new UnexpectedNullMatchException('Pattern "' . $pattern . '" had an unexpected unmatched group "' . $group . '", make sure the pattern always matches or use ' . $variantMethod . '() instead.'); + } + } + } + /** @var array> */ + return $matches; + } } diff --git a/vendor/composer/pcre/src/Regex.php b/vendor/composer/pcre/src/Regex.php index baf1189696a..f260e680ea2 100644 --- a/vendor/composer/pcre/src/Regex.php +++ b/vendor/composer/pcre/src/Regex.php @@ -25,10 +25,22 @@ class Regex */ public static function match(string $pattern, string $subject, int $flags = 0, int $offset = 0) : MatchResult { - self::checkOffsetCapture($flags); + self::checkOffsetCapture($flags, 'matchWithOffsets'); $count = Preg::match($pattern, $subject, $matches, $flags, $offset); return new MatchResult($count, $matches); } + /** + * Variant of `match()` which returns non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @throws UnexpectedNullMatchException + */ + public static function matchStrictGroups(string $pattern, string $subject, int $flags = 0, int $offset = 0) : MatchStrictGroupsResult + { + $count = Preg::matchStrictGroups($pattern, $subject, $matches, $flags, $offset); + return new MatchStrictGroupsResult($count, $matches); + } /** * Runs preg_match with PREG_OFFSET_CAPTURE * @@ -42,17 +54,29 @@ class Regex } /** * @param non-empty-string $pattern - * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported */ public static function matchAll(string $pattern, string $subject, int $flags = 0, int $offset = 0) : MatchAllResult { - self::checkOffsetCapture($flags); - if (($flags & \PREG_SET_ORDER) !== 0) { - throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the return type'); - } + self::checkOffsetCapture($flags, 'matchAllWithOffsets'); + self::checkSetOrder($flags); $count = Preg::matchAll($pattern, $subject, $matches, $flags, $offset); return new MatchAllResult($count, $matches); } + /** + * Variant of `matchAll()` which returns non-null matches (or throws) + * + * @param non-empty-string $pattern + * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported + * @throws UnexpectedNullMatchException + */ + public static function matchAllStrictGroups(string $pattern, string $subject, int $flags = 0, int $offset = 0) : MatchAllStrictGroupsResult + { + self::checkOffsetCapture($flags, 'matchAllWithOffsets'); + self::checkSetOrder($flags); + $count = Preg::matchAllStrictGroups($pattern, $subject, $matches, $flags, $offset); + return new MatchAllStrictGroupsResult($count, $matches); + } /** * Runs preg_match_all with PREG_OFFSET_CAPTURE * @@ -61,6 +85,7 @@ class Regex */ public static function matchAllWithOffsets(string $pattern, string $subject, int $flags = 0, int $offset = 0) : MatchAllWithOffsetsResult { + self::checkSetOrder($flags); $count = Preg::matchAllWithOffsets($pattern, $subject, $matches, $flags, $offset); return new MatchAllWithOffsetsResult($count, $matches); } @@ -85,6 +110,19 @@ class Regex $result = Preg::replaceCallback($pattern, $replacement, $subject, $limit, $count, $flags); return new ReplaceResult($count, $result); } + /** + * Variant of `replaceCallback()` which outputs non-null matches (or throws) + * + * @param string $pattern + * @param callable(array): string $replacement + * @param string $subject + * @param int-mask $flags PREG_OFFSET_CAPTURE or PREG_UNMATCHED_AS_NULL, only available on PHP 7.4+ + */ + public static function replaceCallbackStrictGroups($pattern, callable $replacement, $subject, int $limit = -1, int $flags = 0) : ReplaceResult + { + $result = Preg::replaceCallbackStrictGroups($pattern, $replacement, $subject, $limit, $count, $flags); + return new ReplaceResult($count, $result); + } /** * @param array): string> $pattern * @param string $subject @@ -95,10 +133,16 @@ class Regex $result = Preg::replaceCallbackArray($pattern, $subject, $limit, $count, $flags); return new ReplaceResult($count, $result); } - private static function checkOffsetCapture(int $flags) : void + private static function checkOffsetCapture(int $flags, string $useFunctionName) : void { if (($flags & \PREG_OFFSET_CAPTURE) !== 0) { - throw new \InvalidArgumentException('PREG_OFFSET_CAPTURE is not supported as it changes the return type, use matchWithOffsets() instead'); + throw new \InvalidArgumentException('PREG_OFFSET_CAPTURE is not supported as it changes the return type, use ' . $useFunctionName . '() instead'); + } + } + private static function checkSetOrder(int $flags) : void + { + if (($flags & \PREG_SET_ORDER) !== 0) { + throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the return type'); } } } diff --git a/vendor/composer/pcre/src/ReplaceResult.php b/vendor/composer/pcre/src/ReplaceResult.php index fbdde53206f..c84ab1d708b 100644 --- a/vendor/composer/pcre/src/ReplaceResult.php +++ b/vendor/composer/pcre/src/ReplaceResult.php @@ -29,9 +29,8 @@ final class ReplaceResult public $matched; /** * @param 0|positive-int $count - * @param string $result */ - public function __construct($count, $result) + public function __construct(int $count, string $result) { $this->count = $count; $this->matched = (bool) $count; diff --git a/vendor/composer/pcre/src/UnexpectedNullMatchException.php b/vendor/composer/pcre/src/UnexpectedNullMatchException.php new file mode 100644 index 00000000000..81eae92eeb9 --- /dev/null +++ b/vendor/composer/pcre/src/UnexpectedNullMatchException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ +namespace RectorPrefix202211\Composer\Pcre; + +class UnexpectedNullMatchException extends PcreException +{ + public static function fromFunction($function, $pattern) + { + throw new \LogicException('fromFunction should not be called on ' . self::class . ', use ' . PcreException::class); + } +}