mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 13:28:18 +01:00
Updated Rector to commit 6fa3ade0c296e366490d1e4bcc642dc53ad92674
6fa3ade0c2
[tests] Keep original methods naming for easier upgrade (#2893)
This commit is contained in:
parent
277e853737
commit
eea65cd62a
@ -22,7 +22,7 @@ final class RenameSimpleRectorTest extends AbstractRectorTestCase
|
||||
*/
|
||||
public function provideData(): Iterator
|
||||
{
|
||||
return $this->yieldFilePathsFromDirectory(__DIR__ . '/Fixture');
|
||||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
public function provideConfigFilePath(): string
|
||||
|
@ -11,20 +11,12 @@ final class FixtureFileFinder
|
||||
/**
|
||||
* @return Iterator<array<int, string>>
|
||||
*/
|
||||
public static function yieldFilePathsFromDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
|
||||
public static function yieldDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
|
||||
{
|
||||
$fileInfos = self::findFilesInDirectory($directory, $suffix);
|
||||
$finder = (new Finder())->in($directory)->files()->name($suffix);
|
||||
$fileInfos = \iterator_to_array($finder);
|
||||
foreach ($fileInfos as $fileInfo) {
|
||||
(yield [$fileInfo->getRealPath()]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @return SplFileInfo[]
|
||||
*/
|
||||
private static function findFilesInDirectory(string $directory, string $suffix) : array
|
||||
{
|
||||
$finder = (new Finder())->in($directory)->files()->name($suffix);
|
||||
$fileInfos = \iterator_to_array($finder);
|
||||
return \array_values($fileInfos);
|
||||
}
|
||||
}
|
||||
|
@ -78,18 +78,19 @@ abstract class AbstractRectorTestCase extends \Rector\Testing\PHPUnit\AbstractTe
|
||||
\gc_collect_cycles();
|
||||
}
|
||||
/**
|
||||
* @deprecated Use \Rector\Testing\PHPUnit\AbstractRectorTestCase::yieldFilePathsFromDirectory() instead
|
||||
* @return Iterator<<string>>
|
||||
*/
|
||||
protected function yieldFilesFromDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
|
||||
{
|
||||
return FixtureFileFinder::yieldDirectory($directory, $suffix);
|
||||
}
|
||||
/**
|
||||
* @return Iterator<<string>>
|
||||
* @api
|
||||
* @deprecated BC alias for yieldFilesFromDirectory()
|
||||
*/
|
||||
protected function yieldFilePathsFromDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
|
||||
{
|
||||
return FixtureFileFinder::yieldFilePathsFromDirectory($directory, $suffix);
|
||||
return $this->yieldFilesFromDirectory($directory, $suffix);
|
||||
}
|
||||
protected function isWindows() : bool
|
||||
{
|
||||
|
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'dc22a952fe92e3574a27c8e9e7de3d9aead42a4f';
|
||||
public const PACKAGE_VERSION = '6fa3ade0c296e366490d1e4bcc642dc53ad92674';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-09-02 05:01:35';
|
||||
public const RELEASE_DATE = '2022-09-02 10:22:13';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf::getLoader();
|
||||
return ComposerAutoloaderInitb7a113089e4ddeef65b82e292dc4be93::getLoader();
|
||||
|
24
vendor/composer/autoload_classmap.php
vendored
24
vendor/composer/autoload_classmap.php
vendored
@ -1039,30 +1039,6 @@ return array(
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\ValueObject\\ParallelProcess' => $vendorDir . '/symplify/easy-parallel/src/ValueObject/ParallelProcess.php',
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\ValueObject\\ProcessPool' => $vendorDir . '/symplify/easy-parallel/src/ValueObject/ProcessPool.php',
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\ValueObject\\Schedule' => $vendorDir . '/symplify/easy-parallel/src/ValueObject/Schedule.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Composer\\VendorDirProvider' => $vendorDir . '/symplify/package-builder/src/Composer/VendorDirProvider.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Configuration\\StaticEolConfiguration' => $vendorDir . '/symplify/package-builder/src/Configuration/StaticEolConfiguration.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Command\\AbstractSymplifyCommand' => $vendorDir . '/symplify/package-builder/src/Console/Command/AbstractSymplifyCommand.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Formatter\\ColorConsoleDiffFormatter' => $vendorDir . '/symplify/package-builder/src/Console/Formatter/ColorConsoleDiffFormatter.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Input\\StaticInputDetector' => $vendorDir . '/symplify/package-builder/src/Console/Input/StaticInputDetector.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Output\\ConsoleDiffer' => $vendorDir . '/symplify/package-builder/src/Console/Output/ConsoleDiffer.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Style\\SymfonyStyleFactory' => $vendorDir . '/symplify/package-builder/src/Console/Style/SymfonyStyleFactory.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\DependencyInjection\\CompilerPass\\AutowireInterfacesCompilerPass' => $vendorDir . '/symplify/package-builder/src/DependencyInjection/CompilerPass/AutowireInterfacesCompilerPass.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\DependencyInjection\\FileLoader\\ParameterMergingPhpFileLoader' => $vendorDir . '/symplify/package-builder/src/DependencyInjection/FileLoader/ParameterMergingPhpFileLoader.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Diff\\Output\\CompleteUnifiedDiffOutputBuilderFactory' => $vendorDir . '/symplify/package-builder/src/Diff/Output/CompleteUnifiedDiffOutputBuilderFactory.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Exception\\HttpKernel\\MissingInterfaceException' => $vendorDir . '/symplify/package-builder/src/Exception/HttpKernel/MissingInterfaceException.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Exception\\InvalidPrivatePropertyTypeException' => $vendorDir . '/symplify/package-builder/src/Exception/InvalidPrivatePropertyTypeException.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Exception\\MissingPrivatePropertyException' => $vendorDir . '/symplify/package-builder/src/Exception/MissingPrivatePropertyException.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Exception\\MissingServiceException' => $vendorDir . '/symplify/package-builder/src/Exception/MissingServiceException.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Parameter\\ParameterProvider' => $vendorDir . '/symplify/package-builder/src/Parameter/ParameterProvider.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Php\\TypeChecker' => $vendorDir . '/symplify/package-builder/src/Php/TypeChecker.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Reflection\\ClassLikeExistenceChecker' => $vendorDir . '/symplify/package-builder/src/Reflection/ClassLikeExistenceChecker.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Reflection\\PrivatesAccessor' => $vendorDir . '/symplify/package-builder/src/Reflection/PrivatesAccessor.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Reflection\\PrivatesCaller' => $vendorDir . '/symplify/package-builder/src/Reflection/PrivatesCaller.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Strings\\StringFormatConverter' => $vendorDir . '/symplify/package-builder/src/Strings/StringFormatConverter.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\ValueObject\\ConsoleColorDiffConfig' => $vendorDir . '/symplify/package-builder/src/ValueObject/ConsoleColorDiffConfig.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\ValueObject\\MethodName' => $vendorDir . '/symplify/package-builder/src/ValueObject/MethodName.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\ValueObject\\Option' => $vendorDir . '/symplify/package-builder/src/ValueObject/Option.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Yaml\\ParametersMerger' => $vendorDir . '/symplify/package-builder/src/Yaml/ParametersMerger.php',
|
||||
'RectorPrefix202209\\Webmozart\\Assert\\Assert' => $vendorDir . '/webmozart/assert/src/Assert.php',
|
||||
'RectorPrefix202209\\Webmozart\\Assert\\InvalidArgumentException' => $vendorDir . '/webmozart/assert/src/InvalidArgumentException.php',
|
||||
'RectorPrefix202209\\Webmozart\\Assert\\Mixin' => $vendorDir . '/webmozart/assert/src/Mixin.php',
|
||||
|
2
vendor/composer/autoload_files.php
vendored
2
vendor/composer/autoload_files.php
vendored
@ -8,9 +8,9 @@ $baseDir = dirname($vendorDir);
|
||||
return array(
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'972fda704d680a3a53c68e34e193cb22' => $vendorDir . '/react/promise-timer/src/functions_include.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
|
||||
'972fda704d680a3a53c68e34e193cb22' => $vendorDir . '/react/promise-timer/src/functions_include.php',
|
||||
'9b38cf48e83f5d8f60375221cd213eee' => $vendorDir . '/phpstan/phpstan/bootstrap.php',
|
||||
'2324d0e5cadd603331d27de142371f0b' => $vendorDir . '/symfony/contracts/Deprecation/function.php',
|
||||
'4508688f3cab21375725e8d11ca194a2' => $baseDir . '/src/constants.php',
|
||||
|
1
vendor/composer/autoload_psr4.php
vendored
1
vendor/composer/autoload_psr4.php
vendored
@ -20,7 +20,6 @@ return array(
|
||||
'Rector\\CakePHP\\' => array($vendorDir . '/rector/rector-cakephp/src'),
|
||||
'Rector\\' => array($baseDir . '/packages', $baseDir . '/rules', $vendorDir . '/rector/rector-downgrade-php/src', $vendorDir . '/rector/rector-downgrade-php/rules'),
|
||||
'RectorPrefix202209\\Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\' => array($vendorDir . '/symplify/package-builder/src'),
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\' => array($vendorDir . '/symplify/easy-parallel/src'),
|
||||
'RectorPrefix202209\\Symplify\\AutowireArrayParameter\\' => array($vendorDir . '/symplify/autowire-array-parameter/src'),
|
||||
'RectorPrefix202209\\Symfony\\Contracts\\' => array($vendorDir . '/symfony/contracts'),
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
class ComposerAutoloaderInitb7a113089e4ddeef65b82e292dc4be93
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitb7a113089e4ddeef65b82e292dc4be93', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitb7a113089e4ddeef65b82e292dc4be93', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitb7a113089e4ddeef65b82e292dc4be93::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitb7a113089e4ddeef65b82e292dc4be93::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire87a6e44dbf0d392dab5e12e5d31e3cdf($fileIdentifier, $file);
|
||||
composerRequireb7a113089e4ddeef65b82e292dc4be93($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire87a6e44dbf0d392dab5e12e5d31e3cdf($fileIdentifier, $file)
|
||||
function composerRequireb7a113089e4ddeef65b82e292dc4be93($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
39
vendor/composer/autoload_static.php
vendored
39
vendor/composer/autoload_static.php
vendored
@ -4,14 +4,14 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
class ComposerStaticInitb7a113089e4ddeef65b82e292dc4be93
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'972fda704d680a3a53c68e34e193cb22' => __DIR__ . '/..' . '/react/promise-timer/src/functions_include.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
|
||||
'972fda704d680a3a53c68e34e193cb22' => __DIR__ . '/..' . '/react/promise-timer/src/functions_include.php',
|
||||
'9b38cf48e83f5d8f60375221cd213eee' => __DIR__ . '/..' . '/phpstan/phpstan/bootstrap.php',
|
||||
'2324d0e5cadd603331d27de142371f0b' => __DIR__ . '/..' . '/symfony/contracts/Deprecation/function.php',
|
||||
'4508688f3cab21375725e8d11ca194a2' => __DIR__ . '/../..' . '/src/constants.php',
|
||||
@ -37,7 +37,6 @@ class ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
'Rector\\CakePHP\\' => 15,
|
||||
'Rector\\' => 7,
|
||||
'RectorPrefix202209\\Webmozart\\Assert\\' => 36,
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\' => 43,
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\' => 41,
|
||||
'RectorPrefix202209\\Symplify\\AutowireArrayParameter\\' => 51,
|
||||
'RectorPrefix202209\\Symfony\\Contracts\\' => 37,
|
||||
@ -135,10 +134,6 @@ class ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/webmozart/assert/src',
|
||||
),
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symplify/package-builder/src',
|
||||
),
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symplify/easy-parallel/src',
|
||||
@ -1299,30 +1294,6 @@ class ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\ValueObject\\ParallelProcess' => __DIR__ . '/..' . '/symplify/easy-parallel/src/ValueObject/ParallelProcess.php',
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\ValueObject\\ProcessPool' => __DIR__ . '/..' . '/symplify/easy-parallel/src/ValueObject/ProcessPool.php',
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\ValueObject\\Schedule' => __DIR__ . '/..' . '/symplify/easy-parallel/src/ValueObject/Schedule.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Composer\\VendorDirProvider' => __DIR__ . '/..' . '/symplify/package-builder/src/Composer/VendorDirProvider.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Configuration\\StaticEolConfiguration' => __DIR__ . '/..' . '/symplify/package-builder/src/Configuration/StaticEolConfiguration.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Command\\AbstractSymplifyCommand' => __DIR__ . '/..' . '/symplify/package-builder/src/Console/Command/AbstractSymplifyCommand.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Formatter\\ColorConsoleDiffFormatter' => __DIR__ . '/..' . '/symplify/package-builder/src/Console/Formatter/ColorConsoleDiffFormatter.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Input\\StaticInputDetector' => __DIR__ . '/..' . '/symplify/package-builder/src/Console/Input/StaticInputDetector.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Output\\ConsoleDiffer' => __DIR__ . '/..' . '/symplify/package-builder/src/Console/Output/ConsoleDiffer.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Console\\Style\\SymfonyStyleFactory' => __DIR__ . '/..' . '/symplify/package-builder/src/Console/Style/SymfonyStyleFactory.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\DependencyInjection\\CompilerPass\\AutowireInterfacesCompilerPass' => __DIR__ . '/..' . '/symplify/package-builder/src/DependencyInjection/CompilerPass/AutowireInterfacesCompilerPass.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\DependencyInjection\\FileLoader\\ParameterMergingPhpFileLoader' => __DIR__ . '/..' . '/symplify/package-builder/src/DependencyInjection/FileLoader/ParameterMergingPhpFileLoader.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Diff\\Output\\CompleteUnifiedDiffOutputBuilderFactory' => __DIR__ . '/..' . '/symplify/package-builder/src/Diff/Output/CompleteUnifiedDiffOutputBuilderFactory.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Exception\\HttpKernel\\MissingInterfaceException' => __DIR__ . '/..' . '/symplify/package-builder/src/Exception/HttpKernel/MissingInterfaceException.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Exception\\InvalidPrivatePropertyTypeException' => __DIR__ . '/..' . '/symplify/package-builder/src/Exception/InvalidPrivatePropertyTypeException.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Exception\\MissingPrivatePropertyException' => __DIR__ . '/..' . '/symplify/package-builder/src/Exception/MissingPrivatePropertyException.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Exception\\MissingServiceException' => __DIR__ . '/..' . '/symplify/package-builder/src/Exception/MissingServiceException.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Parameter\\ParameterProvider' => __DIR__ . '/..' . '/symplify/package-builder/src/Parameter/ParameterProvider.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Php\\TypeChecker' => __DIR__ . '/..' . '/symplify/package-builder/src/Php/TypeChecker.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Reflection\\ClassLikeExistenceChecker' => __DIR__ . '/..' . '/symplify/package-builder/src/Reflection/ClassLikeExistenceChecker.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Reflection\\PrivatesAccessor' => __DIR__ . '/..' . '/symplify/package-builder/src/Reflection/PrivatesAccessor.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Reflection\\PrivatesCaller' => __DIR__ . '/..' . '/symplify/package-builder/src/Reflection/PrivatesCaller.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Strings\\StringFormatConverter' => __DIR__ . '/..' . '/symplify/package-builder/src/Strings/StringFormatConverter.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\ValueObject\\ConsoleColorDiffConfig' => __DIR__ . '/..' . '/symplify/package-builder/src/ValueObject/ConsoleColorDiffConfig.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\ValueObject\\MethodName' => __DIR__ . '/..' . '/symplify/package-builder/src/ValueObject/MethodName.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\ValueObject\\Option' => __DIR__ . '/..' . '/symplify/package-builder/src/ValueObject/Option.php',
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\Yaml\\ParametersMerger' => __DIR__ . '/..' . '/symplify/package-builder/src/Yaml/ParametersMerger.php',
|
||||
'RectorPrefix202209\\Webmozart\\Assert\\Assert' => __DIR__ . '/..' . '/webmozart/assert/src/Assert.php',
|
||||
'RectorPrefix202209\\Webmozart\\Assert\\InvalidArgumentException' => __DIR__ . '/..' . '/webmozart/assert/src/InvalidArgumentException.php',
|
||||
'RectorPrefix202209\\Webmozart\\Assert\\Mixin' => __DIR__ . '/..' . '/webmozart/assert/src/Mixin.php',
|
||||
@ -3122,9 +3093,9 @@ class ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit87a6e44dbf0d392dab5e12e5d31e3cdf::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitb7a113089e4ddeef65b82e292dc4be93::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitb7a113089e4ddeef65b82e292dc4be93::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitb7a113089e4ddeef65b82e292dc4be93::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
250
vendor/composer/installed.json
vendored
250
vendor/composer/installed.json
vendored
@ -2197,12 +2197,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
|
||||
"reference": "ba7d01bc02d6212793cc4794df506f6af1b90cb2"
|
||||
"reference": "09ce151a7b331b84738d6064593426d47ee987c3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/ba7d01bc02d6212793cc4794df506f6af1b90cb2",
|
||||
"reference": "ba7d01bc02d6212793cc4794df506f6af1b90cb2",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/09ce151a7b331b84738d6064593426d47ee987c3",
|
||||
"reference": "09ce151a7b331b84738d6064593426d47ee987c3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2233,7 +2233,7 @@
|
||||
"symplify\/rule-doc-generator": "^11.1",
|
||||
"symplify\/vendor-patches": "^11.1"
|
||||
},
|
||||
"time": "2022-09-01T21:48:10+00:00",
|
||||
"time": "2022-09-02T02:47:10+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
@ -3108,17 +3108,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symplify\/autowire-array-parameter",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"version": "11.1.9",
|
||||
"version_normalized": "11.1.9.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/autowire-array-parameter.git",
|
||||
"reference": "6695dcbc57a7d806a820d44746847b0b22f15896"
|
||||
"reference": "efc222c5546f07a390ff0e1d7b35282a09ff5a09"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/autowire-array-parameter\/zipball\/6695dcbc57a7d806a820d44746847b0b22f15896",
|
||||
"reference": "6695dcbc57a7d806a820d44746847b0b22f15896",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/autowire-array-parameter\/zipball\/efc222c5546f07a390ff0e1d7b35282a09ff5a09",
|
||||
"reference": "efc222c5546f07a390ff0e1d7b35282a09ff5a09",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -3127,31 +3127,31 @@
|
||||
"symfony\/dependency-injection": "^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/coding-standard": "<11.1.7",
|
||||
"symplify\/composer-json-manipulator": "<11.1.7",
|
||||
"symplify\/config-transformer": "<11.1.7",
|
||||
"symplify\/easy-ci": "<11.1.7",
|
||||
"symplify\/easy-coding-standard": "<11.1.7",
|
||||
"symplify\/easy-parallel": "<11.1.7",
|
||||
"symplify\/easy-testing": "<11.1.7",
|
||||
"symplify\/monorepo-builder": "<11.1.7",
|
||||
"symplify\/php-config-printer": "<11.1.7",
|
||||
"symplify\/phpstan-extensions": "<11.1.7",
|
||||
"symplify\/phpstan-rules": "<11.1.7",
|
||||
"symplify\/rule-doc-generator": "<11.1.7",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.7",
|
||||
"symplify\/smart-file-system": "<11.1.7",
|
||||
"symplify\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/symplify-kernel": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7"
|
||||
"symplify\/coding-standard": "<11.1.9",
|
||||
"symplify\/composer-json-manipulator": "<11.1.9",
|
||||
"symplify\/config-transformer": "<11.1.9",
|
||||
"symplify\/easy-ci": "<11.1.9",
|
||||
"symplify\/easy-coding-standard": "<11.1.9",
|
||||
"symplify\/easy-parallel": "<11.1.9",
|
||||
"symplify\/easy-testing": "<11.1.9",
|
||||
"symplify\/monorepo-builder": "<11.1.9",
|
||||
"symplify\/package-builder": "<11.1.9",
|
||||
"symplify\/php-config-printer": "<11.1.9",
|
||||
"symplify\/phpstan-extensions": "<11.1.9",
|
||||
"symplify\/phpstan-rules": "<11.1.9",
|
||||
"symplify\/rule-doc-generator": "<11.1.9",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.9",
|
||||
"symplify\/smart-file-system": "<11.1.9",
|
||||
"symplify\/symfony-static-dumper": "<11.1.9",
|
||||
"symplify\/symplify-kernel": "<11.1.9",
|
||||
"symplify\/vendor-patches": "<11.1.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.23",
|
||||
"symplify\/package-builder": "^11.2",
|
||||
"symplify\/symplify-kernel": "^11.2"
|
||||
"symplify\/package-builder": "^11.1.9",
|
||||
"symplify\/symplify-kernel": "^11.1.9"
|
||||
},
|
||||
"time": "2022-09-01T20:39:14+00:00",
|
||||
"default-branch": true,
|
||||
"time": "2022-09-02T10:11:14+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -3170,7 +3170,7 @@
|
||||
],
|
||||
"description": "Autowire array parameters for your Symfony applications",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/autowire-array-parameter\/tree\/main"
|
||||
"source": "https:\/\/github.com\/symplify\/autowire-array-parameter\/tree\/11.1.9"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -3186,17 +3186,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symplify\/easy-parallel",
|
||||
"version": "11.1.7",
|
||||
"version_normalized": "11.1.7.0",
|
||||
"version": "11.1.9",
|
||||
"version_normalized": "11.1.9.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/easy-parallel.git",
|
||||
"reference": "9fc3cb884b8e19bd46de7cedde9115483274d9f9"
|
||||
"reference": "75df164f48ad642ac08337de7410f5ebe814893e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/easy-parallel\/zipball\/9fc3cb884b8e19bd46de7cedde9115483274d9f9",
|
||||
"reference": "9fc3cb884b8e19bd46de7cedde9115483274d9f9",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/easy-parallel\/zipball\/75df164f48ad642ac08337de7410f5ebe814893e",
|
||||
"reference": "75df164f48ad642ac08337de7410f5ebe814893e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -3204,33 +3204,34 @@
|
||||
"php": ">=8.0",
|
||||
"react\/child-process": "^0.6.4",
|
||||
"react\/event-loop": "^1.3",
|
||||
"react\/socket": "^1.11",
|
||||
"symfony\/console": "^6.0",
|
||||
"symplify\/package-builder": "^11.1.7"
|
||||
"react\/socket": "^1.12",
|
||||
"symfony\/console": "^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/autowire-array-parameter": "<11.1.7",
|
||||
"symplify\/coding-standard": "<11.1.7",
|
||||
"symplify\/composer-json-manipulator": "<11.1.7",
|
||||
"symplify\/config-transformer": "<11.1.7",
|
||||
"symplify\/easy-ci": "<11.1.7",
|
||||
"symplify\/easy-coding-standard": "<11.1.7",
|
||||
"symplify\/easy-testing": "<11.1.7",
|
||||
"symplify\/monorepo-builder": "<11.1.7",
|
||||
"symplify\/php-config-printer": "<11.1.7",
|
||||
"symplify\/phpstan-extensions": "<11.1.7",
|
||||
"symplify\/phpstan-rules": "<11.1.7",
|
||||
"symplify\/rule-doc-generator": "<11.1.7",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.7",
|
||||
"symplify\/smart-file-system": "<11.1.7",
|
||||
"symplify\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/symplify-kernel": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7"
|
||||
"symplify\/autowire-array-parameter": "<11.1.9",
|
||||
"symplify\/coding-standard": "<11.1.9",
|
||||
"symplify\/composer-json-manipulator": "<11.1.9",
|
||||
"symplify\/config-transformer": "<11.1.9",
|
||||
"symplify\/easy-ci": "<11.1.9",
|
||||
"symplify\/easy-coding-standard": "<11.1.9",
|
||||
"symplify\/easy-testing": "<11.1.9",
|
||||
"symplify\/monorepo-builder": "<11.1.9",
|
||||
"symplify\/package-builder": "<11.1.9",
|
||||
"symplify\/php-config-printer": "<11.1.9",
|
||||
"symplify\/phpstan-extensions": "<11.1.9",
|
||||
"symplify\/phpstan-rules": "<11.1.9",
|
||||
"symplify\/rule-doc-generator": "<11.1.9",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.9",
|
||||
"symplify\/smart-file-system": "<11.1.9",
|
||||
"symplify\/symfony-static-dumper": "<11.1.9",
|
||||
"symplify\/symplify-kernel": "<11.1.9",
|
||||
"symplify\/vendor-patches": "<11.1.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.23"
|
||||
"phpunit\/phpunit": "^9.5.23",
|
||||
"symplify\/package-builder": "^11.1.9"
|
||||
},
|
||||
"time": "2022-09-01T19:30:44+00:00",
|
||||
"time": "2022-09-02T10:11:27+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -3250,104 +3251,23 @@
|
||||
"description": "Helper package for easier CLI project parallelization",
|
||||
"support": {
|
||||
"issues": "https:\/\/github.com\/symplify\/easy-parallel\/issues",
|
||||
"source": "https:\/\/github.com\/symplify\/easy-parallel\/tree\/11.1.7"
|
||||
"source": "https:\/\/github.com\/symplify\/easy-parallel\/tree\/11.1.9"
|
||||
},
|
||||
"install-path": "..\/symplify\/easy-parallel"
|
||||
},
|
||||
{
|
||||
"name": "symplify\/package-builder",
|
||||
"version": "11.1.7",
|
||||
"version_normalized": "11.1.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/package-builder.git",
|
||||
"reference": "d3b105c2343b8b5c4174e69c2cac3ad305743cee"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/package-builder\/zipball\/d3b105c2343b8b5c4174e69c2cac3ad305743cee",
|
||||
"reference": "d3b105c2343b8b5c4174e69c2cac3ad305743cee",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"nette\/utils": "^3.2",
|
||||
"php": ">=8.0",
|
||||
"sebastian\/diff": "^4.0",
|
||||
"symfony\/config": "^6.0",
|
||||
"symfony\/console": "^6.0",
|
||||
"symfony\/dependency-injection": "^6.0",
|
||||
"symfony\/finder": "^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/autowire-array-parameter": "<11.1.7",
|
||||
"symplify\/coding-standard": "<11.1.7",
|
||||
"symplify\/composer-json-manipulator": "<11.1.7",
|
||||
"symplify\/config-transformer": "<11.1.7",
|
||||
"symplify\/easy-ci": "<11.1.7",
|
||||
"symplify\/easy-coding-standard": "<11.1.7",
|
||||
"symplify\/easy-parallel": "<11.1.7",
|
||||
"symplify\/easy-testing": "<11.1.7",
|
||||
"symplify\/monorepo-builder": "<11.1.7",
|
||||
"symplify\/php-config-printer": "<11.1.7",
|
||||
"symplify\/phpstan-extensions": "<11.1.7",
|
||||
"symplify\/phpstan-rules": "<11.1.7",
|
||||
"symplify\/rule-doc-generator": "<11.1.7",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.7",
|
||||
"symplify\/smart-file-system": "<11.1.7",
|
||||
"symplify\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/symplify-kernel": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.23",
|
||||
"symplify\/symplify-kernel": "^11.1.7"
|
||||
},
|
||||
"time": "2022-09-01T19:30:44+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "11.2-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202209\\Symplify\\PackageBuilder\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https:\/\/packagist.org\/downloads\/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Dependency Injection, Console and Kernel toolkit for Symplify packages.",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/package-builder\/tree\/11.1.7"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https:\/\/www.paypal.me\/rectorphp",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/github.com\/tomasvotruba",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"install-path": "..\/symplify\/package-builder"
|
||||
},
|
||||
{
|
||||
"name": "symplify\/rule-doc-generator-contracts",
|
||||
"version": "11.1.7",
|
||||
"version_normalized": "11.1.7.0",
|
||||
"version": "11.1.9",
|
||||
"version_normalized": "11.1.9.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts.git",
|
||||
"reference": "2b7bc99e8f90a7d1711877054602d0b29f23e0ae"
|
||||
"reference": "868b0b3235a2f507a8213a6a9ae6fabe2528fab9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/rule-doc-generator-contracts\/zipball\/2b7bc99e8f90a7d1711877054602d0b29f23e0ae",
|
||||
"reference": "2b7bc99e8f90a7d1711877054602d0b29f23e0ae",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/rule-doc-generator-contracts\/zipball\/868b0b3235a2f507a8213a6a9ae6fabe2528fab9",
|
||||
"reference": "868b0b3235a2f507a8213a6a9ae6fabe2528fab9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -3355,26 +3275,26 @@
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/autowire-array-parameter": "<11.1.7",
|
||||
"symplify\/coding-standard": "<11.1.7",
|
||||
"symplify\/composer-json-manipulator": "<11.1.7",
|
||||
"symplify\/config-transformer": "<11.1.7",
|
||||
"symplify\/easy-ci": "<11.1.7",
|
||||
"symplify\/easy-coding-standard": "<11.1.7",
|
||||
"symplify\/easy-parallel": "<11.1.7",
|
||||
"symplify\/easy-testing": "<11.1.7",
|
||||
"symplify\/monorepo-builder": "<11.1.7",
|
||||
"symplify\/package-builder": "<11.1.7",
|
||||
"symplify\/php-config-printer": "<11.1.7",
|
||||
"symplify\/phpstan-extensions": "<11.1.7",
|
||||
"symplify\/phpstan-rules": "<11.1.7",
|
||||
"symplify\/rule-doc-generator": "<11.1.7",
|
||||
"symplify\/smart-file-system": "<11.1.7",
|
||||
"symplify\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/symplify-kernel": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7"
|
||||
"symplify\/autowire-array-parameter": "<11.1.9",
|
||||
"symplify\/coding-standard": "<11.1.9",
|
||||
"symplify\/composer-json-manipulator": "<11.1.9",
|
||||
"symplify\/config-transformer": "<11.1.9",
|
||||
"symplify\/easy-ci": "<11.1.9",
|
||||
"symplify\/easy-coding-standard": "<11.1.9",
|
||||
"symplify\/easy-parallel": "<11.1.9",
|
||||
"symplify\/easy-testing": "<11.1.9",
|
||||
"symplify\/monorepo-builder": "<11.1.9",
|
||||
"symplify\/package-builder": "<11.1.9",
|
||||
"symplify\/php-config-printer": "<11.1.9",
|
||||
"symplify\/phpstan-extensions": "<11.1.9",
|
||||
"symplify\/phpstan-rules": "<11.1.9",
|
||||
"symplify\/rule-doc-generator": "<11.1.9",
|
||||
"symplify\/smart-file-system": "<11.1.9",
|
||||
"symplify\/symfony-static-dumper": "<11.1.9",
|
||||
"symplify\/symplify-kernel": "<11.1.9",
|
||||
"symplify\/vendor-patches": "<11.1.9"
|
||||
},
|
||||
"time": "2022-09-01T19:29:57+00:00",
|
||||
"time": "2022-09-02T10:11:57+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -3393,7 +3313,7 @@
|
||||
],
|
||||
"description": "Contracts for production code of RuleDocGenerator",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts\/tree\/11.1.7"
|
||||
"source": "https:\/\/github.com\/symplify\/rule-doc-generator-contracts\/tree\/11.1.9"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
||||
*/
|
||||
final class GeneratedConfig
|
||||
{
|
||||
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main bfaf952'), '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 3ef7085'), '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 e6f1461'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main cd9db8c'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e5a1d4c'), '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 087730e'), '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 ba7d01b'));
|
||||
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main bfaf952'), '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 3ef7085'), '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 e6f1461'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main cd9db8c'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e5a1d4c'), '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 087730e'), '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 09ce151'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
4
vendor/rector/rector-symfony/rector.php
vendored
4
vendor/rector/rector-symfony/rector.php
vendored
@ -18,7 +18,7 @@ return static function (RectorConfig $rectorConfig) : void {
|
||||
'*/Source/*',
|
||||
'*/Source*/*',
|
||||
'*/tests/*/Fixture*/Expected/*',
|
||||
StringClassNameToClassConstantRector::class,
|
||||
StringClassNameToClassConstantRector::class => [__DIR__ . '/config'],
|
||||
\Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class => [
|
||||
// "data" => "datum" false positive
|
||||
__DIR__ . '/src/Rector/ClassMethod/AddRouteAnnotationRector.php',
|
||||
@ -27,6 +27,8 @@ return static function (RectorConfig $rectorConfig) : void {
|
||||
ReturnNeverTypeRector::class => ['*/tests/*'],
|
||||
]);
|
||||
$rectorConfig->ruleWithConfiguration(StringClassNameToClassConstantRector::class, [
|
||||
'Error',
|
||||
'Exception',
|
||||
'Symfony\\*',
|
||||
'Twig_*',
|
||||
'Twig*',
|
||||
|
@ -9,8 +9,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.23",
|
||||
"symplify\/package-builder": "^11.2",
|
||||
"symplify\/symplify-kernel": "^11.2"
|
||||
"symplify\/package-builder": "^11.1.9",
|
||||
"symplify\/symplify-kernel": "^11.1.9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@ -28,23 +28,24 @@
|
||||
}
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/composer-json-manipulator": "<11.1.7",
|
||||
"symplify\/easy-coding-standard": "<11.1.7",
|
||||
"symplify\/phpstan-rules": "<11.1.7",
|
||||
"symplify\/easy-testing": "<11.1.7",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.7",
|
||||
"symplify\/php-config-printer": "<11.1.7",
|
||||
"symplify\/phpstan-extensions": "<11.1.7",
|
||||
"symplify\/rule-doc-generator": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7",
|
||||
"symplify\/smart-file-system": "<11.1.7",
|
||||
"symplify\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/symplify-kernel": "<11.1.7",
|
||||
"symplify\/monorepo-builder": "<11.1.7",
|
||||
"symplify\/config-transformer": "<11.1.7",
|
||||
"symplify\/easy-ci": "<11.1.7",
|
||||
"symplify\/coding-standard": "<11.1.7",
|
||||
"symplify\/easy-parallel": "<11.1.7"
|
||||
"symplify\/composer-json-manipulator": "<11.1.9",
|
||||
"symplify\/easy-coding-standard": "<11.1.9",
|
||||
"symplify\/phpstan-rules": "<11.1.9",
|
||||
"symplify\/easy-testing": "<11.1.9",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.9",
|
||||
"symplify\/php-config-printer": "<11.1.9",
|
||||
"symplify\/phpstan-extensions": "<11.1.9",
|
||||
"symplify\/rule-doc-generator": "<11.1.9",
|
||||
"symplify\/vendor-patches": "<11.1.9",
|
||||
"symplify\/smart-file-system": "<11.1.9",
|
||||
"symplify\/symfony-static-dumper": "<11.1.9",
|
||||
"symplify\/symplify-kernel": "<11.1.9",
|
||||
"symplify\/monorepo-builder": "<11.1.9",
|
||||
"symplify\/config-transformer": "<11.1.9",
|
||||
"symplify\/easy-ci": "<11.1.9",
|
||||
"symplify\/coding-standard": "<11.1.9",
|
||||
"symplify\/easy-parallel": "<11.1.9",
|
||||
"symplify\/package-builder": "<11.1.9"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
|
41
vendor/symplify/easy-parallel/composer.json
vendored
41
vendor/symplify/easy-parallel/composer.json
vendored
@ -7,11 +7,11 @@
|
||||
"clue\/ndjson-react": "^1.2",
|
||||
"react\/child-process": "^0.6.4",
|
||||
"react\/event-loop": "^1.3",
|
||||
"react\/socket": "^1.11",
|
||||
"symfony\/console": "^6.0",
|
||||
"symplify\/package-builder": "^11.1.7"
|
||||
"react\/socket": "^1.12",
|
||||
"symfony\/console": "^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symplify\/package-builder": "^11.1.9",
|
||||
"phpunit\/phpunit": "^9.5.23"
|
||||
},
|
||||
"autoload": {
|
||||
@ -33,23 +33,24 @@
|
||||
"platform-check": false
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/easy-coding-standard": "<11.1.7",
|
||||
"symplify\/phpstan-rules": "<11.1.7",
|
||||
"symplify\/easy-testing": "<11.1.7",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.7",
|
||||
"symplify\/php-config-printer": "<11.1.7",
|
||||
"symplify\/autowire-array-parameter": "<11.1.7",
|
||||
"symplify\/phpstan-extensions": "<11.1.7",
|
||||
"symplify\/rule-doc-generator": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7",
|
||||
"symplify\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/config-transformer": "<11.1.7",
|
||||
"symplify\/easy-ci": "<11.1.7",
|
||||
"symplify\/coding-standard": "<11.1.7",
|
||||
"symplify\/composer-json-manipulator": "<11.1.7",
|
||||
"symplify\/smart-file-system": "<11.1.7",
|
||||
"symplify\/monorepo-builder": "<11.1.7",
|
||||
"symplify\/symplify-kernel": "<11.1.7"
|
||||
"symplify\/easy-coding-standard": "<11.1.9",
|
||||
"symplify\/phpstan-rules": "<11.1.9",
|
||||
"symplify\/easy-testing": "<11.1.9",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.9",
|
||||
"symplify\/php-config-printer": "<11.1.9",
|
||||
"symplify\/autowire-array-parameter": "<11.1.9",
|
||||
"symplify\/phpstan-extensions": "<11.1.9",
|
||||
"symplify\/rule-doc-generator": "<11.1.9",
|
||||
"symplify\/vendor-patches": "<11.1.9",
|
||||
"symplify\/symfony-static-dumper": "<11.1.9",
|
||||
"symplify\/config-transformer": "<11.1.9",
|
||||
"symplify\/easy-ci": "<11.1.9",
|
||||
"symplify\/coding-standard": "<11.1.9",
|
||||
"symplify\/composer-json-manipulator": "<11.1.9",
|
||||
"symplify\/smart-file-system": "<11.1.9",
|
||||
"symplify\/monorepo-builder": "<11.1.9",
|
||||
"symplify\/symplify-kernel": "<11.1.9",
|
||||
"symplify\/package-builder": "<11.1.9"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
|
55
vendor/symplify/package-builder/composer.json
vendored
55
vendor/symplify/package-builder/composer.json
vendored
@ -1,55 +0,0 @@
|
||||
{
|
||||
"name": "symplify\/package-builder",
|
||||
"description": "Dependency Injection, Console and Kernel toolkit for Symplify packages.",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=8.0",
|
||||
"nette\/utils": "^3.2",
|
||||
"sebastian\/diff": "^4.0",
|
||||
"symfony\/config": "^6.0",
|
||||
"symfony\/console": "^6.0",
|
||||
"symfony\/dependency-injection": "^6.0",
|
||||
"symfony\/finder": "^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symplify\/symplify-kernel": "^11.1.7",
|
||||
"phpunit\/phpunit": "^9.5.23"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202209\\Symplify\\PackageBuilder\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202209\\Symplify\\PackageBuilder\\Tests\\": "tests"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "11.2-dev"
|
||||
}
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/composer-json-manipulator": "<11.1.7",
|
||||
"symplify\/easy-coding-standard": "<11.1.7",
|
||||
"symplify\/phpstan-rules": "<11.1.7",
|
||||
"symplify\/rule-doc-generator-contracts": "<11.1.7",
|
||||
"symplify\/php-config-printer": "<11.1.7",
|
||||
"symplify\/autowire-array-parameter": "<11.1.7",
|
||||
"symplify\/phpstan-extensions": "<11.1.7",
|
||||
"symplify\/rule-doc-generator": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7",
|
||||
"symplify\/smart-file-system": "<11.1.7",
|
||||
"symplify\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/monorepo-builder": "<11.1.7",
|
||||
"symplify\/config-transformer": "<11.1.7",
|
||||
"symplify\/easy-ci": "<11.1.7",
|
||||
"symplify\/coding-standard": "<11.1.7",
|
||||
"symplify\/easy-parallel": "<11.1.7",
|
||||
"symplify\/easy-testing": "<11.1.7",
|
||||
"symplify\/symplify-kernel": "<11.1.7"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209;
|
||||
|
||||
use RectorPrefix202209\SebastianBergmann\Diff\Differ;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Console\Formatter\ColorConsoleDiffFormatter;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Console\Output\ConsoleDiffer;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Diff\Output\CompleteUnifiedDiffOutputBuilderFactory;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
||||
return static function (ContainerConfigurator $containerConfigurator) : void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->defaults()->public()->autowire();
|
||||
$services->set(ColorConsoleDiffFormatter::class);
|
||||
$services->set(ConsoleDiffer::class);
|
||||
$services->set(CompleteUnifiedDiffOutputBuilderFactory::class);
|
||||
$services->set(Differ::class);
|
||||
$services->set(PrivatesAccessor::class);
|
||||
};
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Composer;
|
||||
|
||||
use RectorPrefix202209\Composer\Autoload\ClassLoader;
|
||||
use ReflectionClass;
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\PackageBuilder\Tests\Composer\VendorDirProviderTest
|
||||
*/
|
||||
final class VendorDirProvider
|
||||
{
|
||||
public function provide() : string
|
||||
{
|
||||
$rootFolder = \getenv('SystemDrive', \true) . \DIRECTORY_SEPARATOR;
|
||||
$path = __DIR__;
|
||||
while (\substr_compare($path, 'vendor', -\strlen('vendor')) !== 0 && $path !== $rootFolder) {
|
||||
$path = \dirname($path);
|
||||
}
|
||||
if ($path !== $rootFolder) {
|
||||
return $path;
|
||||
}
|
||||
return $this->reflectionFallback();
|
||||
}
|
||||
private function reflectionFallback() : string
|
||||
{
|
||||
$reflectionClass = new ReflectionClass(ClassLoader::class);
|
||||
return \dirname($reflectionClass->getFileName(), 2);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Configuration;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class StaticEolConfiguration
|
||||
{
|
||||
public static function getEolChar() : string
|
||||
{
|
||||
return "\n";
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Console\Command;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\Console\Command\Command;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Input\InputOption;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use RectorPrefix202209\Symfony\Contracts\Service\Attribute\Required;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\ValueObject\Option;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\FileSystemGuard;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\Finder\SmartFinder;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\SmartFileSystem;
|
||||
abstract class AbstractSymplifyCommand extends Command
|
||||
{
|
||||
/**
|
||||
* @var \Symfony\Component\Console\Style\SymfonyStyle
|
||||
*/
|
||||
protected $symfonyStyle;
|
||||
/**
|
||||
* @var \Symplify\SmartFileSystem\SmartFileSystem
|
||||
*/
|
||||
protected $smartFileSystem;
|
||||
/**
|
||||
* @var \Symplify\SmartFileSystem\Finder\SmartFinder
|
||||
*/
|
||||
protected $smartFinder;
|
||||
/**
|
||||
* @var \Symplify\SmartFileSystem\FileSystemGuard
|
||||
*/
|
||||
protected $fileSystemGuard;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->addOption(Option::CONFIG, 'c', InputOption::VALUE_REQUIRED, 'Path to config file');
|
||||
}
|
||||
/**
|
||||
* @required
|
||||
*/
|
||||
public function autowire(SymfonyStyle $symfonyStyle, SmartFileSystem $smartFileSystem, SmartFinder $smartFinder, FileSystemGuard $fileSystemGuard) : void
|
||||
{
|
||||
$this->symfonyStyle = $symfonyStyle;
|
||||
$this->smartFileSystem = $smartFileSystem;
|
||||
$this->smartFinder = $smartFinder;
|
||||
$this->fileSystemGuard = $fileSystemGuard;
|
||||
}
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Console\Formatter;
|
||||
|
||||
use RectorPrefix202209\Nette\Utils\Strings;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Formatter\OutputFormatter;
|
||||
/**
|
||||
* Inspired by @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/src/Differ/DiffConsoleFormatter.php to be
|
||||
* used as standalone class, without need to require whole package by Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @see \Symplify\PackageBuilder\Tests\Console\Formatter\ColorConsoleDiffFormatterTest
|
||||
*/
|
||||
final class ColorConsoleDiffFormatter
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
* @see https://regex101.com/r/ovLMDF/1
|
||||
*/
|
||||
private const PLUS_START_REGEX = '#^(\\+.*)#';
|
||||
/**
|
||||
* @var string
|
||||
* @see https://regex101.com/r/xwywpa/1
|
||||
*/
|
||||
private const MINUT_START_REGEX = '#^(\\-.*)#';
|
||||
/**
|
||||
* @var string
|
||||
* @see https://regex101.com/r/CMlwa8/1
|
||||
*/
|
||||
private const AT_START_REGEX = '#^(@.*)#';
|
||||
/**
|
||||
* @var string
|
||||
* @see https://regex101.com/r/qduj2O/1
|
||||
*/
|
||||
private const NEWLINES_REGEX = "#\n\r|\n#";
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $template;
|
||||
public function __construct()
|
||||
{
|
||||
$this->template = \sprintf('<comment> ---------- begin diff ----------</comment>%s%%s%s<comment> ----------- end diff -----------</comment>' . \PHP_EOL, \PHP_EOL, \PHP_EOL);
|
||||
}
|
||||
public function format(string $diff) : string
|
||||
{
|
||||
return $this->formatWithTemplate($diff, $this->template);
|
||||
}
|
||||
private function formatWithTemplate(string $diff, string $template) : string
|
||||
{
|
||||
$escapedDiff = OutputFormatter::escape(\rtrim($diff));
|
||||
$escapedDiffLines = Strings::split($escapedDiff, self::NEWLINES_REGEX);
|
||||
// remove description of added + remove; obvious on diffs
|
||||
foreach ($escapedDiffLines as $key => $escapedDiffLine) {
|
||||
if ($escapedDiffLine === '--- Original') {
|
||||
unset($escapedDiffLines[$key]);
|
||||
}
|
||||
if ($escapedDiffLine === '+++ New') {
|
||||
unset($escapedDiffLines[$key]);
|
||||
}
|
||||
}
|
||||
$coloredLines = \array_map(function (string $string) : string {
|
||||
$string = $this->makePlusLinesGreen($string);
|
||||
$string = $this->makeMinusLinesRed($string);
|
||||
$string = $this->makeAtNoteCyan($string);
|
||||
if ($string === ' ') {
|
||||
return '';
|
||||
}
|
||||
return $string;
|
||||
}, $escapedDiffLines);
|
||||
return \sprintf($template, \implode(\PHP_EOL, $coloredLines));
|
||||
}
|
||||
private function makePlusLinesGreen(string $string) : string
|
||||
{
|
||||
return Strings::replace($string, self::PLUS_START_REGEX, '<fg=green>$1</fg=green>');
|
||||
}
|
||||
private function makeMinusLinesRed(string $string) : string
|
||||
{
|
||||
return Strings::replace($string, self::MINUT_START_REGEX, '<fg=red>$1</fg=red>');
|
||||
}
|
||||
private function makeAtNoteCyan(string $string) : string
|
||||
{
|
||||
return Strings::replace($string, self::AT_START_REGEX, '<fg=cyan>$1</fg=cyan>');
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Console\Input;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\Console\Input\ArgvInput;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class StaticInputDetector
|
||||
{
|
||||
public static function isDebug() : bool
|
||||
{
|
||||
$argvInput = new ArgvInput();
|
||||
return $argvInput->hasParameterOption(['--debug', '-v', '-vv', '-vvv']);
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Console\Output;
|
||||
|
||||
use RectorPrefix202209\SebastianBergmann\Diff\Differ;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Console\Formatter\ColorConsoleDiffFormatter;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class ConsoleDiffer
|
||||
{
|
||||
/**
|
||||
* @var \SebastianBergmann\Diff\Differ
|
||||
*/
|
||||
private $differ;
|
||||
/**
|
||||
* @var \Symplify\PackageBuilder\Console\Formatter\ColorConsoleDiffFormatter
|
||||
*/
|
||||
private $colorConsoleDiffFormatter;
|
||||
public function __construct(Differ $differ, ColorConsoleDiffFormatter $colorConsoleDiffFormatter)
|
||||
{
|
||||
$this->differ = $differ;
|
||||
$this->colorConsoleDiffFormatter = $colorConsoleDiffFormatter;
|
||||
}
|
||||
public function diff(string $old, string $new) : string
|
||||
{
|
||||
$diff = $this->differ->diff($old, $new);
|
||||
return $this->colorConsoleDiffFormatter->format($diff);
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Console\Style;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\Console\Application;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Input\ArgvInput;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Output\ConsoleOutput;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Output\OutputInterface;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Reflection\PrivatesCaller;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class SymfonyStyleFactory
|
||||
{
|
||||
/**
|
||||
* @var \Symplify\PackageBuilder\Reflection\PrivatesCaller
|
||||
*/
|
||||
private $privatesCaller;
|
||||
public function __construct()
|
||||
{
|
||||
$this->privatesCaller = new PrivatesCaller();
|
||||
}
|
||||
public function create() : SymfonyStyle
|
||||
{
|
||||
// to prevent missing argv indexes
|
||||
if (!isset($_SERVER['argv'])) {
|
||||
$_SERVER['argv'] = [];
|
||||
}
|
||||
$argvInput = new ArgvInput();
|
||||
$consoleOutput = new ConsoleOutput();
|
||||
// to configure all -v, -vv, -vvv options without memory-lock to Application run() arguments
|
||||
$this->privatesCaller->callPrivateMethod(new Application(), 'configureIO', [$argvInput, $consoleOutput]);
|
||||
// --debug is called
|
||||
if ($argvInput->hasParameterOption('--debug')) {
|
||||
$consoleOutput->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
|
||||
}
|
||||
// disable output for tests
|
||||
if ($this->isPHPUnitRun()) {
|
||||
$consoleOutput->setVerbosity(OutputInterface::VERBOSITY_QUIET);
|
||||
}
|
||||
return new SymfonyStyle($argvInput, $consoleOutput);
|
||||
}
|
||||
/**
|
||||
* Never ever used static methods if not neccesary, this is just handy for tests + src to prevent duplication.
|
||||
*/
|
||||
private function isPHPUnitRun() : bool
|
||||
{
|
||||
return \defined('RectorPrefix202209\\PHPUNIT_COMPOSER_INSTALL') || \defined('RectorPrefix202209\\__PHPUNIT_PHAR__');
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\DependencyInjection\CompilerPass;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
final class AutowireInterfacesCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $typesToAutowire;
|
||||
/**
|
||||
* @param string[] $typesToAutowire
|
||||
*/
|
||||
public function __construct(array $typesToAutowire)
|
||||
{
|
||||
$this->typesToAutowire = $typesToAutowire;
|
||||
}
|
||||
public function process(ContainerBuilder $containerBuilder) : void
|
||||
{
|
||||
$definitions = $containerBuilder->getDefinitions();
|
||||
foreach ($definitions as $definition) {
|
||||
foreach ($this->typesToAutowire as $typeToAutowire) {
|
||||
if (!\is_a((string) $definition->getClass(), $typeToAutowire, \true)) {
|
||||
continue;
|
||||
}
|
||||
$definition->setAutowired(\true);
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\DependencyInjection\FileLoader;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\Config\FileLocatorInterface;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Yaml\ParametersMerger;
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* The need:
|
||||
* - https://github.com/symfony/symfony/issues/26713
|
||||
* - https://github.com/symfony/symfony/pull/21313#issuecomment-372037445
|
||||
*
|
||||
* @property ContainerBuilder $container
|
||||
*/
|
||||
final class ParameterMergingPhpFileLoader extends PhpFileLoader
|
||||
{
|
||||
/**
|
||||
* @var \Symplify\PackageBuilder\Yaml\ParametersMerger
|
||||
*/
|
||||
private $parametersMerger;
|
||||
public function __construct(ContainerBuilder $containerBuilder, FileLocatorInterface $fileLocator)
|
||||
{
|
||||
$this->parametersMerger = new ParametersMerger();
|
||||
parent::__construct($containerBuilder, $fileLocator);
|
||||
}
|
||||
/**
|
||||
* Same as parent, just merging parameters instead overriding them
|
||||
*
|
||||
* @see https://github.com/symplify/symplify/pull/697
|
||||
* @param mixed $resource
|
||||
* @return mixed
|
||||
*/
|
||||
public function load($resource, string $type = null)
|
||||
{
|
||||
// get old parameters
|
||||
$parameterBag = $this->container->getParameterBag();
|
||||
$oldParameters = $parameterBag->all();
|
||||
parent::load($resource);
|
||||
foreach ($oldParameters as $key => $oldValue) {
|
||||
$currentParameterValue = $this->container->getParameter($key);
|
||||
$newValue = $this->parametersMerger->merge($oldValue, $currentParameterValue);
|
||||
$this->container->setParameter($key, $newValue);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Diff\Output;
|
||||
|
||||
use RectorPrefix202209\SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
||||
/**
|
||||
* @api
|
||||
* Creates @see UnifiedDiffOutputBuilder with "$contextLines = 1000;"
|
||||
*/
|
||||
final class CompleteUnifiedDiffOutputBuilderFactory
|
||||
{
|
||||
/**
|
||||
* @var \Symplify\PackageBuilder\Reflection\PrivatesAccessor
|
||||
*/
|
||||
private $privatesAccessor;
|
||||
public function __construct(PrivatesAccessor $privatesAccessor)
|
||||
{
|
||||
$this->privatesAccessor = $privatesAccessor;
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function create() : UnifiedDiffOutputBuilder
|
||||
{
|
||||
$unifiedDiffOutputBuilder = new UnifiedDiffOutputBuilder('');
|
||||
$this->privatesAccessor->setPrivateProperty($unifiedDiffOutputBuilder, 'contextLines', 10000);
|
||||
return $unifiedDiffOutputBuilder;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Exception\HttpKernel;
|
||||
|
||||
use Exception;
|
||||
final class MissingInterfaceException extends Exception
|
||||
{
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Exception;
|
||||
|
||||
use Exception;
|
||||
final class InvalidPrivatePropertyTypeException extends Exception
|
||||
{
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Exception;
|
||||
|
||||
use Exception;
|
||||
final class MissingPrivatePropertyException extends Exception
|
||||
{
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Exception;
|
||||
|
||||
use Exception;
|
||||
final class MissingServiceException extends Exception
|
||||
{
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Parameter;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
|
||||
use RectorPrefix202209\Symfony\Component\HttpFoundation\ParameterBag;
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\PackageBuilder\Tests\Parameter\ParameterProviderTest
|
||||
*/
|
||||
final class ParameterProvider
|
||||
{
|
||||
/**
|
||||
* @var array<string, mixed>
|
||||
*/
|
||||
private $parameters = [];
|
||||
public function __construct(ContainerInterface $container)
|
||||
{
|
||||
/** @var ParameterBag $parameterBag */
|
||||
$parameterBag = $container->getParameterBag();
|
||||
$this->parameters = $parameterBag->all();
|
||||
}
|
||||
public function hasParameter(string $name) : bool
|
||||
{
|
||||
return isset($this->parameters[$name]);
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
* @return mixed
|
||||
*/
|
||||
public function provideParameter(string $name)
|
||||
{
|
||||
return $this->parameters[$name] ?? null;
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function provideStringParameter(string $name) : string
|
||||
{
|
||||
$this->ensureParameterIsSet($name);
|
||||
return (string) $this->parameters[$name];
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function provideArrayParameter(string $name) : array
|
||||
{
|
||||
$this->ensureParameterIsSet($name);
|
||||
return $this->parameters[$name];
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function provideBoolParameter(string $parameterName) : bool
|
||||
{
|
||||
return $this->parameters[$parameterName] ?? \false;
|
||||
}
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function changeParameter(string $name, $value) : void
|
||||
{
|
||||
$this->parameters[$name] = $value;
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function provide() : array
|
||||
{
|
||||
return $this->parameters;
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function provideIntParameter(string $name) : int
|
||||
{
|
||||
$this->ensureParameterIsSet($name);
|
||||
return (int) $this->parameters[$name];
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function ensureParameterIsSet(string $name) : void
|
||||
{
|
||||
if (\array_key_exists($name, $this->parameters)) {
|
||||
return;
|
||||
}
|
||||
throw new ParameterNotFoundException($name);
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Php;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class TypeChecker
|
||||
{
|
||||
/**
|
||||
* @param array<class-string> $types
|
||||
* @param object|string $object
|
||||
*/
|
||||
public function isInstanceOf($object, array $types) : bool
|
||||
{
|
||||
foreach ($types as $type) {
|
||||
if (\is_a($object, $type, \true)) {
|
||||
return \true;
|
||||
}
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Reflection;
|
||||
|
||||
use ReflectionClass;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class ClassLikeExistenceChecker
|
||||
{
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $sensitiveExistingClasses = [];
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $sensitiveNonExistingClasses = [];
|
||||
public function doesClassLikeExist(string $classLike) : bool
|
||||
{
|
||||
if (\class_exists($classLike)) {
|
||||
return \true;
|
||||
}
|
||||
if (\interface_exists($classLike)) {
|
||||
return \true;
|
||||
}
|
||||
return \trait_exists($classLike);
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function doesClassLikeInsensitiveExists(string $classLikeName) : bool
|
||||
{
|
||||
if (!$this->doesClassLikeExist($classLikeName)) {
|
||||
return \false;
|
||||
}
|
||||
// already known values
|
||||
if (\in_array($classLikeName, $this->sensitiveExistingClasses, \true)) {
|
||||
return \true;
|
||||
}
|
||||
if (\in_array($classLikeName, $this->sensitiveNonExistingClasses, \true)) {
|
||||
return \false;
|
||||
}
|
||||
$reflectionClass = new ReflectionClass($classLikeName);
|
||||
if ($classLikeName !== $reflectionClass->getName()) {
|
||||
$this->sensitiveNonExistingClasses[] = $classLikeName;
|
||||
return \false;
|
||||
}
|
||||
$this->sensitiveExistingClasses[] = $classLikeName;
|
||||
return \true;
|
||||
}
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Reflection;
|
||||
|
||||
use ReflectionProperty;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Exception\InvalidPrivatePropertyTypeException;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Exception\MissingPrivatePropertyException;
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\PackageBuilder\Tests\Reflection\PrivatesAccessorTest
|
||||
*/
|
||||
final class PrivatesAccessor
|
||||
{
|
||||
/**
|
||||
* @template T of object
|
||||
*
|
||||
* @param class-string<T> $valueClassName
|
||||
* @return T
|
||||
*/
|
||||
public function getPrivatePropertyOfClass(object $object, string $propertyName, string $valueClassName) : object
|
||||
{
|
||||
$value = $this->getPrivateProperty($object, $propertyName);
|
||||
if ($value instanceof $valueClassName) {
|
||||
return $value;
|
||||
}
|
||||
$errorMessage = \sprintf('The type "%s" is required, but "%s" type given', $valueClassName, \get_class($value));
|
||||
throw new InvalidPrivatePropertyTypeException($errorMessage);
|
||||
}
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPrivateProperty(object $object, string $propertyName)
|
||||
{
|
||||
$propertyReflection = $this->resolvePropertyReflection($object, $propertyName);
|
||||
$propertyReflection->setAccessible(\true);
|
||||
return $propertyReflection->getValue($object);
|
||||
}
|
||||
/**
|
||||
* @template T of object
|
||||
*
|
||||
* @param class-string<T> $valueClassName
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setPrivatePropertyOfClass(object $object, string $propertyName, $value, string $valueClassName) : void
|
||||
{
|
||||
if ($value instanceof $valueClassName) {
|
||||
$this->setPrivateProperty($object, $propertyName, $value);
|
||||
return;
|
||||
}
|
||||
$errorMessage = \sprintf('The type "%s" is required, but "%s" type given', $valueClassName, \get_class($value));
|
||||
throw new InvalidPrivatePropertyTypeException($errorMessage);
|
||||
}
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setPrivateProperty(object $object, string $propertyName, $value) : void
|
||||
{
|
||||
$propertyReflection = $this->resolvePropertyReflection($object, $propertyName);
|
||||
$propertyReflection->setAccessible(\true);
|
||||
$propertyReflection->setValue($object, $value);
|
||||
}
|
||||
private function resolvePropertyReflection(object $object, string $propertyName) : ReflectionProperty
|
||||
{
|
||||
if (\property_exists($object, $propertyName)) {
|
||||
return new ReflectionProperty($object, $propertyName);
|
||||
}
|
||||
$parentClass = \get_parent_class($object);
|
||||
if ($parentClass !== \false) {
|
||||
return new ReflectionProperty($parentClass, $propertyName);
|
||||
}
|
||||
$errorMessage = \sprintf('Property "$%s" was not found in "%s" class', $propertyName, \get_class($object));
|
||||
throw new MissingPrivatePropertyException($errorMessage);
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Reflection;
|
||||
|
||||
use ReflectionClass;
|
||||
use ReflectionMethod;
|
||||
/**
|
||||
* @see \Symplify\PackageBuilder\Tests\Reflection\PrivatesCallerTest
|
||||
*/
|
||||
final class PrivatesCaller
|
||||
{
|
||||
/**
|
||||
* @api
|
||||
* @param mixed[] $arguments
|
||||
* @param object|string $object
|
||||
* @return mixed
|
||||
*/
|
||||
public function callPrivateMethod($object, string $methodName, array $arguments)
|
||||
{
|
||||
if (\is_string($object)) {
|
||||
$reflectionClass = new ReflectionClass($object);
|
||||
$object = $reflectionClass->newInstanceWithoutConstructor();
|
||||
}
|
||||
$methodReflection = $this->createAccessibleMethodReflection($object, $methodName);
|
||||
return $methodReflection->invokeArgs($object, $arguments);
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
* @param object|string $object
|
||||
* @param mixed $argument
|
||||
* @return mixed
|
||||
*/
|
||||
public function callPrivateMethodWithReference($object, string $methodName, $argument)
|
||||
{
|
||||
if (\is_string($object)) {
|
||||
$reflectionClass = new ReflectionClass($object);
|
||||
$object = $reflectionClass->newInstanceWithoutConstructor();
|
||||
}
|
||||
$methodReflection = $this->createAccessibleMethodReflection($object, $methodName);
|
||||
$methodReflection->invokeArgs($object, [&$argument]);
|
||||
return $argument;
|
||||
}
|
||||
private function createAccessibleMethodReflection(object $object, string $methodName) : ReflectionMethod
|
||||
{
|
||||
$reflectionMethod = new ReflectionMethod(\get_class($object), $methodName);
|
||||
$reflectionMethod->setAccessible(\true);
|
||||
return $reflectionMethod;
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Strings;
|
||||
|
||||
use RectorPrefix202209\Nette\Utils\Strings;
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\PackageBuilder\Tests\Strings\StringFormatConverterTest
|
||||
*/
|
||||
final class StringFormatConverter
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
* @see https://regex101.com/r/rl1nvl/1
|
||||
*/
|
||||
private const BIG_LETTER_REGEX = '#([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]*)#';
|
||||
public function underscoreAndHyphenToCamelCase(string $value) : string
|
||||
{
|
||||
$underscoreToHyphensValue = \str_replace(['_', '-'], ' ', $value);
|
||||
$uppercasedWords = \ucwords($underscoreToHyphensValue);
|
||||
$value = \str_replace(' ', '', $uppercasedWords);
|
||||
return \lcfirst($value);
|
||||
}
|
||||
public function camelCaseToUnderscore(string $input) : string
|
||||
{
|
||||
return $this->camelCaseToGlue($input, '_');
|
||||
}
|
||||
public function camelCaseToDashed(string $input) : string
|
||||
{
|
||||
return $this->camelCaseToGlue($input, '-');
|
||||
}
|
||||
/**
|
||||
* @param array<int|string, mixed> $items
|
||||
* @return array<int|string, mixed>
|
||||
*/
|
||||
public function camelCaseToUnderscoreInArrayKeys(array $items) : array
|
||||
{
|
||||
foreach ($items as $key => $value) {
|
||||
if (!\is_string($key)) {
|
||||
continue;
|
||||
}
|
||||
$newKey = $this->camelCaseToUnderscore($key);
|
||||
if ($key === $newKey) {
|
||||
continue;
|
||||
}
|
||||
$items[$newKey] = $value;
|
||||
unset($items[$key]);
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
private function camelCaseToGlue(string $input, string $glue) : string
|
||||
{
|
||||
$matches = Strings::matchAll($input, self::BIG_LETTER_REGEX);
|
||||
$parts = [];
|
||||
foreach ($matches as $match) {
|
||||
$parts[] = $match[0] === \strtoupper($match[0]) ? \strtolower($match[0]) : \lcfirst($match[0]);
|
||||
}
|
||||
return \implode($glue, $parts);
|
||||
}
|
||||
}
|
@ -1,228 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Symplify\PackageBuilder\Testing;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use ReflectionClass;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Contracts\Service\ResetInterface;
|
||||
use Symplify\PackageBuilder\Contract\HttpKernel\ExtraConfigAwareKernelInterface;
|
||||
use Symplify\PackageBuilder\Exception\HttpKernel\MissingInterfaceException;
|
||||
use Symplify\PackageBuilder\Exception\MissingServiceException;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
use Symplify\SymplifyKernel\Contract\LightKernelInterface;
|
||||
use Symplify\SymplifyKernel\Exception\ShouldNotHappenException;
|
||||
|
||||
/**
|
||||
* Inspiration
|
||||
*
|
||||
* @see https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
|
||||
*/
|
||||
abstract class AbstractKernelTestCase extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var \Symfony\Component\HttpKernel\KernelInterface|\Symplify\SymplifyKernel\Contract\LightKernelInterface|null
|
||||
*/
|
||||
protected static $kernel = null;
|
||||
|
||||
/**
|
||||
* @var \Symfony\Component\DependencyInjection\ContainerInterface|null
|
||||
*/
|
||||
protected static $container;
|
||||
|
||||
/**
|
||||
* @param class-string<KernelInterface|LightKernelInterface> $kernelClass
|
||||
* @param string[]|SmartFileInfo[] $configs
|
||||
*/
|
||||
protected function bootKernelWithConfigs(string $kernelClass, array $configs): void
|
||||
{
|
||||
// unwrap file infos to real paths
|
||||
$configFilePaths = $this->resolveConfigFilePaths($configs);
|
||||
$configsHash = $this->resolveConfigsHash($configFilePaths);
|
||||
|
||||
$this->ensureKernelShutdown();
|
||||
|
||||
$bootedKernel = $this->createBootedKernelFromConfigs($kernelClass, $configsHash, $configFilePaths);
|
||||
|
||||
static::$kernel = $bootedKernel;
|
||||
self::$container = $bootedKernel->getContainer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Syntax sugger to remove static from the test cases vision
|
||||
*
|
||||
* @template T of object
|
||||
* @param class-string<T> $type
|
||||
* @return T
|
||||
*/
|
||||
protected function getService(string $type): object
|
||||
{
|
||||
if (self::$container === null) {
|
||||
throw new ShouldNotHappenException('First, create container with booKernel(KernelClass::class)');
|
||||
}
|
||||
|
||||
$service = self::$container->get($type);
|
||||
if ($service === null) {
|
||||
$errorMessage = sprintf('Services "%s" was not found', $type);
|
||||
throw new MissingServiceException($errorMessage);
|
||||
}
|
||||
|
||||
return $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param class-string<KernelInterface|LightKernelInterface> $kernelClass
|
||||
*/
|
||||
protected function bootKernel(string $kernelClass): void
|
||||
{
|
||||
if (is_a($kernelClass, LightKernelInterface::class, true)) {
|
||||
/** @var LightKernelInterface $kernel */
|
||||
$kernel = new $kernelClass();
|
||||
$kernel->createFromConfigs([]);
|
||||
|
||||
static::$kernel = $kernel;
|
||||
self::$container = $kernel->getContainer();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->ensureKernelShutdown();
|
||||
|
||||
$kernel = new $kernelClass('test', true);
|
||||
if (! $kernel instanceof KernelInterface) {
|
||||
throw new ShouldNotHappenException();
|
||||
}
|
||||
|
||||
static::$kernel = $this->bootAndReturnKernel($kernel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shuts the kernel down if it was used in the test.
|
||||
*/
|
||||
protected function ensureKernelShutdown(): void
|
||||
{
|
||||
if (static::$kernel !== null && static::$kernel instanceof KernelInterface) {
|
||||
// make sure boot() is called
|
||||
// @see https://github.com/symfony/symfony/pull/31202/files
|
||||
$kernelReflectionClass = new ReflectionClass(static::$kernel);
|
||||
|
||||
$containerReflectionProperty = $kernelReflectionClass->getProperty('container');
|
||||
$containerReflectionProperty->setAccessible(true);
|
||||
|
||||
$kernel = $containerReflectionProperty->getValue(static::$kernel);
|
||||
if ($kernel !== null) {
|
||||
$container = static::$kernel->getContainer();
|
||||
static::$kernel->shutdown();
|
||||
if ($container instanceof ResetInterface) {
|
||||
$container->reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static::$container = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $configs
|
||||
*/
|
||||
protected function resolveConfigsHash(array $configs): string
|
||||
{
|
||||
$configsHash = '';
|
||||
foreach ($configs as $config) {
|
||||
$configsHash .= md5_file($config);
|
||||
}
|
||||
|
||||
return md5($configsHash);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[]|SmartFileInfo[] $configs
|
||||
* @return string[]
|
||||
*/
|
||||
protected function resolveConfigFilePaths(array $configs): array
|
||||
{
|
||||
$configFilePaths = [];
|
||||
|
||||
foreach ($configs as $config) {
|
||||
$configFilePaths[] = $config instanceof SmartFileInfo ? $config->getRealPath() : $config;
|
||||
}
|
||||
|
||||
return $configFilePaths;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Symfony\Component\HttpKernel\KernelInterface|\Symplify\SymplifyKernel\Contract\LightKernelInterface $kernel
|
||||
*/
|
||||
private function ensureIsConfigAwareKernel($kernel): void
|
||||
{
|
||||
if ($kernel instanceof LightKernelInterface) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($kernel instanceof ExtraConfigAwareKernelInterface) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw new MissingInterfaceException(sprintf(
|
||||
'"%s" is missing an "%s" interface',
|
||||
get_class($kernel),
|
||||
ExtraConfigAwareKernelInterface::class
|
||||
));
|
||||
}
|
||||
|
||||
private function bootAndReturnKernel(KernelInterface $kernel): KernelInterface
|
||||
{
|
||||
$kernel->boot();
|
||||
|
||||
$container = $kernel->getContainer();
|
||||
|
||||
// private → public service hack?
|
||||
if ($container->has('test.service_container')) {
|
||||
$container = $container->get('test.service_container');
|
||||
}
|
||||
|
||||
if (! $container instanceof ContainerInterface) {
|
||||
throw new ShouldNotHappenException();
|
||||
}
|
||||
|
||||
// has output? keep it silent out of tests
|
||||
if ($container->has(SymfonyStyle::class)) {
|
||||
$symfonyStyle = $container->get(SymfonyStyle::class);
|
||||
$symfonyStyle->setVerbosity(OutputInterface::VERBOSITY_QUIET);
|
||||
}
|
||||
|
||||
static::$container = $container;
|
||||
|
||||
return $kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param class-string<KernelInterface|LightKernelInterface> $kernelClass
|
||||
* @param string[] $configFilePaths
|
||||
* @return \Symfony\Component\HttpKernel\KernelInterface|\Symplify\SymplifyKernel\Contract\LightKernelInterface
|
||||
*/
|
||||
private function createBootedKernelFromConfigs(
|
||||
string $kernelClass,
|
||||
string $configsHash,
|
||||
array $configFilePaths
|
||||
) {
|
||||
if (is_a($kernelClass, LightKernelInterface::class, true)) {
|
||||
/** @var LightKernelInterface $kernel */
|
||||
$kernel = new $kernelClass();
|
||||
$kernel->createFromConfigs($configFilePaths);
|
||||
return $kernel;
|
||||
}
|
||||
|
||||
$kernel = new $kernelClass('test_' . $configsHash, true);
|
||||
$this->ensureIsConfigAwareKernel($kernel);
|
||||
|
||||
/** @var ExtraConfigAwareKernelInterface $kernel */
|
||||
$kernel->setConfigs($configFilePaths);
|
||||
|
||||
return $this->bootAndReturnKernel($kernel);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\ValueObject;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class ConsoleColorDiffConfig
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const FILE_PATH = __DIR__ . '/../../config/config.php';
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\ValueObject;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class MethodName
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const CONSTRUCTOR = '__construct';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const SET_UP = 'setUp';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const INVOKE = '__invoke';
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\ValueObject;
|
||||
|
||||
final class Option
|
||||
{
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const CONFIG = 'config';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const SOURCES = 'sources';
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\PackageBuilder\Yaml;
|
||||
|
||||
final class ParametersMerger
|
||||
{
|
||||
/**
|
||||
* Merges configurations. Left has higher priority than right one.
|
||||
*
|
||||
* @autor David Grudl (https://davidgrudl.com)
|
||||
* @source https://github.com/nette/di/blob/8eb90721a131262f17663e50aee0032a62d0ef08/src/DI/Config/Helpers.php#L31
|
||||
* @param mixed $left
|
||||
* @param mixed $right
|
||||
* @return mixed
|
||||
*/
|
||||
public function merge($left, $right)
|
||||
{
|
||||
if (\is_array($left) && \is_array($right)) {
|
||||
return $this->mergeLeftToRightWithCallable($left, $right, function ($leftValue, $rightValue) {
|
||||
return $this->merge($leftValue, $rightValue);
|
||||
});
|
||||
}
|
||||
if ($left !== null) {
|
||||
return $left;
|
||||
}
|
||||
if (!\is_array($right)) {
|
||||
return $left;
|
||||
}
|
||||
return $right;
|
||||
}
|
||||
/**
|
||||
* The same as above, just with the case if both values being non-array, it will combined them to array:
|
||||
*
|
||||
* $this->mergeWithCombine(1, 2); // [1, 2]
|
||||
* @param mixed $left
|
||||
* @param mixed $right
|
||||
* @return mixed
|
||||
*/
|
||||
public function mergeWithCombine($left, $right)
|
||||
{
|
||||
if (\is_array($left) && \is_array($right)) {
|
||||
return $this->mergeLeftToRightWithCallable($left, $right, function ($leftValue, $rightValue) {
|
||||
return $this->mergeWithCombine($leftValue, $rightValue);
|
||||
});
|
||||
}
|
||||
if ($left === null && \is_array($right)) {
|
||||
return $right;
|
||||
}
|
||||
if (!empty($right) && (array) $left !== (array) $right) {
|
||||
return $this->mergeWithCombine((array) $right, (array) $left);
|
||||
}
|
||||
return $left;
|
||||
}
|
||||
/**
|
||||
* @param array<int|string, mixed> $left
|
||||
* @param array<int|string, mixed> $right
|
||||
* @return mixed[]
|
||||
*/
|
||||
private function mergeLeftToRightWithCallable(array $left, array $right, callable $mergeCallback) : array
|
||||
{
|
||||
foreach ($left as $key => $val) {
|
||||
if (\is_int($key)) {
|
||||
// prevent duplicated values in unindexed arrays
|
||||
if (!\in_array($val, $right, \true)) {
|
||||
$right[] = $val;
|
||||
}
|
||||
} else {
|
||||
if (isset($right[$key])) {
|
||||
$val = $mergeCallback($val, $right[$key]);
|
||||
}
|
||||
$right[$key] = $val;
|
||||
}
|
||||
}
|
||||
return $right;
|
||||
}
|
||||
}
|
@ -17,24 +17,24 @@
|
||||
}
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/composer-json-manipulator": "<11.1.7",
|
||||
"symplify\/easy-coding-standard": "<11.1.7",
|
||||
"symplify\/phpstan-rules": "<11.1.7",
|
||||
"symplify\/easy-testing": "<11.1.7",
|
||||
"symplify\/php-config-printer": "<11.1.7",
|
||||
"symplify\/autowire-array-parameter": "<11.1.7",
|
||||
"symplify\/package-builder": "<11.1.7",
|
||||
"symplify\/phpstan-extensions": "<11.1.7",
|
||||
"symplify\/rule-doc-generator": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7",
|
||||
"symplify\/smart-file-system": "<11.1.7",
|
||||
"symplify\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/symplify-kernel": "<11.1.7",
|
||||
"symplify\/monorepo-builder": "<11.1.7",
|
||||
"symplify\/config-transformer": "<11.1.7",
|
||||
"symplify\/easy-ci": "<11.1.7",
|
||||
"symplify\/coding-standard": "<11.1.7",
|
||||
"symplify\/easy-parallel": "<11.1.7"
|
||||
"symplify\/composer-json-manipulator": "<11.1.9",
|
||||
"symplify\/easy-coding-standard": "<11.1.9",
|
||||
"symplify\/phpstan-rules": "<11.1.9",
|
||||
"symplify\/easy-testing": "<11.1.9",
|
||||
"symplify\/php-config-printer": "<11.1.9",
|
||||
"symplify\/autowire-array-parameter": "<11.1.9",
|
||||
"symplify\/package-builder": "<11.1.9",
|
||||
"symplify\/phpstan-extensions": "<11.1.9",
|
||||
"symplify\/rule-doc-generator": "<11.1.9",
|
||||
"symplify\/vendor-patches": "<11.1.9",
|
||||
"symplify\/smart-file-system": "<11.1.9",
|
||||
"symplify\/symfony-static-dumper": "<11.1.9",
|
||||
"symplify\/symplify-kernel": "<11.1.9",
|
||||
"symplify\/monorepo-builder": "<11.1.9",
|
||||
"symplify\/config-transformer": "<11.1.9",
|
||||
"symplify\/easy-ci": "<11.1.9",
|
||||
"symplify\/coding-standard": "<11.1.9",
|
||||
"symplify\/easy-parallel": "<11.1.9"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
|
Loading…
x
Reference in New Issue
Block a user