diff --git a/config/config.php b/config/config.php index c4a8fee3aa8..a0e36b1b06f 100644 --- a/config/config.php +++ b/config/config.php @@ -45,7 +45,6 @@ use Rector\PhpDocParser\PhpParser\SmartPhpParserFactory; use Rector\PSR4\Composer\PSR4NamespaceMatcher; use Rector\PSR4\Contract\PSR4AutoloadNamespaceMatcherInterface; use Rector\Utils\Command\MissingInSetCommand; -use RectorPrefix202302\SebastianBergmann\Diff\Differ; use RectorPrefix202302\Symfony\Component\Console\Application; use RectorPrefix202302\Symfony\Component\Console\Style\SymfonyStyle; use function RectorPrefix202302\Symfony\Component\DependencyInjection\Loader\Configurator\service; @@ -144,6 +143,4 @@ return static function (RectorConfig $rectorConfig) : void { $services->set(\PHPStan\PhpDocParser\Lexer\Lexer::class); $services->set(TypeParser::class); $services->set(ConstExprParser::class); - // console color diff - $services->set(Differ::class); }; diff --git a/e2e/rector-prefixed-rule-test/utils/rector/tests/Rector/RenameSimpleRector/RenameSimpleRectorTest.php b/e2e/rector-prefixed-rule-test/utils/rector/tests/Rector/RenameSimpleRector/RenameSimpleRectorTest.php index 6b001391bd6..38ac56387b7 100644 --- a/e2e/rector-prefixed-rule-test/utils/rector/tests/Rector/RenameSimpleRector/RenameSimpleRectorTest.php +++ b/e2e/rector-prefixed-rule-test/utils/rector/tests/Rector/RenameSimpleRector/RenameSimpleRectorTest.php @@ -20,9 +20,9 @@ final class RenameSimpleRectorTest extends AbstractRectorTestCase /** * @return Iterator> */ - public function provideData(): Iterator + public static function provideData(): Iterator { - return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); + return self::yieldFilesFromDirectory(__DIR__ . '/Fixture'); } public function provideConfigFilePath(): string diff --git a/packages/Testing/PHPUnit/AbstractRectorTestCase.php b/packages/Testing/PHPUnit/AbstractRectorTestCase.php index 2ebe0345a40..aadeb44d370 100644 --- a/packages/Testing/PHPUnit/AbstractRectorTestCase.php +++ b/packages/Testing/PHPUnit/AbstractRectorTestCase.php @@ -80,7 +80,7 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTe /** * @return Iterator<> */ - protected function yieldFilesFromDirectory(string $directory, string $suffix = '*.php.inc') : Iterator + protected static function yieldFilesFromDirectory(string $directory, string $suffix = '*.php.inc') : Iterator { return FixtureFileFinder::yieldDirectory($directory, $suffix); } @@ -105,7 +105,7 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTe $this->originalTempFilePath = $inputFilePath; $this->doTestFileMatchesExpectedContent($inputFilePath, $expectedFilePath, $fixtureFilePath); } - protected function getFixtureTempDirectory() : string + protected static function getFixtureTempDirectory() : string { return FixtureTempFileDumper::getTempDirectory(); } diff --git a/rules/CodingStyle/Rector/ClassMethod/DataProviderArrayItemsNewlinedRector.php b/rules/CodingStyle/Rector/ClassMethod/DataProviderArrayItemsNewlinedRector.php index 52304b64c9b..e45666fa801 100644 --- a/rules/CodingStyle/Rector/ClassMethod/DataProviderArrayItemsNewlinedRector.php +++ b/rules/CodingStyle/Rector/ClassMethod/DataProviderArrayItemsNewlinedRector.php @@ -41,7 +41,7 @@ final class ImageBinaryTest extends TestCase // ... } - public function provideData(): array + public static function provideData(): array { return [['content', 8], ['content123', 11]]; } @@ -60,7 +60,7 @@ final class ImageBinaryTest extends TestCase // ... } - public function provideData(): array + public static function provideData(): array { return [ ['content', 8], diff --git a/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeBasedOnPHPUnitDataProviderRector.php b/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeBasedOnPHPUnitDataProviderRector.php index ae195d9b3db..1c896ae87de 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeBasedOnPHPUnitDataProviderRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeBasedOnPHPUnitDataProviderRector.php @@ -69,7 +69,7 @@ final class SomeTest extends TestCase { } - public function provideData() + public static function provideData() { yield ['name']; } @@ -87,7 +87,7 @@ final class SomeTest extends TestCase { } - public function provideData() + public static function provideData() { yield ['name']; } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 4c794840c55..c56a84c1bac 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '1fd38073d08dff31e7b6f5fecdfc0df8f6e897b0'; + public const PACKAGE_VERSION = 'c3ff0fd4328b603df30c7e7bb833cb1e641f410c'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-02-02 17:49:56'; + public const RELEASE_DATE = '2023-02-03 17:42:57'; /** * @var int */ diff --git a/src/Console/Formatter/ConsoleDiffer.php b/src/Console/Formatter/ConsoleDiffer.php index 48d62428a2d..8aab6a72b12 100644 --- a/src/Console/Formatter/ConsoleDiffer.php +++ b/src/Console/Formatter/ConsoleDiffer.php @@ -4,6 +4,8 @@ declare (strict_types=1); namespace Rector\Core\Console\Formatter; use RectorPrefix202302\SebastianBergmann\Diff\Differ; +use RectorPrefix202302\SebastianBergmann\Diff\Output\StrictUnifiedDiffOutputBuilder; +use RectorPrefix202302\SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder; final class ConsoleDiffer { /** @@ -16,10 +18,13 @@ final class ConsoleDiffer * @var \Rector\Core\Console\Formatter\ColorConsoleDiffFormatter */ private $colorConsoleDiffFormatter; - public function __construct(Differ $differ, \Rector\Core\Console\Formatter\ColorConsoleDiffFormatter $colorConsoleDiffFormatter) + public function __construct(\Rector\Core\Console\Formatter\ColorConsoleDiffFormatter $colorConsoleDiffFormatter) { - $this->differ = $differ; $this->colorConsoleDiffFormatter = $colorConsoleDiffFormatter; + // @see https://github.com/sebastianbergmann/diff#strictunifieddiffoutputbuilder + // @see https://github.com/sebastianbergmann/diff/compare/4.0.4...5.0.0#diff-251edf56a6344c03fa264a4926b06c2cee43c25f66192d5f39ebee912b7442dc for upgrade + $unifiedDiffOutputBuilder = new UnifiedDiffOutputBuilder(); + $this->differ = new Differ($unifiedDiffOutputBuilder); } public function diff(string $old, string $new) : string { diff --git a/vendor/autoload.php b/vendor/autoload.php index d902b9f272b..b3967dbb75a 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 ComposerAutoloaderInita47dd119f87e03c2c15debfad792ecd7::getLoader(); +return ComposerAutoloaderInit3f38aa930f66abcbdeb033aa5b78a720::getLoader(); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index deee90910ce..235636f29bc 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2047,6 +2047,7 @@ return array( 'Rector\\PHPUnit\\PhpDoc\\PhpDocValueToNodeMapper' => $vendorDir . '/rector/rector-phpunit/src/PhpDoc/PhpDocValueToNodeMapper.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\AddDoesNotPerformAssertionToNonAssertingTestRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/AddDoesNotPerformAssertionToNonAssertingTestRector.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\CreateMockToAnonymousClassRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/CreateMockToAnonymousClassRector.php', + 'Rector\\PHPUnit\\Rector\\ClassMethod\\DataProviderAnnotationToAttributeRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\DependsAnnotationWithValueToAttributeRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/DependsAnnotationWithValueToAttributeRector.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\ExceptionAnnotationRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/ExceptionAnnotationRector.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\RemoveEmptyTestMethodRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/RemoveEmptyTestMethodRector.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index e829771bda9..74be65ccd26 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInita47dd119f87e03c2c15debfad792ecd7 +class ComposerAutoloaderInit3f38aa930f66abcbdeb033aa5b78a720 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInita47dd119f87e03c2c15debfad792ecd7 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInita47dd119f87e03c2c15debfad792ecd7', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit3f38aa930f66abcbdeb033aa5b78a720', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInita47dd119f87e03c2c15debfad792ecd7', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit3f38aa930f66abcbdeb033aa5b78a720', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInita47dd119f87e03c2c15debfad792ecd7::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit3f38aa930f66abcbdeb033aa5b78a720::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInita47dd119f87e03c2c15debfad792ecd7::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit3f38aa930f66abcbdeb033aa5b78a720::$files; $requireFile = static function ($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 d3c02a92853..5a727a8fb5f 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInita47dd119f87e03c2c15debfad792ecd7 +class ComposerStaticInit3f38aa930f66abcbdeb033aa5b78a720 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -2292,6 +2292,7 @@ class ComposerStaticInita47dd119f87e03c2c15debfad792ecd7 'Rector\\PHPUnit\\PhpDoc\\PhpDocValueToNodeMapper' => __DIR__ . '/..' . '/rector/rector-phpunit/src/PhpDoc/PhpDocValueToNodeMapper.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\AddDoesNotPerformAssertionToNonAssertingTestRector' => __DIR__ . '/..' . '/rector/rector-phpunit/src/Rector/ClassMethod/AddDoesNotPerformAssertionToNonAssertingTestRector.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\CreateMockToAnonymousClassRector' => __DIR__ . '/..' . '/rector/rector-phpunit/src/Rector/ClassMethod/CreateMockToAnonymousClassRector.php', + 'Rector\\PHPUnit\\Rector\\ClassMethod\\DataProviderAnnotationToAttributeRector' => __DIR__ . '/..' . '/rector/rector-phpunit/src/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\DependsAnnotationWithValueToAttributeRector' => __DIR__ . '/..' . '/rector/rector-phpunit/src/Rector/ClassMethod/DependsAnnotationWithValueToAttributeRector.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\ExceptionAnnotationRector' => __DIR__ . '/..' . '/rector/rector-phpunit/src/Rector/ClassMethod/ExceptionAnnotationRector.php', 'Rector\\PHPUnit\\Rector\\ClassMethod\\RemoveEmptyTestMethodRector' => __DIR__ . '/..' . '/rector/rector-phpunit/src/Rector/ClassMethod/RemoveEmptyTestMethodRector.php', @@ -3082,9 +3083,9 @@ class ComposerStaticInita47dd119f87e03c2c15debfad792ecd7 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInita47dd119f87e03c2c15debfad792ecd7::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInita47dd119f87e03c2c15debfad792ecd7::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInita47dd119f87e03c2c15debfad792ecd7::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit3f38aa930f66abcbdeb033aa5b78a720::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit3f38aa930f66abcbdeb033aa5b78a720::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit3f38aa930f66abcbdeb033aa5b78a720::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f7761734888..37084d9932d 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1845,12 +1845,12 @@ "source": { "type": "git", "url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git", - "reference": "8a181e93e7db975b064b673d5553c9c073a48387" + "reference": "a2e31426b9e93623e80486bf5e49cc165089915c" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/8a181e93e7db975b064b673d5553c9c073a48387", - "reference": "8a181e93e7db975b064b673d5553c9c073a48387", + "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/a2e31426b9e93623e80486bf5e49cc165089915c", + "reference": "a2e31426b9e93623e80486bf5e49cc165089915c", "shasum": "" }, "require": { @@ -1870,13 +1870,13 @@ "rector\/rector-debugging": "dev-main", "rector\/rector-generator": "^0.6.10", "rector\/rector-src": "dev-main", - "symplify\/easy-coding-standard": "^11.0", + "symplify\/easy-coding-standard": "^11.2", "symplify\/phpstan-extensions": "^11.1", "symplify\/phpstan-rules": "^11.1", "symplify\/rule-doc-generator": "^11.1", "symplify\/vendor-patches": "^11.1" }, - "time": "2023-02-02T12:34:32+00:00", + "time": "2023-02-03T15:23:29+00:00", "default-branch": true, "type": "rector-extension", "extra": { @@ -1914,12 +1914,12 @@ "source": { "type": "git", "url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git", - "reference": "2a182490b3bfe842d6720102ac75dc7bccae481d" + "reference": "a7c960fd8036e86df5e1446b9f61302452b60741" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/2a182490b3bfe842d6720102ac75dc7bccae481d", - "reference": "2a182490b3bfe842d6720102ac75dc7bccae481d", + "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/a7c960fd8036e86df5e1446b9f61302452b60741", + "reference": "a7c960fd8036e86df5e1446b9f61302452b60741", "shasum": "" }, "require": { @@ -1948,7 +1948,7 @@ "tomasvotruba\/type-coverage": "^0.0.9", "tomasvotruba\/unused-public": "^0.0.34" }, - "time": "2023-02-02T12:34:59+00:00", + "time": "2023-02-03T16:00:40+00:00", "default-branch": true, "type": "rector-extension", "extra": { @@ -1989,12 +1989,12 @@ "source": { "type": "git", "url": "https:\/\/github.com\/rectorphp\/rector-php-parser.git", - "reference": "9ea5f622c1ed47addb197ded25a6bac39c39c596" + "reference": "ed84d2bc08ce2eb8c8860b17d1d0dc4767be6f4f" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-php-parser\/zipball\/9ea5f622c1ed47addb197ded25a6bac39c39c596", - "reference": "9ea5f622c1ed47addb197ded25a6bac39c39c596", + "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-php-parser\/zipball\/ed84d2bc08ce2eb8c8860b17d1d0dc4767be6f4f", + "reference": "ed84d2bc08ce2eb8c8860b17d1d0dc4767be6f4f", "shasum": "" }, "require": { @@ -2019,7 +2019,7 @@ "symplify\/rule-doc-generator": "^11.1", "symplify\/vendor-patches": "^11.1" }, - "time": "2022-11-14T14:42:43+00:00", + "time": "2023-02-03T15:56:36+00:00", "default-branch": true, "type": "rector-extension", "extra": { @@ -2057,12 +2057,12 @@ "source": { "type": "git", "url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git", - "reference": "3e9d821bd20e5385038788d26f00b29eea59209a" + "reference": "3d3f65dd46b15e14d819cb6ed9c70a7b73133875" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/3e9d821bd20e5385038788d26f00b29eea59209a", - "reference": "3e9d821bd20e5385038788d26f00b29eea59209a", + "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/3d3f65dd46b15e14d819cb6ed9c70a7b73133875", + "reference": "3d3f65dd46b15e14d819cb6ed9c70a7b73133875", "shasum": "" }, "require": { @@ -2076,7 +2076,7 @@ "phpstan\/phpstan": "^1.9.2", "phpstan\/phpstan-strict-rules": "^1.2", "phpstan\/phpstan-webmozart-assert": "^1.1", - "phpunit\/phpunit": "^9.5", + "phpunit\/phpunit": "^9.6", "rector\/phpstan-rules": "^0.6", "rector\/rector-debugging": "dev-main", "rector\/rector-generator": "^0.6", @@ -2088,7 +2088,7 @@ "symplify\/rule-doc-generator": "^11.1", "symplify\/vendor-patches": "^11.1" }, - "time": "2023-02-02T12:33:42+00:00", + "time": "2023-02-03T15:21:57+00:00", "default-branch": true, "type": "rector-extension", "extra": { @@ -2198,31 +2198,31 @@ }, { "name": "sebastian\/diff", - "version": "4.0.4", - "version_normalized": "4.0.4.0", + "version": "5.0.0", + "version_normalized": "5.0.0.0", "source": { "type": "git", "url": "https:\/\/github.com\/sebastianbergmann\/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "70dd1b20bc198da394ad542e988381b44e64e39f" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/sebastianbergmann\/diff\/zipball\/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https:\/\/api.github.com\/repos\/sebastianbergmann\/diff\/zipball\/70dd1b20bc198da394ad542e988381b44e64e39f", + "reference": "70dd1b20bc198da394ad542e988381b44e64e39f", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit\/phpunit": "^9.3", + "phpunit\/phpunit": "^10.0", "symfony\/process": "^4.2 || ^5" }, - "time": "2020-10-26T13:10:38+00:00", + "time": "2023-02-03T07:00:31+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "installation-source": "dist", @@ -2255,7 +2255,7 @@ ], "support": { "issues": "https:\/\/github.com\/sebastianbergmann\/diff\/issues", - "source": "https:\/\/github.com\/sebastianbergmann\/diff\/tree\/4.0.4" + "source": "https:\/\/github.com\/sebastianbergmann\/diff\/tree\/5.0.0" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index bb4fe7d7f07..295854dc6ff 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202302; -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.15.x-dev'), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.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), 'fidry/cpu-core-counter' => array('pretty_version' => '0.4.1', 'version' => '0.4.1.0', 'reference' => '79261cc280aded96d098e1b0e0ba0c4881b432c2', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.9', 'version' => '3.2.9.0', 'reference' => 'c91bac3470c34b2ecd5400f6e6fdf0b64a836a5c', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.15.3', 'version' => '4.15.3.0', 'reference' => '570e980a201d8ed0236b0a62ddf2c9cbb2034039', '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.16.0', 'version' => '1.16.0.0', 'reference' => '57090cfccbfaa639e703c007486d605a6e80f56d', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.9.14', 'version' => '1.9.14.0', 'reference' => 'e5fcc96289cf737304286a9b505fbed091f02e58', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan-phpunit' => array('pretty_version' => '1.3.3', 'version' => '1.3.3.0', 'reference' => '54a24bd23e9e80ee918cdc24f909d376c2e273f7', '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.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.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.15.x-dev', 1 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '8a181e93e7db975b064b673d5553c9c073a48387', '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' => '2a182490b3bfe842d6720102ac75dc7bccae481d', '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' => '3e9d821bd20e5385038788d26f00b29eea59209a', '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.15.x-dev'), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '545a0906a3a585f64599e95dfc97b777356626cf', '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.2.0')), 'symfony/config' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => 'f31b3c78a3650157188a240695e688d6a182aa91', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => '3e294254f2191762c1d137aed4b94e966965e985', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/contracts' => array('pretty_version' => 'v3.2.0', 'version' => '3.2.0.0', 'reference' => 'c47da22960a1eb5e39c1ad84120734e680265610', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/dependency-injection' => array('pretty_version' => 'v6.1.12', 'version' => '6.1.12.0', 'reference' => '360c9d0948e1fe675336346d5862e8e55b378d90', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dependency-injection', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.0')), 'symfony/event-dispatcher-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.0')), 'symfony/filesystem' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => 'e59e8a4006afd7f5654786a83b4fcb8da98f4593', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => 'c90dc446976a612e3312a97a6ec0069ab0c2099c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/http-client-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.0')), '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.2.0')), 'symfony/service-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0|3.0')), 'symfony/string' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => 'b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/translation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.0')), 'symplify/easy-parallel' => array('pretty_version' => '11.1.25', 'version' => '11.1.25.0', 'reference' => '9df48fbeafe281fdc3a77f0308e29ce44d9af2c4', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.1.25', 'version' => '11.1.25.0', 'reference' => '05b78c1e832bd2427af080368f2b0d886af360f8', '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.15.x-dev'), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.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), 'fidry/cpu-core-counter' => array('pretty_version' => '0.4.1', 'version' => '0.4.1.0', 'reference' => '79261cc280aded96d098e1b0e0ba0c4881b432c2', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v3.2.9', 'version' => '3.2.9.0', 'reference' => 'c91bac3470c34b2ecd5400f6e6fdf0b64a836a5c', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.15.3', 'version' => '4.15.3.0', 'reference' => '570e980a201d8ed0236b0a62ddf2c9cbb2034039', '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.16.0', 'version' => '1.16.0.0', 'reference' => '57090cfccbfaa639e703c007486d605a6e80f56d', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('pretty_version' => '1.9.14', 'version' => '1.9.14.0', 'reference' => 'e5fcc96289cf737304286a9b505fbed091f02e58', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpstan', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan-phpunit' => array('pretty_version' => '1.3.3', 'version' => '1.3.3.0', 'reference' => '54a24bd23e9e80ee918cdc24f909d376c2e273f7', '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.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.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.15.x-dev', 1 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'a2e31426b9e93623e80486bf5e49cc165089915c', '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' => 'a7c960fd8036e86df5e1446b9f61302452b60741', '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' => 'ed84d2bc08ce2eb8c8860b17d1d0dc4767be6f4f', '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' => '3d3f65dd46b15e14d819cb6ed9c70a7b73133875', '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.15.x-dev'), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '545a0906a3a585f64599e95dfc97b777356626cf', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.0.0', 'version' => '5.0.0.0', 'reference' => '70dd1b20bc198da394ad542e988381b44e64e39f', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/cache-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.0')), 'symfony/config' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => 'f31b3c78a3650157188a240695e688d6a182aa91', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => '3e294254f2191762c1d137aed4b94e966965e985', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/contracts' => array('pretty_version' => 'v3.2.0', 'version' => '3.2.0.0', 'reference' => 'c47da22960a1eb5e39c1ad84120734e680265610', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/dependency-injection' => array('pretty_version' => 'v6.1.12', 'version' => '6.1.12.0', 'reference' => '360c9d0948e1fe675336346d5862e8e55b378d90', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dependency-injection', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.0')), 'symfony/event-dispatcher-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.0')), 'symfony/filesystem' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => 'e59e8a4006afd7f5654786a83b4fcb8da98f4593', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => 'c90dc446976a612e3312a97a6ec0069ab0c2099c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/http-client-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.0')), '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.2.0')), 'symfony/service-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0|3.0')), 'symfony/string' => array('pretty_version' => 'v6.2.5', 'version' => '6.2.5.0', 'reference' => 'b2dac0fa27b1ac0f9c0c0b23b43977f12308d0b0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/translation-contracts' => array('dev_requirement' => \false, 'replaced' => array(0 => 'v3.2.0')), 'symplify/easy-parallel' => array('pretty_version' => '11.1.25', 'version' => '11.1.25.0', 'reference' => '9df48fbeafe281fdc3a77f0308e29ce44d9af2c4', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.1.25', 'version' => '11.1.25.0', 'reference' => '05b78c1e832bd2427af080368f2b0d886af360f8', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); diff --git a/vendor/rector/extension-installer/src/GeneratedConfig.php b/vendor/rector/extension-installer/src/GeneratedConfig.php index 9535f6d2a93..d7b3c26b678 100644 --- a/vendor/rector/extension-installer/src/GeneratedConfig.php +++ b/vendor/rector/extension-installer/src/GeneratedConfig.php @@ -9,7 +9,7 @@ namespace Rector\RectorInstaller; */ final class GeneratedConfig { - public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 8a181e9'), '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 2a18249'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9ea5f62'), '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 3e9d821'), '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 545a090')); + 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 a2e3142'), '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 a7c960f'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ed84d2b'), '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 3d3f65d'), '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 545a090')); private function __construct() { } diff --git a/vendor/rector/rector-doctrine/composer.json b/vendor/rector/rector-doctrine/composer.json index 17833247849..c2a905d89c7 100644 --- a/vendor/rector/rector-doctrine/composer.json +++ b/vendor/rector/rector-doctrine/composer.json @@ -13,7 +13,7 @@ "phpunit\/phpunit": "^9.5", "symplify\/phpstan-rules": "^11.1", "symplify\/phpstan-extensions": "^11.1", - "symplify\/easy-coding-standard": "^11.0", + "symplify\/easy-coding-standard": "^11.2", "symplify\/rule-doc-generator": "^11.1", "rector\/rector-src": "dev-main", "doctrine\/orm": "^2.10", diff --git a/vendor/rector/rector-phpunit/composer.json b/vendor/rector/rector-phpunit/composer.json index 57b9403c0f0..752ce128dff 100644 --- a/vendor/rector/rector-phpunit/composer.json +++ b/vendor/rector/rector-phpunit/composer.json @@ -8,7 +8,7 @@ }, "require-dev": { "rector\/rector-src": "dev-main", - "phpunit\/phpunit": "^9.5", + "phpunit\/phpunit": "^9.6", "phpstan\/phpstan": "^1.9.2", "symplify\/phpstan-rules": "^11.1", "symplify\/phpstan-extensions": "^11.1", diff --git a/vendor/rector/rector-phpunit/config/sets/annotations-to-attributes.php b/vendor/rector/rector-phpunit/config/sets/annotations-to-attributes.php index e3ff0dca66f..5ccba63a19a 100644 --- a/vendor/rector/rector-phpunit/config/sets/annotations-to-attributes.php +++ b/vendor/rector/rector-phpunit/config/sets/annotations-to-attributes.php @@ -8,10 +8,12 @@ use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; use Rector\Php80\ValueObject\AnnotationToAttribute; use Rector\PHPUnit\Rector\Class_\AnnotationWithValueToAttributeRector; use Rector\PHPUnit\Rector\Class_\CoversAnnotationWithValueToAttributeRector; +use Rector\PHPUnit\Rector\ClassMethod\DataProviderAnnotationToAttributeRector; use Rector\PHPUnit\Rector\ClassMethod\DependsAnnotationWithValueToAttributeRector; use Rector\PHPUnit\ValueObject\AnnotationWithValueToAttribute; return static function (RectorConfig $rectorConfig) : void { $rectorConfig->rules([ + DataProviderAnnotationToAttributeRector::class, CoversAnnotationWithValueToAttributeRector::class, /** * Currently handle: @@ -25,7 +27,7 @@ return static function (RectorConfig $rectorConfig) : void { */ DependsAnnotationWithValueToAttributeRector::class, ]); - $rectorConfig->ruleWithConfiguration(AnnotationWithValueToAttributeRector::class, [new AnnotationWithValueToAttribute('backupGlobals', 'PHPUnit\\Framework\\Attributes\\BackupGlobals', ['enabled' => \true, 'disabled' => \false]), new AnnotationWithValueToAttribute('backupStaticAttributes', 'PHPUnit\\Framework\\Attributes\\BackupStaticProperties', ['enabled' => \true, 'disabled' => \false]), new AnnotationWithValueToAttribute('preserveGlobalState', 'PHPUnit\\Framework\\Attributes\\PreserveGlobalState', ['enabled' => \true, 'disabled' => \false]), new AnnotationWithValueToAttribute('dataProvider', 'PHPUnit\\Framework\\Attributes\\DataProvider'), new AnnotationWithValueToAttribute('depends', 'PHPUnit\\Framework\\Attributes\\Depends'), new AnnotationWithValueToAttribute('group', 'PHPUnit\\Framework\\Attributes\\Group'), new AnnotationWithValueToAttribute('ticket', 'PHPUnit\\Framework\\Attributes\\Ticket'), new AnnotationWithValueToAttribute('uses', 'PHPUnit\\Framework\\Attributes\\UsesClass'), new AnnotationWithValueToAttribute('testWith', 'PHPUnit\\Framework\\Attributes\\TestWith'), new AnnotationWithValueToAttribute('testDox', 'PHPUnit\\Framework\\Attributes\\TestDox')]); + $rectorConfig->ruleWithConfiguration(AnnotationWithValueToAttributeRector::class, [new AnnotationWithValueToAttribute('backupGlobals', 'PHPUnit\\Framework\\Attributes\\BackupGlobals', ['enabled' => \true, 'disabled' => \false]), new AnnotationWithValueToAttribute('backupStaticAttributes', 'PHPUnit\\Framework\\Attributes\\BackupStaticProperties', ['enabled' => \true, 'disabled' => \false]), new AnnotationWithValueToAttribute('preserveGlobalState', 'PHPUnit\\Framework\\Attributes\\PreserveGlobalState', ['enabled' => \true, 'disabled' => \false]), new AnnotationWithValueToAttribute('depends', 'PHPUnit\\Framework\\Attributes\\Depends'), new AnnotationWithValueToAttribute('group', 'PHPUnit\\Framework\\Attributes\\Group'), new AnnotationWithValueToAttribute('ticket', 'PHPUnit\\Framework\\Attributes\\Ticket'), new AnnotationWithValueToAttribute('uses', 'PHPUnit\\Framework\\Attributes\\UsesClass'), new AnnotationWithValueToAttribute('testWith', 'PHPUnit\\Framework\\Attributes\\TestWith'), new AnnotationWithValueToAttribute('testDox', 'PHPUnit\\Framework\\Attributes\\TestDox')]); $rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [ // @see https://github.com/sebastianbergmann/phpunit/issues/4502 new AnnotationToAttribute('after', 'PHPUnit\\Framework\\Attributes\\After'), diff --git a/vendor/rector/rector-phpunit/src/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php b/vendor/rector/rector-phpunit/src/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php new file mode 100644 index 00000000000..bf4771918a0 --- /dev/null +++ b/vendor/rector/rector-phpunit/src/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php @@ -0,0 +1,123 @@ +testsNodeAnalyzer = $testsNodeAnalyzer; + $this->phpAttributeGroupFactory = $phpAttributeGroupFactory; + $this->phpDocTagRemover = $phpDocTagRemover; + } + public function getRuleDefinition() : RuleDefinition + { + return new RuleDefinition('Change dataProvider annotations to attribute', [new CodeSample(<<<'CODE_SAMPLE' +use PHPUnit\Framework\TestCase; + +final class SomeTest extends TestCase +{ + /** + * @dataProvider someMethod() + */ + public function test(): void + { + } +} +CODE_SAMPLE +, <<<'CODE_SAMPLE' +use PHPUnit\Framework\TestCase; + +final class SomeTest extends TestCase +{ + #[\PHPUnit\Framework\Attributes\DataProvider('test')] + public function test(): void + { + } +} +CODE_SAMPLE +)]); + } + /** + * @return array> + */ + public function getNodeTypes() : array + { + return [ClassMethod::class]; + } + public function provideMinPhpVersion() : int + { + return PhpVersionFeature::ATTRIBUTES; + } + /** + * @param ClassMethod $node + */ + public function refactor(Node $node) : ?Node + { + if (!$this->testsNodeAnalyzer->isInTestClass($node)) { + return null; + } + $phpDocInfo = $this->phpDocInfoFactory->createFromNode($node); + if (!$phpDocInfo instanceof PhpDocInfo) { + return null; + } + /** @var PhpDocTagNode[] $desiredTagValueNodes */ + $desiredTagValueNodes = $phpDocInfo->getTagsByName('dataProvider'); + if ($desiredTagValueNodes === []) { + return null; + } + $currentClass = $node->getAttribute(AttributeKey::PARENT_NODE); + if (!$currentClass instanceof Class_) { + return null; + } + foreach ($desiredTagValueNodes as $desiredTagValueNode) { + if (!$desiredTagValueNode->value instanceof GenericTagValueNode) { + continue; + } + $originalAttributeValue = $desiredTagValueNode->value->value; + $methodName = \trim($originalAttributeValue, '()'); + $attributeGroup = $this->phpAttributeGroupFactory->createFromClassWithItems('PHPUnit\\Framework\\Attributes\\DataProvider', [$methodName]); + $node->attrGroups[] = $attributeGroup; + // cleanup + $this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $desiredTagValueNode); + } + if (!$phpDocInfo->hasChanged()) { + return null; + } + return $node; + } +} diff --git a/vendor/sebastian/diff/ChangeLog.md b/vendor/sebastian/diff/ChangeLog.md index 9bdcc5b6d72..7db073c781a 100644 --- a/vendor/sebastian/diff/ChangeLog.md +++ b/vendor/sebastian/diff/ChangeLog.md @@ -2,6 +2,16 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [5.0.0] - 2022-02-03 + +### Changed + +* Passing a `DiffOutputBuilderInterface` instance to `Differ::__construct()` is no longer optional + +### Removed + +* Removed support for PHP 7.3, PHP 7.4, and PHP 8.0 + ## [4.0.4] - 2020-10-26 ### Fixed @@ -76,6 +86,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 5.6 +[5.0.0]: https://github.com/sebastianbergmann/diff/compare/4.0.4...5.0.0 [4.0.4]: https://github.com/sebastianbergmann/diff/compare/4.0.3...4.0.4 [4.0.3]: https://github.com/sebastianbergmann/diff/compare/4.0.2...4.0.3 [4.0.2]: https://github.com/sebastianbergmann/diff/compare/4.0.1...4.0.2 diff --git a/vendor/sebastian/diff/LICENSE b/vendor/sebastian/diff/LICENSE index f22f31cf0cf..a453252d525 100644 --- a/vendor/sebastian/diff/LICENSE +++ b/vendor/sebastian/diff/LICENSE @@ -1,33 +1,29 @@ -sebastian/diff +BSD 3-Clause License -Copyright (c) 2002-2020, Sebastian Bergmann . +Copyright (c) 2002-2023, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: +modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. - * Neither the name of Sebastian Bergmann nor the names of his - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/sebastian/diff/README.md b/vendor/sebastian/diff/README.md index 734b852de7c..3e84a35b4ff 100644 --- a/vendor/sebastian/diff/README.md +++ b/vendor/sebastian/diff/README.md @@ -1,7 +1,9 @@ -# sebastian/diff - +[![Latest Stable Version](https://poser.pugx.org/sebastian/diff/v/stable.png)](https://packagist.org/packages/sebastian/diff) [![CI Status](https://github.com/sebastianbergmann/diff/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/diff/actions) [![Type Coverage](https://shepherd.dev/github/sebastianbergmann/diff/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/diff) +[![codecov](https://codecov.io/gh/sebastianbergmann/diff/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/diff) + +# sebastian/diff Diff implementation for PHP, factored out of PHPUnit into a stand-alone component. @@ -78,9 +80,9 @@ $builder = new StrictUnifiedDiffOutputBuilder([ 'collapseRanges' => true, // ranges of length one are rendered with the trailing `,1` 'commonLineThreshold' => 6, // number of same lines before ending a new hunk and creating a new one (if needed) 'contextLines' => 3, // like `diff: -u, -U NUM, --unified[=NUM]`, for patch/git apply compatibility best to keep at least @ 3 - 'fromFile' => null, + 'fromFile' => '', 'fromFileDate' => null, - 'toFile' => null, + 'toFile' => '', 'toFileDate' => null, ]); diff --git a/vendor/sebastian/diff/SECURITY.md b/vendor/sebastian/diff/SECURITY.md new file mode 100644 index 00000000000..d4ee967bfd2 --- /dev/null +++ b/vendor/sebastian/diff/SECURITY.md @@ -0,0 +1,9 @@ +# Security Policy + +This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. + +**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** + +## Security Contact Information + +After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/diff/composer.json b/vendor/sebastian/diff/composer.json index 26cf7cd9c81..677403d9307 100644 --- a/vendor/sebastian/diff/composer.json +++ b/vendor/sebastian/diff/composer.json @@ -22,16 +22,16 @@ "prefer-stable": true, "config": { "platform": { - "php": "7.3.0" + "php": "8.1.0" }, "optimize-autoloader": true, "sort-packages": true }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit\/phpunit": "^9.3", + "phpunit\/phpunit": "^10.0", "symfony\/process": "^4.2 || ^5" }, "autoload": { @@ -46,7 +46,7 @@ }, "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } } } \ No newline at end of file diff --git a/vendor/sebastian/diff/src/Chunk.php b/vendor/sebastian/diff/src/Chunk.php index efb2bedbee4..21bb1e3f82a 100644 --- a/vendor/sebastian/diff/src/Chunk.php +++ b/vendor/sebastian/diff/src/Chunk.php @@ -30,7 +30,7 @@ final class Chunk */ private $endRange; /** - * @var Line[] + * @var mixed[] */ private $lines; public function __construct(int $start = 0, int $startRange = 1, int $end = 0, int $endRange = 1, array $lines = []) @@ -58,14 +58,14 @@ final class Chunk return $this->endRange; } /** - * @return Line[] + * @psalm-return list */ public function getLines() : array { return $this->lines; } /** - * @param Line[] $lines + * @psalm-param list $lines */ public function setLines(array $lines) : void { diff --git a/vendor/sebastian/diff/src/Diff.php b/vendor/sebastian/diff/src/Diff.php index e5ee0bb02cc..874df71195a 100644 --- a/vendor/sebastian/diff/src/Diff.php +++ b/vendor/sebastian/diff/src/Diff.php @@ -22,11 +22,12 @@ final class Diff */ private $to; /** - * @var Chunk[] + * @psalm-var list + * @var mixed[] */ private $chunks; /** - * @param Chunk[] $chunks + * @psalm-param list $chunks */ public function __construct(string $from, string $to, array $chunks = []) { @@ -43,14 +44,14 @@ final class Diff return $this->to; } /** - * @return Chunk[] + * @psalm-return list */ public function getChunks() : array { return $this->chunks; } /** - * @param Chunk[] $chunks + * @psalm-param list $chunks */ public function setChunks(array $chunks) : void { diff --git a/vendor/sebastian/diff/src/Differ.php b/vendor/sebastian/diff/src/Differ.php index 0e96c26b653..5a8fdb769cf 100644 --- a/vendor/sebastian/diff/src/Differ.php +++ b/vendor/sebastian/diff/src/Differ.php @@ -20,20 +20,15 @@ use function array_values; use function count; use function current; use function end; -use function get_class; -use function gettype; -use function is_array; -use function is_object; use function is_string; use function key; use function min; use function preg_split; use function prev; use function reset; -use function sprintf; +use function str_ends_with; use function substr; use RectorPrefix202302\SebastianBergmann\Diff\Output\DiffOutputBuilderInterface; -use RectorPrefix202302\SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder; final class Differ { public const OLD = 0; @@ -42,66 +37,33 @@ final class Differ public const DIFF_LINE_END_WARNING = 3; public const NO_LINE_END_EOF_WARNING = 4; /** - * @var DiffOutputBuilderInterface + * @var \SebastianBergmann\Diff\Output\DiffOutputBuilderInterface */ private $outputBuilder; - /** - * @param DiffOutputBuilderInterface $outputBuilder - * - * @throws InvalidArgumentException - */ - public function __construct($outputBuilder = null) + public function __construct(DiffOutputBuilderInterface $outputBuilder) { - if ($outputBuilder instanceof DiffOutputBuilderInterface) { - $this->outputBuilder = $outputBuilder; - } elseif (null === $outputBuilder) { - $this->outputBuilder = new UnifiedDiffOutputBuilder(); - } elseif (is_string($outputBuilder)) { - // PHPUnit 6.1.4, 6.2.0, 6.2.1, 6.2.2, and 6.2.3 support - // @see https://github.com/sebastianbergmann/phpunit/issues/2734#issuecomment-314514056 - // @deprecated - $this->outputBuilder = new UnifiedDiffOutputBuilder($outputBuilder); - } else { - throw new InvalidArgumentException(sprintf('Expected builder to be an instance of DiffOutputBuilderInterface, or a string, got %s.', is_object($outputBuilder) ? 'instance of "' . get_class($outputBuilder) . '"' : gettype($outputBuilder) . ' "' . $outputBuilder . '"')); - } + $this->outputBuilder = $outputBuilder; } /** - * Returns the diff between two arrays or strings as string. - * - * @param array|string $from - * @param array|string $to + * @param mixed[]|string $from + * @param mixed[]|string $to */ public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null) : string { - $diff = $this->diffToArray($this->normalizeDiffInput($from), $this->normalizeDiffInput($to), $lcs); + $diff = $this->diffToArray($from, $to, $lcs); return $this->outputBuilder->getDiff($diff); } /** - * Returns the diff between two arrays or strings as array. - * - * Each array element contains two elements: - * - [0] => mixed $token - * - [1] => 2|1|0 - * - * - 2: REMOVED: $token was removed from $from - * - 1: ADDED: $token was added to $from - * - 0: OLD: $token is not changed in $to - * - * @param array|string $from - * @param array|string $to - * @param LongestCommonSubsequenceCalculator $lcs + * @param mixed[]|string $from + * @param mixed[]|string $to */ public function diffToArray($from, $to, LongestCommonSubsequenceCalculator $lcs = null) : array { if (is_string($from)) { $from = $this->splitStringByLines($from); - } elseif (!is_array($from)) { - throw new InvalidArgumentException('"from" must be an array or string.'); } if (is_string($to)) { $to = $this->splitStringByLines($to); - } elseif (!is_array($to)) { - throw new InvalidArgumentException('"to" must be an array or string.'); } [$from, $to, $start, $end] = self::getArrayDiffParted($from, $to); if ($lcs === null) { @@ -139,21 +101,6 @@ final class Differ } return $diff; } - /** - * Casts variable to string if it is not a string or array. - * - * @return array|string - */ - private function normalizeDiffInput($input) - { - if (!is_array($input) && !is_string($input)) { - return (string) $input; - } - return $input; - } - /** - * Checks if input is string, if so it will split it line-by-line. - */ private function splitStringByLines(string $input) : array { return preg_split('/(.*\\R)/', $input, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); @@ -171,8 +118,6 @@ final class Differ return new TimeEfficientLongestCommonSubsequenceCalculator(); } /** - * Calculates the estimated memory footprint for the DP-based method. - * * @return float|int */ private function calculateEstimatedFootprint(array $from, array $to) @@ -180,9 +125,6 @@ final class Differ $itemSize = PHP_INT_SIZE === 4 ? 76 : 144; return $itemSize * min(count($from), count($to)) ** 2; } - /** - * Returns true if line ends don't match in a diff. - */ private function detectUnmatchedLineEndings(array $diff) : bool { $newLineBreaks = ['' => \true]; @@ -202,7 +144,7 @@ final class Differ if (['' => \true] === $newLineBreaks || ['' => \true] === $oldLineBreaks) { return \false; } - // two way compare + // two-way compare foreach ($newLineBreaks as $break => $set) { if (!isset($oldLineBreaks[$break])) { return \true; @@ -227,7 +169,7 @@ final class Differ if ("\n" !== $lc) { return ''; } - if ("\r\n" === substr($line, -2)) { + if (\substr_compare($line, "\r\n", -\strlen("\r\n")) === 0) { return "\r\n"; } return "\n"; diff --git a/vendor/sebastian/diff/src/Exception/ConfigurationException.php b/vendor/sebastian/diff/src/Exception/ConfigurationException.php index 0cbd10351a1..1221d182c7f 100644 --- a/vendor/sebastian/diff/src/Exception/ConfigurationException.php +++ b/vendor/sebastian/diff/src/Exception/ConfigurationException.php @@ -11,7 +11,6 @@ declare (strict_types=1); */ namespace RectorPrefix202302\SebastianBergmann\Diff; -use function get_class; use function gettype; use function is_object; use function sprintf; @@ -20,6 +19,6 @@ final class ConfigurationException extends InvalidArgumentException { public function __construct(string $option, string $expected, $value, int $code = 0, Exception $previous = null) { - parent::__construct(sprintf('Option "%s" must be %s, got "%s".', $option, $expected, is_object($value) ? get_class($value) : (null === $value ? '' : gettype($value) . '#' . $value)), $code, $previous); + parent::__construct(sprintf('Option "%s" must be %s, got "%s".', $option, $expected, is_object($value) ? \get_class($value) : (null === $value ? '' : gettype($value) . '#' . $value)), $code, $previous); } } diff --git a/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php index 0479ec0241a..8d341a5b6be 100644 --- a/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php +++ b/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php @@ -21,7 +21,7 @@ use function max; final class MemoryEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator { /** - * {@inheritdoc} + * @inheritDoc */ public function calculate(array $from, array $to) : array { diff --git a/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php b/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php index 97b887a4428..2875c0c10ba 100644 --- a/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php +++ b/vendor/sebastian/diff/src/Output/AbstractChunkOutputBuilder.php @@ -25,14 +25,14 @@ abstract class AbstractChunkOutputBuilder implements DiffOutputBuilderInterface $chunkStart = 0; $chunkSize = 0; $commonChunks = []; - for ($i = 0; $i < $diffSize; ++$i) { + for ($i = 0; $i < $diffSize; $i++) { if ($diff[$i][1] === 0) { if ($capturing === \false) { $capturing = \true; $chunkStart = $i; $chunkSize = 0; } else { - ++$chunkSize; + $chunkSize++; } } elseif ($capturing !== \false) { if ($chunkSize >= $lineThreshold) { diff --git a/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php b/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php index 942dac0e3ce..e3940563191 100644 --- a/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php +++ b/vendor/sebastian/diff/src/Output/DiffOnlyOutputBuilder.php @@ -14,6 +14,7 @@ namespace RectorPrefix202302\SebastianBergmann\Diff\Output; use function fclose; use function fopen; use function fwrite; +use function str_ends_with; use function stream_get_contents; use function substr; use RectorPrefix202302\SebastianBergmann\Diff\Differ; @@ -36,7 +37,7 @@ final class DiffOnlyOutputBuilder implements DiffOutputBuilderInterface $buffer = fopen('php://memory', 'r+b'); if ('' !== $this->header) { fwrite($buffer, $this->header); - if ("\n" !== substr($this->header, -1, 1)) { + if (\substr_compare($this->header, "\n", -\strlen("\n")) !== 0) { fwrite($buffer, "\n"); } } @@ -52,7 +53,7 @@ final class DiffOnlyOutputBuilder implements DiffOutputBuilderInterface } else { /* Not changed (old) 0 */ continue; - // we didn't write the non changs line, so do not add a line break either + // we didn't write the not-changed line, so do not add a line break either } $lc = substr($diffEntry[0], -1); if ($lc !== "\n" && $lc !== "\r") { diff --git a/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php b/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php index c8d7572b548..a6e819f7a3e 100644 --- a/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php +++ b/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php @@ -34,6 +34,9 @@ use RectorPrefix202302\SebastianBergmann\Diff\Differ; */ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface { + /** + * @var mixed[] + */ private static $default = [ 'collapseRanges' => \true, // ranges of length one are rendered with the trailing `,1` @@ -55,7 +58,8 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface */ private $collapseRanges; /** - * @var int >= 0 + * @psalm-var positive-int + * @var int */ private $commonLineThreshold; /** @@ -63,7 +67,8 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface */ private $header; /** - * @var int >= 0 + * @psalm-var positive-int + * @var int */ private $contextLines; public function __construct(array $options = []) @@ -118,9 +123,9 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface } } else { // search back for the last `+` and `-` line, - // check if has trailing linebreak, else add under it warning under it + // check if it has a trailing linebreak, else add a warning under it $toFind = [1 => \true, 2 => \true]; - for ($i = $upperLimit - 1; $i >= 0; --$i) { + for ($i = $upperLimit - 1; $i >= 0; $i--) { if (isset($toFind[$diff[$i][1]])) { unset($toFind[$diff[$i][1]]); $lc = substr($diff[$i][0], -1); @@ -144,13 +149,13 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface if (0 === $entry[1]) { // same if (\false === $hunkCapture) { - ++$fromStart; - ++$toStart; + $fromStart++; + $toStart++; continue; } - ++$sameCount; - ++$toRange; - ++$fromRange; + $sameCount++; + $toRange++; + $fromRange++; if ($sameCount === $cutOff) { $contextStartOffset = $hunkCapture - $this->contextLines < 0 ? $hunkCapture : $this->contextLines; // note: $contextEndOffset = $this->contextLines; @@ -181,17 +186,17 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface } if (Differ::ADDED === $entry[1]) { // added - ++$toRange; + $toRange++; } if (Differ::REMOVED === $entry[1]) { // removed - ++$fromRange; + $fromRange++; } } if (\false === $hunkCapture) { return; } - // we end here when cutoff (commonLineThreshold) was not reached, but we where capturing a hunk, + // we end here when cutoff (commonLineThreshold) was not reached, but we were capturing a hunk, // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold $contextStartOffset = $hunkCapture - $this->contextLines < 0 ? $hunkCapture : $this->contextLines; // prevent trying to write out more common lines than there are in the diff _and_ @@ -212,7 +217,7 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface fwrite($output, ',' . $toRange); } fwrite($output, " @@\n"); - for ($i = $diffStartIndex; $i < $diffEndIndex; ++$i) { + for ($i = $diffStartIndex; $i < $diffEndIndex; $i++) { if ($diff[$i][1] === Differ::ADDED) { $this->changed = \true; fwrite($output, '+' . $diff[$i][0]); diff --git a/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php b/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php index dcd97c38029..ba76afab4e2 100644 --- a/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php +++ b/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php @@ -18,6 +18,7 @@ use function fopen; use function fwrite; use function max; use function min; +use function str_ends_with; use function stream_get_contents; use function strlen; use function substr; @@ -32,11 +33,12 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder */ private $collapseRanges = \true; /** - * @var int >= 0 + * @var int */ private $commonLineThreshold = 6; /** - * @var int >= 0 + * @psalm-var positive-int + * @var int */ private $contextLines = 3; /** @@ -57,7 +59,7 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder $buffer = fopen('php://memory', 'r+b'); if ('' !== $this->header) { fwrite($buffer, $this->header); - if ("\n" !== substr($this->header, -1, 1)) { + if (\substr_compare($this->header, "\n", -strlen("\n")) !== 0) { fwrite($buffer, "\n"); } } @@ -82,9 +84,9 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder } } else { // search back for the last `+` and `-` line, - // check if has trailing linebreak, else add under it warning under it + // check if it has trailing linebreak, else add a warning under it $toFind = [1 => \true, 2 => \true]; - for ($i = $upperLimit - 1; $i >= 0; --$i) { + for ($i = $upperLimit - 1; $i >= 0; $i--) { if (isset($toFind[$diff[$i][1]])) { unset($toFind[$diff[$i][1]]); $lc = substr($diff[$i][0], -1); @@ -108,13 +110,13 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder if (0 === $entry[1]) { // same if (\false === $hunkCapture) { - ++$fromStart; - ++$toStart; + $fromStart++; + $toStart++; continue; } - ++$sameCount; - ++$toRange; - ++$fromRange; + $sameCount++; + $toRange++; + $fromRange++; if ($sameCount === $cutOff) { $contextStartOffset = $hunkCapture - $this->contextLines < 0 ? $hunkCapture : $this->contextLines; // note: $contextEndOffset = $this->contextLines; @@ -143,16 +145,16 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder $hunkCapture = $i; } if (Differ::ADDED === $entry[1]) { - ++$toRange; + $toRange++; } if (Differ::REMOVED === $entry[1]) { - ++$fromRange; + $fromRange++; } } if (\false === $hunkCapture) { return; } - // we end here when cutoff (commonLineThreshold) was not reached, but we where capturing a hunk, + // we end here when cutoff (commonLineThreshold) was not reached, but we were capturing a hunk, // do not render hunk till end automatically because the number of context lines might be less than the commonLineThreshold $contextStartOffset = $hunkCapture - $this->contextLines < 0 ? $hunkCapture : $this->contextLines; // prevent trying to write out more common lines than there are in the diff _and_ @@ -177,7 +179,7 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder } else { fwrite($output, "@@ @@\n"); } - for ($i = $diffStartIndex; $i < $diffEndIndex; ++$i) { + for ($i = $diffStartIndex; $i < $diffEndIndex; $i++) { if ($diff[$i][1] === Differ::ADDED) { fwrite($output, '+' . $diff[$i][0]); } elseif ($diff[$i][1] === Differ::REMOVED) { diff --git a/vendor/sebastian/diff/src/Parser.php b/vendor/sebastian/diff/src/Parser.php index d64852aedba..88a53163942 100644 --- a/vendor/sebastian/diff/src/Parser.php +++ b/vendor/sebastian/diff/src/Parser.php @@ -34,7 +34,7 @@ final class Parser $diffs = []; $diff = null; $collected = []; - for ($i = 0; $i < $lineCount; ++$i) { + for ($i = 0; $i < $lineCount; $i++) { if (preg_match('#^---\\h+"?(?P[^\\v\\t"]+)#', $lines[$i], $fromMatch) && preg_match('#^\\+\\+\\+\\h+"?(?P[^\\v\\t"]+)#', $lines[$i + 1], $toMatch)) { if ($diff !== null) { $this->parseFileDiff($diff, $collected); @@ -42,9 +42,9 @@ final class Parser $collected = []; } $diff = new Diff($fromMatch['file'], $toMatch['file']); - ++$i; + $i++; } else { - if (preg_match('/^(?:diff --git |index [\\da-f\\.]+|[+-]{3} [ab])/', $lines[$i])) { + if (preg_match('/^(?:diff --git |index [\\da-f.]+|[+-]{3} [ab])/', $lines[$i])) { continue; } $collected[] = $lines[$i]; @@ -76,9 +76,7 @@ final class Parser $type = Line::REMOVED; } $diffLines[] = new Line($type, $match['line']); - if (null !== $chunk) { - $chunk->setLines($diffLines); - } + ($chunk2 = $chunk) ? $chunk2->setLines($diffLines) : null; } } $diff->setChunks($chunks); diff --git a/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php index cce803e0975..ddcf7c3827a 100644 --- a/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php +++ b/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php @@ -18,7 +18,7 @@ use SplFixedArray; final class TimeEfficientLongestCommonSubsequenceCalculator implements LongestCommonSubsequenceCalculator { /** - * {@inheritdoc} + * @inheritDoc */ public function calculate(array $from, array $to) : array { @@ -27,14 +27,14 @@ final class TimeEfficientLongestCommonSubsequenceCalculator implements LongestCo $toLength = count($to); $width = $fromLength + 1; $matrix = new SplFixedArray($width * ($toLength + 1)); - for ($i = 0; $i <= $fromLength; ++$i) { + for ($i = 0; $i <= $fromLength; $i++) { $matrix[$i] = 0; } - for ($j = 0; $j <= $toLength; ++$j) { + for ($j = 0; $j <= $toLength; $j++) { $matrix[$j * $width] = 0; } - for ($i = 1; $i <= $fromLength; ++$i) { - for ($j = 1; $j <= $toLength; ++$j) { + for ($i = 1; $i <= $fromLength; $i++) { + for ($j = 1; $j <= $toLength; $j++) { $o = $j * $width + $i; $matrix[$o] = max($matrix[$o - 1], $matrix[$o - $width], $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0); } @@ -44,14 +44,14 @@ final class TimeEfficientLongestCommonSubsequenceCalculator implements LongestCo while ($i > 0 && $j > 0) { if ($from[$i - 1] === $to[$j - 1]) { $common[] = $from[$i - 1]; - --$i; - --$j; + $i--; + $j--; } else { $o = $j * $width + $i; if ($matrix[$o - $width] > $matrix[$o - 1]) { - --$j; + $j--; } else { - --$i; + $i--; } } }