mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 21:38:22 +01:00
Updated Rector to commit 88b75c6180cab29f49e7ec6567df80b052987978
88b75c6180
[Console] Move color differ here (#2887)
This commit is contained in:
parent
a295f6325a
commit
72019c1f5a
@ -45,6 +45,7 @@ use Rector\PhpDocParser\PhpParser\SmartPhpParserFactory;
|
||||
use Rector\PSR4\Composer\PSR4NamespaceMatcher;
|
||||
use Rector\PSR4\Contract\PSR4AutoloadNamespaceMatcherInterface;
|
||||
use Rector\Utils\Command\MissingInSetCommand;
|
||||
use RectorPrefix202209\SebastianBergmann\Diff\Differ;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Application;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use function RectorPrefix202209\Symfony\Component\DependencyInjection\Loader\Configurator\service;
|
||||
@ -142,4 +143,6 @@ 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);
|
||||
};
|
||||
|
@ -3,11 +3,11 @@
|
||||
declare (strict_types=1);
|
||||
namespace Rector\ChangesReporting\ValueObjectFactory;
|
||||
|
||||
use Rector\Core\Console\Formatter\ConsoleDiffer;
|
||||
use Rector\Core\Differ\DefaultDiffer;
|
||||
use Rector\Core\FileSystem\FilePathHelper;
|
||||
use Rector\Core\ValueObject\Application\File;
|
||||
use Rector\Core\ValueObject\Reporting\FileDiff;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Console\Output\ConsoleDiffer;
|
||||
final class FileDiffFactory
|
||||
{
|
||||
/**
|
||||
@ -17,7 +17,7 @@ final class FileDiffFactory
|
||||
private $defaultDiffer;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Symplify\PackageBuilder\Console\Output\ConsoleDiffer
|
||||
* @var \Rector\Core\Console\Formatter\ConsoleDiffer
|
||||
*/
|
||||
private $consoleDiffer;
|
||||
/**
|
||||
|
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '5a2897090e0cce57c2b6849a9d70c1cf3fb1cba9';
|
||||
public const PACKAGE_VERSION = '88b75c6180cab29f49e7ec6567df80b052987978';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-09-01 20:24:19';
|
||||
public const RELEASE_DATE = '2022-09-01 22:51:33';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
85
src/Console/Formatter/ColorConsoleDiffFormatter.php
Normal file
85
src/Console/Formatter/ColorConsoleDiffFormatter.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Core\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 \Rector\Core\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#";
|
||||
/**
|
||||
* @readonly
|
||||
* @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>');
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Core\Console\Formatter;
|
||||
|
||||
use Rector\Core\Util\Reflection\PrivatesAccessor;
|
||||
use RectorPrefix202209\SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
|
||||
/**
|
||||
* @api
|
||||
* Creates @see UnifiedDiffOutputBuilder with "$contextLines = 1000;"
|
||||
*/
|
||||
final class CompleteUnifiedDiffOutputBuilderFactory
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Util\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;
|
||||
}
|
||||
}
|
29
src/Console/Formatter/ConsoleDiffer.php
Normal file
29
src/Console/Formatter/ConsoleDiffer.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Core\Console\Formatter;
|
||||
|
||||
use RectorPrefix202209\SebastianBergmann\Diff\Differ;
|
||||
final class ConsoleDiffer
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \SebastianBergmann\Diff\Differ
|
||||
*/
|
||||
private $differ;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Console\Formatter\ColorConsoleDiffFormatter
|
||||
*/
|
||||
private $colorConsoleDiffFormatter;
|
||||
public function __construct(Differ $differ, \Rector\Core\Console\Formatter\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);
|
||||
}
|
||||
}
|
@ -14,7 +14,6 @@ use RectorPrefix202209\Symfony\Component\DependencyInjection\Compiler\CompilerPa
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use RectorPrefix202209\Symplify\AutowireArrayParameter\DependencyInjection\CompilerPass\AutowireArrayParameterCompilerPass;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\ValueObject\ConsoleColorDiffConfig;
|
||||
final class RectorKernel
|
||||
{
|
||||
/**
|
||||
@ -81,6 +80,6 @@ final class RectorKernel
|
||||
*/
|
||||
private function createDefaultConfigFiles() : array
|
||||
{
|
||||
return [__DIR__ . '/../../config/config.php', ConsoleColorDiffConfig::FILE_PATH];
|
||||
return [__DIR__ . '/../../config/config.php'];
|
||||
}
|
||||
}
|
||||
|
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 ComposerAutoloaderInit5f34428cc73dcc52824027dcd8b2ebce::getLoader();
|
||||
return ComposerAutoloaderInit291bc7b6a5e3747633629f0a860a1c37::getLoader();
|
||||
|
23
vendor/composer/autoload_classmap.php
vendored
23
vendor/composer/autoload_classmap.php
vendored
@ -1063,26 +1063,6 @@ return array(
|
||||
'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\\Symplify\\SmartFileSystem\\Exception\\DirectoryNotFoundException' => $vendorDir . '/symplify/smart-file-system/src/Exception/DirectoryNotFoundException.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Exception\\FileNotFoundException' => $vendorDir . '/symplify/smart-file-system/src/Exception/FileNotFoundException.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\FileSystemFilter' => $vendorDir . '/symplify/smart-file-system/src/FileSystemFilter.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\FileSystemGuard' => $vendorDir . '/symplify/smart-file-system/src/FileSystemGuard.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Finder\\FinderSanitizer' => $vendorDir . '/symplify/smart-file-system/src/Finder/FinderSanitizer.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Finder\\SmartFinder' => $vendorDir . '/symplify/smart-file-system/src/Finder/SmartFinder.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Json\\JsonFileSystem' => $vendorDir . '/symplify/smart-file-system/src/Json/JsonFileSystem.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Normalizer\\PathNormalizer' => $vendorDir . '/symplify/smart-file-system/src/Normalizer/PathNormalizer.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\SmartFileInfo' => $vendorDir . '/symplify/smart-file-system/src/SmartFileInfo.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\SmartFileSystem' => $vendorDir . '/symplify/smart-file-system/src/SmartFileSystem.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Config\\Loader\\ParameterMergingLoaderFactory' => $vendorDir . '/symplify/symplify-kernel/src/Config/Loader/ParameterMergingLoaderFactory.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\ContainerBuilderFactory' => $vendorDir . '/symplify/symplify-kernel/src/ContainerBuilderFactory.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Contract\\Config\\LoaderFactoryInterface' => $vendorDir . '/symplify/symplify-kernel/src/Contract/Config/LoaderFactoryInterface.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Contract\\LightKernelInterface' => $vendorDir . '/symplify/symplify-kernel/src/Contract/LightKernelInterface.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\DependencyInjection\\LoadExtensionConfigsCompilerPass' => $vendorDir . '/symplify/symplify-kernel/src/DependencyInjection/LoadExtensionConfigsCompilerPass.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Exception\\BootException' => $vendorDir . '/symplify/symplify-kernel/src/Exception/BootException.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Exception\\ShouldNotHappenException' => $vendorDir . '/symplify/symplify-kernel/src/Exception/ShouldNotHappenException.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\HttpKernel\\AbstractSymplifyKernel' => $vendorDir . '/symplify/symplify-kernel/src/HttpKernel/AbstractSymplifyKernel.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\ValueObject\\KernelBootAndApplicationRun' => $vendorDir . '/symplify/symplify-kernel/src/ValueObject/KernelBootAndApplicationRun.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\ValueObject\\SymplifyKernelConfig' => $vendorDir . '/symplify/symplify-kernel/src/ValueObject/SymplifyKernelConfig.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',
|
||||
@ -1373,6 +1353,9 @@ return array(
|
||||
'Rector\\Core\\Console\\Command\\ProcessCommand' => $baseDir . '/src/Console/Command/ProcessCommand.php',
|
||||
'Rector\\Core\\Console\\Command\\WorkerCommand' => $baseDir . '/src/Console/Command/WorkerCommand.php',
|
||||
'Rector\\Core\\Console\\ConsoleApplication' => $baseDir . '/src/Console/ConsoleApplication.php',
|
||||
'Rector\\Core\\Console\\Formatter\\ColorConsoleDiffFormatter' => $baseDir . '/src/Console/Formatter/ColorConsoleDiffFormatter.php',
|
||||
'Rector\\Core\\Console\\Formatter\\CompleteUnifiedDiffOutputBuilderFactory' => $baseDir . '/src/Console/Formatter/CompleteUnifiedDiffOutputBuilderFactory.php',
|
||||
'Rector\\Core\\Console\\Formatter\\ConsoleDiffer' => $baseDir . '/src/Console/Formatter/ConsoleDiffer.php',
|
||||
'Rector\\Core\\Console\\Output\\OutputFormatterCollector' => $baseDir . '/src/Console/Output/OutputFormatterCollector.php',
|
||||
'Rector\\Core\\Console\\Output\\RectorOutputStyle' => $baseDir . '/src/Console/Output/RectorOutputStyle.php',
|
||||
'Rector\\Core\\Console\\Style\\RectorConsoleOutputStyle' => $baseDir . '/src/Console/Style/RectorConsoleOutputStyle.php',
|
||||
|
2
vendor/composer/autoload_files.php
vendored
2
vendor/composer/autoload_files.php
vendored
@ -6,8 +6,8 @@ $vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.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',
|
||||
|
2
vendor/composer/autoload_psr4.php
vendored
2
vendor/composer/autoload_psr4.php
vendored
@ -20,8 +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\\SymplifyKernel\\' => array($vendorDir . '/symplify/symplify-kernel/src'),
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\' => array($vendorDir . '/symplify/smart-file-system/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'),
|
||||
|
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 ComposerAutoloaderInit5f34428cc73dcc52824027dcd8b2ebce
|
||||
class ComposerAutoloaderInit291bc7b6a5e3747633629f0a860a1c37
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInit5f34428cc73dcc52824027dcd8b2ebce
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit5f34428cc73dcc52824027dcd8b2ebce', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit291bc7b6a5e3747633629f0a860a1c37', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit5f34428cc73dcc52824027dcd8b2ebce', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit291bc7b6a5e3747633629f0a860a1c37', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit291bc7b6a5e3747633629f0a860a1c37::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit291bc7b6a5e3747633629f0a860a1c37::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire5f34428cc73dcc52824027dcd8b2ebce($fileIdentifier, $file);
|
||||
composerRequire291bc7b6a5e3747633629f0a860a1c37($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInit5f34428cc73dcc52824027dcd8b2ebce
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire5f34428cc73dcc52824027dcd8b2ebce($fileIdentifier, $file)
|
||||
function composerRequire291bc7b6a5e3747633629f0a860a1c37($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
43
vendor/composer/autoload_static.php
vendored
43
vendor/composer/autoload_static.php
vendored
@ -4,11 +4,11 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce
|
||||
class ComposerStaticInit291bc7b6a5e3747633629f0a860a1c37
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.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',
|
||||
@ -37,8 +37,6 @@ class ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce
|
||||
'Rector\\CakePHP\\' => 15,
|
||||
'Rector\\' => 7,
|
||||
'RectorPrefix202209\\Webmozart\\Assert\\' => 36,
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\' => 43,
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\' => 44,
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\' => 43,
|
||||
'RectorPrefix202209\\Symplify\\EasyParallel\\' => 41,
|
||||
'RectorPrefix202209\\Symplify\\AutowireArrayParameter\\' => 51,
|
||||
@ -137,14 +135,6 @@ class ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/webmozart/assert/src',
|
||||
),
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symplify/symplify-kernel/src',
|
||||
),
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symplify/smart-file-system/src',
|
||||
),
|
||||
'RectorPrefix202209\\Symplify\\PackageBuilder\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symplify/package-builder/src',
|
||||
@ -1333,26 +1323,6 @@ class ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce
|
||||
'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\\Symplify\\SmartFileSystem\\Exception\\DirectoryNotFoundException' => __DIR__ . '/..' . '/symplify/smart-file-system/src/Exception/DirectoryNotFoundException.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Exception\\FileNotFoundException' => __DIR__ . '/..' . '/symplify/smart-file-system/src/Exception/FileNotFoundException.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\FileSystemFilter' => __DIR__ . '/..' . '/symplify/smart-file-system/src/FileSystemFilter.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\FileSystemGuard' => __DIR__ . '/..' . '/symplify/smart-file-system/src/FileSystemGuard.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Finder\\FinderSanitizer' => __DIR__ . '/..' . '/symplify/smart-file-system/src/Finder/FinderSanitizer.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Finder\\SmartFinder' => __DIR__ . '/..' . '/symplify/smart-file-system/src/Finder/SmartFinder.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Json\\JsonFileSystem' => __DIR__ . '/..' . '/symplify/smart-file-system/src/Json/JsonFileSystem.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\Normalizer\\PathNormalizer' => __DIR__ . '/..' . '/symplify/smart-file-system/src/Normalizer/PathNormalizer.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\SmartFileInfo' => __DIR__ . '/..' . '/symplify/smart-file-system/src/SmartFileInfo.php',
|
||||
'RectorPrefix202209\\Symplify\\SmartFileSystem\\SmartFileSystem' => __DIR__ . '/..' . '/symplify/smart-file-system/src/SmartFileSystem.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Config\\Loader\\ParameterMergingLoaderFactory' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/Config/Loader/ParameterMergingLoaderFactory.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\ContainerBuilderFactory' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/ContainerBuilderFactory.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Contract\\Config\\LoaderFactoryInterface' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/Contract/Config/LoaderFactoryInterface.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Contract\\LightKernelInterface' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/Contract/LightKernelInterface.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\DependencyInjection\\LoadExtensionConfigsCompilerPass' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/DependencyInjection/LoadExtensionConfigsCompilerPass.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Exception\\BootException' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/Exception/BootException.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\Exception\\ShouldNotHappenException' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/Exception/ShouldNotHappenException.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\HttpKernel\\AbstractSymplifyKernel' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/HttpKernel/AbstractSymplifyKernel.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\ValueObject\\KernelBootAndApplicationRun' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/ValueObject/KernelBootAndApplicationRun.php',
|
||||
'RectorPrefix202209\\Symplify\\SymplifyKernel\\ValueObject\\SymplifyKernelConfig' => __DIR__ . '/..' . '/symplify/symplify-kernel/src/ValueObject/SymplifyKernelConfig.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',
|
||||
@ -1643,6 +1613,9 @@ class ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce
|
||||
'Rector\\Core\\Console\\Command\\ProcessCommand' => __DIR__ . '/../..' . '/src/Console/Command/ProcessCommand.php',
|
||||
'Rector\\Core\\Console\\Command\\WorkerCommand' => __DIR__ . '/../..' . '/src/Console/Command/WorkerCommand.php',
|
||||
'Rector\\Core\\Console\\ConsoleApplication' => __DIR__ . '/../..' . '/src/Console/ConsoleApplication.php',
|
||||
'Rector\\Core\\Console\\Formatter\\ColorConsoleDiffFormatter' => __DIR__ . '/../..' . '/src/Console/Formatter/ColorConsoleDiffFormatter.php',
|
||||
'Rector\\Core\\Console\\Formatter\\CompleteUnifiedDiffOutputBuilderFactory' => __DIR__ . '/../..' . '/src/Console/Formatter/CompleteUnifiedDiffOutputBuilderFactory.php',
|
||||
'Rector\\Core\\Console\\Formatter\\ConsoleDiffer' => __DIR__ . '/../..' . '/src/Console/Formatter/ConsoleDiffer.php',
|
||||
'Rector\\Core\\Console\\Output\\OutputFormatterCollector' => __DIR__ . '/../..' . '/src/Console/Output/OutputFormatterCollector.php',
|
||||
'Rector\\Core\\Console\\Output\\RectorOutputStyle' => __DIR__ . '/../..' . '/src/Console/Output/RectorOutputStyle.php',
|
||||
'Rector\\Core\\Console\\Style\\RectorConsoleOutputStyle' => __DIR__ . '/../..' . '/src/Console/Style/RectorConsoleOutputStyle.php',
|
||||
@ -3149,9 +3122,9 @@ class ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit5f34428cc73dcc52824027dcd8b2ebce::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit291bc7b6a5e3747633629f0a860a1c37::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit291bc7b6a5e3747633629f0a860a1c37::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit291bc7b6a5e3747633629f0a860a1c37::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
166
vendor/composer/installed.json
vendored
166
vendor/composer/installed.json
vendored
@ -3108,24 +3108,23 @@
|
||||
},
|
||||
{
|
||||
"name": "symplify\/autowire-array-parameter",
|
||||
"version": "11.1.7",
|
||||
"version_normalized": "11.1.7.0",
|
||||
"version": "dev-main",
|
||||
"version_normalized": "dev-main",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/autowire-array-parameter.git",
|
||||
"reference": "463ddeb0bcc6d69fbcee7135b591a54ed5fab94c"
|
||||
"reference": "6695dcbc57a7d806a820d44746847b0b22f15896"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/autowire-array-parameter\/zipball\/463ddeb0bcc6d69fbcee7135b591a54ed5fab94c",
|
||||
"reference": "463ddeb0bcc6d69fbcee7135b591a54ed5fab94c",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/autowire-array-parameter\/zipball\/6695dcbc57a7d806a820d44746847b0b22f15896",
|
||||
"reference": "6695dcbc57a7d806a820d44746847b0b22f15896",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"nette\/utils": "^3.2",
|
||||
"php": ">=8.0",
|
||||
"symfony\/dependency-injection": "^6.0",
|
||||
"symplify\/package-builder": "^11.1.7"
|
||||
"symfony\/dependency-injection": "^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symplify\/coding-standard": "<11.1.7",
|
||||
@ -3148,9 +3147,11 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.23",
|
||||
"symplify\/symplify-kernel": "^11.1.7"
|
||||
"symplify\/package-builder": "^11.2",
|
||||
"symplify\/symplify-kernel": "^11.2"
|
||||
},
|
||||
"time": "2022-09-01T19:30:33+00:00",
|
||||
"time": "2022-09-01T20:39:14+00:00",
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -3169,7 +3170,7 @@
|
||||
],
|
||||
"description": "Autowire array parameters for your Symfony applications",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/autowire-array-parameter\/tree\/11.1.7"
|
||||
"source": "https:\/\/github.com\/symplify\/autowire-array-parameter\/tree\/main"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -3406,151 +3407,6 @@
|
||||
],
|
||||
"install-path": "..\/symplify\/rule-doc-generator-contracts"
|
||||
},
|
||||
{
|
||||
"name": "symplify\/smart-file-system",
|
||||
"version": "11.1.7",
|
||||
"version_normalized": "11.1.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/smart-file-system.git",
|
||||
"reference": "27a558183ad321a8a42465cf28f51b94ef96ffae"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/smart-file-system\/zipball\/27a558183ad321a8a42465cf28f51b94ef96ffae",
|
||||
"reference": "27a558183ad321a8a42465cf28f51b94ef96ffae",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"nette\/utils": "^3.2",
|
||||
"php": ">=8.0",
|
||||
"symfony\/filesystem": "^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\/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\/rule-doc-generator-contracts": "<11.1.7",
|
||||
"symplify\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/symplify-kernel": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"nette\/finder": "^2.5.3",
|
||||
"phpunit\/phpunit": "^9.5.23"
|
||||
},
|
||||
"time": "2022-09-01T19:30:01+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "11.2-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202209\\Symplify\\SmartFileSystem\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https:\/\/packagist.org\/downloads\/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Sanitized FileInfo with safe getRealPath() and other handy methods",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/smart-file-system\/tree\/11.1.7"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https:\/\/www.paypal.me\/rectorphp",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https:\/\/github.com\/tomasvotruba",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"install-path": "..\/symplify\/smart-file-system"
|
||||
},
|
||||
{
|
||||
"name": "symplify\/symplify-kernel",
|
||||
"version": "11.1.7",
|
||||
"version_normalized": "11.1.7.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/symplify\/symplify-kernel.git",
|
||||
"reference": "6273fb5d5b3cbaa2ddf1bab862e2328f1bd48873"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/symplify\/symplify-kernel\/zipball\/6273fb5d5b3cbaa2ddf1bab862e2328f1bd48873",
|
||||
"reference": "6273fb5d5b3cbaa2ddf1bab862e2328f1bd48873",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.0",
|
||||
"symfony\/console": "^6.0",
|
||||
"symfony\/dependency-injection": "^6.0",
|
||||
"symplify\/autowire-array-parameter": "^11.1.7",
|
||||
"symplify\/package-builder": "^11.1.7",
|
||||
"symplify\/smart-file-system": "^11.1.7",
|
||||
"webmozart\/assert": "^1.10"
|
||||
},
|
||||
"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\/symfony-static-dumper": "<11.1.7",
|
||||
"symplify\/vendor-patches": "<11.1.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.23"
|
||||
},
|
||||
"time": "2022-09-01T19:31:05+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "11.2-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202209\\Symplify\\SymplifyKernel\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https:\/\/packagist.org\/downloads\/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"description": "Internal Kernel for Symplify packages",
|
||||
"support": {
|
||||
"source": "https:\/\/github.com\/symplify\/symplify-kernel\/tree\/11.1.7"
|
||||
},
|
||||
"install-path": "..\/symplify\/symplify-kernel"
|
||||
},
|
||||
{
|
||||
"name": "webmozart\/assert",
|
||||
"version": "1.11.0",
|
||||
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
6
vendor/scoper-autoload.php
vendored
6
vendor/scoper-autoload.php
vendored
@ -4,12 +4,6 @@
|
||||
|
||||
$loader = require_once __DIR__.'/autoload.php';
|
||||
|
||||
// Exposed classes. For more information see:
|
||||
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-classes
|
||||
if (!class_exists('Symplify\SmartFileSystem\SmartFileInfo', false) && !interface_exists('Symplify\SmartFileSystem\SmartFileInfo', false) && !trait_exists('Symplify\SmartFileSystem\SmartFileInfo', false)) {
|
||||
spl_autoload_call('RectorPrefix202209\Symplify\SmartFileSystem\SmartFileInfo');
|
||||
}
|
||||
|
||||
// Exposed functions. For more information see:
|
||||
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-functions
|
||||
if (!function_exists('trigger_deprecation')) {
|
||||
|
@ -5,12 +5,12 @@
|
||||
"require": {
|
||||
"php": ">=8.0",
|
||||
"nette\/utils": "^3.2",
|
||||
"symfony\/dependency-injection": "^6.0",
|
||||
"symplify\/package-builder": "^11.1.7"
|
||||
"symfony\/dependency-injection": "^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.23",
|
||||
"symplify\/symplify-kernel": "^11.1.7"
|
||||
"symplify\/package-builder": "^11.2",
|
||||
"symplify\/symplify-kernel": "^11.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -14,7 +14,6 @@ use RectorPrefix202209\Symplify\AutowireArrayParameter\DependencyInjection\Defin
|
||||
use RectorPrefix202209\Symplify\AutowireArrayParameter\DocBlock\ParamTypeDocBlockResolver;
|
||||
use RectorPrefix202209\Symplify\AutowireArrayParameter\Skipper\ParameterSkipper;
|
||||
use RectorPrefix202209\Symplify\AutowireArrayParameter\TypeResolver\ParameterTypeResolver;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\ValueObject\MethodName;
|
||||
/**
|
||||
* @inspiration https://github.com/nette/di/pull/178
|
||||
* @see \Symplify\AutowireArrayParameter\Tests\DependencyInjection\CompilerPass\AutowireArrayParameterCompilerPassTest
|
||||
@ -99,7 +98,7 @@ final class AutowireArrayParameterCompilerPass implements CompilerPassInterface
|
||||
if (!$reflectionClass instanceof ReflectionClass) {
|
||||
return \true;
|
||||
}
|
||||
if (!$reflectionClass->hasMethod(MethodName::CONSTRUCTOR)) {
|
||||
if (!$reflectionClass->hasMethod('__construct')) {
|
||||
return \true;
|
||||
}
|
||||
/** @var ReflectionMethod $constructorReflectionMethod */
|
||||
|
25
vendor/symplify/smart-file-system/LICENSE
vendored
25
vendor/symplify/smart-file-system/LICENSE
vendored
@ -1,25 +0,0 @@
|
||||
The MIT License
|
||||
---------------
|
||||
|
||||
Copyright (c) 2019 Tomas Votruba (https://tomasvotruba.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
52
vendor/symplify/smart-file-system/composer.json
vendored
52
vendor/symplify/smart-file-system/composer.json
vendored
@ -1,52 +0,0 @@
|
||||
{
|
||||
"name": "symplify\/smart-file-system",
|
||||
"description": "Sanitized FileInfo with safe getRealPath() and other handy methods",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=8.0",
|
||||
"nette\/utils": "^3.2",
|
||||
"symfony\/finder": "^6.0",
|
||||
"symfony\/filesystem": "^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"nette\/finder": "^2.5.3",
|
||||
"phpunit\/phpunit": "^9.5.23"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202209\\Symplify\\SmartFileSystem\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202209\\Symplify\\SmartFileSystem\\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\/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\/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\/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"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem\Exception;
|
||||
|
||||
use Exception;
|
||||
final class DirectoryNotFoundException extends Exception
|
||||
{
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem\Exception;
|
||||
|
||||
use Exception;
|
||||
final class FileNotFoundException extends Exception
|
||||
{
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem;
|
||||
|
||||
/**
|
||||
* @see \Symplify\SmartFileSystem\Tests\FileSystemFilter\FileSystemFilterTest
|
||||
*/
|
||||
final class FileSystemFilter
|
||||
{
|
||||
/**
|
||||
* @param string[] $filesAndDirectories
|
||||
* @return string[]
|
||||
*/
|
||||
public function filterDirectories(array $filesAndDirectories) : array
|
||||
{
|
||||
$directories = \array_filter($filesAndDirectories, static function (string $path) : bool {
|
||||
return !\is_file($path);
|
||||
});
|
||||
return \array_values($directories);
|
||||
}
|
||||
/**
|
||||
* @param string[] $filesAndDirectories
|
||||
* @return string[]
|
||||
*/
|
||||
public function filterFiles(array $filesAndDirectories) : array
|
||||
{
|
||||
$files = \array_filter($filesAndDirectories, static function (string $path) : bool {
|
||||
return \is_file($path);
|
||||
});
|
||||
return \array_values($files);
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem;
|
||||
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\Exception\DirectoryNotFoundException;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\Exception\FileNotFoundException;
|
||||
final class FileSystemGuard
|
||||
{
|
||||
public function ensureFileExists(string $file, string $location) : void
|
||||
{
|
||||
if (\file_exists($file)) {
|
||||
return;
|
||||
}
|
||||
throw new FileNotFoundException(\sprintf('File "%s" not found in "%s".', $file, $location));
|
||||
}
|
||||
public function ensureDirectoryExists(string $directory, string $extraMessage) : void
|
||||
{
|
||||
if (\is_dir($directory) && \file_exists($directory)) {
|
||||
return;
|
||||
}
|
||||
$message = \sprintf('Directory "%s" was not found.', $directory);
|
||||
if ($extraMessage !== '') {
|
||||
$message .= ' ' . $extraMessage;
|
||||
}
|
||||
throw new DirectoryNotFoundException($message);
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem\Finder;
|
||||
|
||||
use RectorPrefix202209\Nette\Utils\Finder as NetteFinder;
|
||||
use SplFileInfo;
|
||||
use RectorPrefix202209\Symfony\Component\Finder\Finder as SymfonyFinder;
|
||||
use RectorPrefix202209\Symfony\Component\Finder\SplFileInfo as SymfonySplFileInfo;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
/**
|
||||
* @see \Symplify\SmartFileSystem\Tests\Finder\FinderSanitizer\FinderSanitizerTest
|
||||
*/
|
||||
final class FinderSanitizer
|
||||
{
|
||||
/**
|
||||
* @param NetteFinder|SymfonyFinder|mixed[] $files
|
||||
* @return SmartFileInfo[]
|
||||
*/
|
||||
public function sanitize($files) : array
|
||||
{
|
||||
$smartFileInfos = [];
|
||||
foreach ($files as $file) {
|
||||
$fileInfo = \is_string($file) ? new SplFileInfo($file) : $file;
|
||||
if (!$this->isFileInfoValid($fileInfo)) {
|
||||
continue;
|
||||
}
|
||||
/** @var string $realPath */
|
||||
$realPath = $fileInfo->getRealPath();
|
||||
$smartFileInfos[] = new SmartFileInfo($realPath);
|
||||
}
|
||||
return $smartFileInfos;
|
||||
}
|
||||
private function isFileInfoValid(SplFileInfo $fileInfo) : bool
|
||||
{
|
||||
return (bool) $fileInfo->getRealPath();
|
||||
}
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem\Finder;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\Finder\Finder;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\FileSystemFilter;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\SmartFileSystem\Tests\Finder\SmartFinder\SmartFinderTest
|
||||
*/
|
||||
final class SmartFinder
|
||||
{
|
||||
/**
|
||||
* @var \Symplify\SmartFileSystem\Finder\FinderSanitizer
|
||||
*/
|
||||
private $finderSanitizer;
|
||||
/**
|
||||
* @var \Symplify\SmartFileSystem\FileSystemFilter
|
||||
*/
|
||||
private $fileSystemFilter;
|
||||
public function __construct(FinderSanitizer $finderSanitizer, FileSystemFilter $fileSystemFilter)
|
||||
{
|
||||
$this->finderSanitizer = $finderSanitizer;
|
||||
$this->fileSystemFilter = $fileSystemFilter;
|
||||
}
|
||||
/**
|
||||
* @param string[] $directoriesOrFiles
|
||||
* @return SmartFileInfo[]
|
||||
*/
|
||||
public function findPaths(array $directoriesOrFiles, string $path) : array
|
||||
{
|
||||
$directories = $this->fileSystemFilter->filterDirectories($directoriesOrFiles);
|
||||
$fileInfos = [];
|
||||
if ($directories !== []) {
|
||||
$finder = new Finder();
|
||||
$finder->name('*')->in($directories)->path($path)->files()->sortByName();
|
||||
$fileInfos = $this->finderSanitizer->sanitize($finder);
|
||||
}
|
||||
return $fileInfos;
|
||||
}
|
||||
/**
|
||||
* @param string[] $directoriesOrFiles
|
||||
* @param string[] $excludedDirectories
|
||||
* @return SmartFileInfo[]
|
||||
*/
|
||||
public function find(array $directoriesOrFiles, string $name, array $excludedDirectories = []) : array
|
||||
{
|
||||
$directories = $this->fileSystemFilter->filterDirectories($directoriesOrFiles);
|
||||
$fileInfos = [];
|
||||
if ($directories !== []) {
|
||||
$finder = new Finder();
|
||||
$finder->name($name)->in($directories)->files()->sortByName();
|
||||
if ($excludedDirectories !== []) {
|
||||
$finder->exclude($excludedDirectories);
|
||||
}
|
||||
$fileInfos = $this->finderSanitizer->sanitize($finder);
|
||||
}
|
||||
$files = $this->fileSystemFilter->filterFiles($directoriesOrFiles);
|
||||
foreach ($files as $file) {
|
||||
$fileInfos[] = new SmartFileInfo($file);
|
||||
}
|
||||
return $fileInfos;
|
||||
}
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem\Json;
|
||||
|
||||
use RectorPrefix202209\Nette\Utils\Arrays;
|
||||
use RectorPrefix202209\Nette\Utils\Json;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\FileSystemGuard;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\SmartFileSystem;
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\SmartFileSystem\Tests\Json\JsonFileSystem\JsonFileSystemTest
|
||||
*/
|
||||
final class JsonFileSystem
|
||||
{
|
||||
/**
|
||||
* @var \Symplify\SmartFileSystem\FileSystemGuard
|
||||
*/
|
||||
private $fileSystemGuard;
|
||||
/**
|
||||
* @var \Symplify\SmartFileSystem\SmartFileSystem
|
||||
*/
|
||||
private $smartFileSystem;
|
||||
public function __construct(FileSystemGuard $fileSystemGuard, SmartFileSystem $smartFileSystem)
|
||||
{
|
||||
$this->fileSystemGuard = $fileSystemGuard;
|
||||
$this->smartFileSystem = $smartFileSystem;
|
||||
}
|
||||
/**
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function loadFilePathToJson(string $filePath) : array
|
||||
{
|
||||
$this->fileSystemGuard->ensureFileExists($filePath, __METHOD__);
|
||||
$fileContent = $this->smartFileSystem->readFile($filePath);
|
||||
return Json::decode($fileContent, Json::FORCE_ARRAY);
|
||||
}
|
||||
/**
|
||||
* @param array<string, mixed> $jsonArray
|
||||
*/
|
||||
public function writeJsonToFilePath(array $jsonArray, string $filePath) : void
|
||||
{
|
||||
$jsonContent = Json::encode($jsonArray, Json::PRETTY) . \PHP_EOL;
|
||||
$this->smartFileSystem->dumpFile($filePath, $jsonContent);
|
||||
}
|
||||
/**
|
||||
* @param array<string, mixed> $newJsonArray
|
||||
*/
|
||||
public function mergeArrayToJsonFile(string $filePath, array $newJsonArray) : void
|
||||
{
|
||||
$jsonArray = $this->loadFilePathToJson($filePath);
|
||||
$newComposerJsonArray = Arrays::mergeTree($jsonArray, $newJsonArray);
|
||||
$this->writeJsonToFilePath($newComposerJsonArray, $filePath);
|
||||
}
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem\Normalizer;
|
||||
|
||||
use RectorPrefix202209\Nette\Utils\Strings;
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* Used from
|
||||
* https://github.com/phpstan/phpstan-src/blob/02425e61aa48f0668b4efb3e73d52ad544048f65/src/File/FileHelper.php#L40,
|
||||
* with custom modifications
|
||||
*
|
||||
* @see \Symplify\SmartFileSystem\Tests\Normalizer\PathNormalizerTest
|
||||
*/
|
||||
final class PathNormalizer
|
||||
{
|
||||
/**
|
||||
* @see https://regex101.com/r/d4F5Fm/1
|
||||
* @var string
|
||||
*/
|
||||
private const SCHEME_PATH_REGEX = '#^([a-z]+)\\:\\/\\/(.+)#';
|
||||
/**
|
||||
* @see https://regex101.com/r/no28vw/1
|
||||
* @var string
|
||||
*/
|
||||
private const TWO_AND_MORE_SLASHES_REGEX = '#/{2,}#';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private const SCHEME_UNDEFINED = 'undefined';
|
||||
public function normalizePath(string $originalPath) : string
|
||||
{
|
||||
$directorySeparator = \DIRECTORY_SEPARATOR;
|
||||
$matches = Strings::match($originalPath, self::SCHEME_PATH_REGEX);
|
||||
if ($matches !== null) {
|
||||
[, $scheme, $path] = $matches;
|
||||
} else {
|
||||
$scheme = self::SCHEME_UNDEFINED;
|
||||
$path = $originalPath;
|
||||
}
|
||||
$normalizedPath = \str_replace('\\', '/', $path);
|
||||
$path = Strings::replace($normalizedPath, self::TWO_AND_MORE_SLASHES_REGEX, '/');
|
||||
$pathRoot = \strncmp($path, '/', \strlen('/')) === 0 ? $directorySeparator : '';
|
||||
$pathParts = \explode('/', \trim($path, '/'));
|
||||
$normalizedPathParts = $this->normalizePathParts($pathParts, $scheme);
|
||||
$pathStart = $scheme !== self::SCHEME_UNDEFINED ? $scheme . '://' : '';
|
||||
return $pathStart . $pathRoot . \implode($directorySeparator, $normalizedPathParts);
|
||||
}
|
||||
/**
|
||||
* @param string[] $pathParts
|
||||
* @return string[]
|
||||
*/
|
||||
private function normalizePathParts(array $pathParts, string $scheme) : array
|
||||
{
|
||||
$normalizedPathParts = [];
|
||||
foreach ($pathParts as $pathPart) {
|
||||
if ($pathPart === '.') {
|
||||
continue;
|
||||
}
|
||||
if ($pathPart !== '..') {
|
||||
$normalizedPathParts[] = $pathPart;
|
||||
continue;
|
||||
}
|
||||
/** @var string $removedPart */
|
||||
$removedPart = \array_pop($normalizedPathParts);
|
||||
if ($scheme !== 'phar') {
|
||||
continue;
|
||||
}
|
||||
if (\substr_compare($removedPart, '.phar', -\strlen('.phar')) !== 0) {
|
||||
continue;
|
||||
}
|
||||
$scheme = self::SCHEME_UNDEFINED;
|
||||
}
|
||||
return $normalizedPathParts;
|
||||
}
|
||||
}
|
@ -1,131 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem;
|
||||
|
||||
use RectorPrefix202209\Nette\Utils\Strings;
|
||||
use RectorPrefix202209\Symfony\Component\Finder\SplFileInfo;
|
||||
use RectorPrefix202209\Symplify\EasyTesting\PHPUnit\StaticPHPUnitEnvironment;
|
||||
use RectorPrefix202209\Symplify\EasyTesting\StaticFixtureSplitter;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\Exception\DirectoryNotFoundException;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\Exception\FileNotFoundException;
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\SmartFileSystem\Tests\SmartFileInfo\SmartFileInfoTest
|
||||
*/
|
||||
final class SmartFileInfo extends SplFileInfo
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
* @see https://regex101.com/r/SYP00O/1
|
||||
*/
|
||||
private const LAST_SUFFIX_REGEX = '#\\.[^.]+$#';
|
||||
/**
|
||||
* @var \Symplify\SmartFileSystem\SmartFileSystem
|
||||
*/
|
||||
private $smartFileSystem;
|
||||
public function __construct(string $filePath)
|
||||
{
|
||||
$this->smartFileSystem = new SmartFileSystem();
|
||||
// accepts also dirs
|
||||
if (!\file_exists($filePath)) {
|
||||
throw new FileNotFoundException(\sprintf('File path "%s" was not found while creating "%s" object.', $filePath, self::class));
|
||||
}
|
||||
// real path doesn't work in PHAR: https://www.php.net/manual/en/function.realpath.php
|
||||
if (\strncmp($filePath, 'phar://', \strlen('phar://')) === 0) {
|
||||
$relativeFilePath = $filePath;
|
||||
$relativeDirectoryPath = \dirname($filePath);
|
||||
} else {
|
||||
$realPath = \realpath($filePath);
|
||||
$relativeFilePath = \rtrim($this->smartFileSystem->makePathRelative($realPath, \getcwd()), '/');
|
||||
$relativeDirectoryPath = \dirname($relativeFilePath);
|
||||
}
|
||||
parent::__construct($filePath, $relativeDirectoryPath, $relativeFilePath);
|
||||
}
|
||||
public function getBasenameWithoutSuffix() : string
|
||||
{
|
||||
return \pathinfo($this->getFilename())['filename'];
|
||||
}
|
||||
public function getSuffix() : string
|
||||
{
|
||||
return \pathinfo($this->getFilename(), \PATHINFO_EXTENSION);
|
||||
}
|
||||
/**
|
||||
* @param string[] $suffixes
|
||||
*/
|
||||
public function hasSuffixes(array $suffixes) : bool
|
||||
{
|
||||
return \in_array($this->getSuffix(), $suffixes, \true);
|
||||
}
|
||||
public function getRealPathWithoutSuffix() : string
|
||||
{
|
||||
return Strings::replace($this->getRealPath(), self::LAST_SUFFIX_REGEX, '');
|
||||
}
|
||||
public function getRelativeFilePath() : string
|
||||
{
|
||||
return $this->getRelativePathname();
|
||||
}
|
||||
public function getRelativeDirectoryPath() : string
|
||||
{
|
||||
return $this->getRelativePath();
|
||||
}
|
||||
public function getRelativeFilePathFromDirectory(string $directory) : string
|
||||
{
|
||||
if (!\file_exists($directory)) {
|
||||
throw new DirectoryNotFoundException(\sprintf('Directory "%s" was not found in %s.', $directory, self::class));
|
||||
}
|
||||
$relativeFilePath = $this->smartFileSystem->makePathRelative($this->getNormalizedRealPath(), (string) \realpath($directory));
|
||||
return \rtrim($relativeFilePath, '/');
|
||||
}
|
||||
public function getRelativeFilePathFromCwdInTests() : string
|
||||
{
|
||||
// special case for tests
|
||||
if (StaticPHPUnitEnvironment::isPHPUnitRun()) {
|
||||
return $this->getRelativeFilePathFromDirectory(StaticFixtureSplitter::getTemporaryPath());
|
||||
}
|
||||
return $this->getRelativeFilePathFromDirectory(\getcwd());
|
||||
}
|
||||
public function getRelativeFilePathFromCwd() : string
|
||||
{
|
||||
return $this->getRelativeFilePathFromDirectory(\getcwd());
|
||||
}
|
||||
public function endsWith(string $string) : bool
|
||||
{
|
||||
return \substr_compare($this->getNormalizedRealPath(), $string, -\strlen($string)) === 0;
|
||||
}
|
||||
public function doesFnmatch(string $string) : bool
|
||||
{
|
||||
$normalizedPath = $this->normalizePath($string);
|
||||
if (\fnmatch($normalizedPath, $this->getNormalizedRealPath())) {
|
||||
return \true;
|
||||
}
|
||||
// in case of relative compare
|
||||
return \fnmatch('*/' . $normalizedPath, $this->getNormalizedRealPath());
|
||||
}
|
||||
public function getRealPath() : string
|
||||
{
|
||||
// for phar compatibility @see https://github.com/rectorphp/rector/commit/e5d7cee69558f7e6b35d995a5ca03fa481b0407c
|
||||
return parent::getRealPath() ?: $this->getPathname();
|
||||
}
|
||||
public function getRealPathDirectory() : string
|
||||
{
|
||||
return \dirname($this->getRealPath());
|
||||
}
|
||||
public function startsWith(string $partialPath) : bool
|
||||
{
|
||||
return \strncmp($this->getNormalizedRealPath(), $partialPath, \strlen($partialPath)) === 0;
|
||||
}
|
||||
private function getNormalizedRealPath() : string
|
||||
{
|
||||
return $this->normalizePath($this->getRealPath());
|
||||
}
|
||||
private function normalizePath(string $path) : string
|
||||
{
|
||||
return \str_replace('\\', '/', $path);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\SmartFileSystem\Tests\SmartFileInfo\SmartFileInfoTest
|
||||
*/
|
||||
\class_alias('RectorPrefix202209\\Symplify\\SmartFileSystem\\SmartFileInfo', 'Symplify\\SmartFileSystem\\SmartFileInfo', \false);
|
@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SmartFileSystem;
|
||||
|
||||
use RectorPrefix202209\Nette\Utils\Strings;
|
||||
use RectorPrefix202209\Symfony\Component\Filesystem\Exception\IOException;
|
||||
use RectorPrefix202209\Symfony\Component\Filesystem\Filesystem;
|
||||
/**
|
||||
* @see \Symplify\SmartFileSystem\Tests\SmartFileSystem\SmartFileSystemTest
|
||||
*/
|
||||
final class SmartFileSystem extends Filesystem
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
* @see https://regex101.com/r/tx6eyw/1
|
||||
*/
|
||||
private const BEFORE_COLLON_REGEX = '#^\\w+\\(.*?\\): #';
|
||||
/**
|
||||
* @see https://github.com/symfony/filesystem/pull/4/files
|
||||
*/
|
||||
public function readFile(string $fileName) : string
|
||||
{
|
||||
$source = @\file_get_contents($fileName);
|
||||
if (!$source) {
|
||||
$message = \sprintf('Failed to read "%s" file: "%s"', $fileName, $this->getLastError());
|
||||
throw new IOException($message, 0, null, $fileName);
|
||||
}
|
||||
return $source;
|
||||
}
|
||||
public function readFileToSmartFileInfo(string $fileName) : SmartFileInfo
|
||||
{
|
||||
return new SmartFileInfo($fileName);
|
||||
}
|
||||
/**
|
||||
* Converts given HTML code to plain text
|
||||
*
|
||||
* @source https://github.com/nette/utils/blob/e7bd59f1dd860d25dbbb1ac720dddd0fa1388f4c/src/Utils/Html.php#L325-L331
|
||||
*/
|
||||
private function htmlToText(string $html) : string
|
||||
{
|
||||
$content = \strip_tags($html);
|
||||
return \html_entity_decode($content, \ENT_QUOTES | \ENT_HTML5, 'UTF-8');
|
||||
}
|
||||
/**
|
||||
* Returns the last PHP error as plain string.
|
||||
*
|
||||
* @source https://github.com/nette/utils/blob/ab8eea12b8aacc7ea5bdafa49b711c2988447994/src/Utils/Helpers.php#L31-L40
|
||||
*/
|
||||
private function getLastError() : string
|
||||
{
|
||||
$message = \error_get_last()['message'] ?? '';
|
||||
$htmlMessage = \ini_get('html_errors') ? $this->htmlToText($message) : $message;
|
||||
return Strings::replace($htmlMessage, self::BEFORE_COLLON_REGEX, '');
|
||||
}
|
||||
}
|
71
vendor/symplify/symplify-kernel/README.md
vendored
71
vendor/symplify/symplify-kernel/README.md
vendored
@ -1,71 +0,0 @@
|
||||
# Symplify Kernel
|
||||
|
||||
[![Downloads total](https://img.shields.io/packagist/dt/symplify/symplify-kernel.svg?style=flat-square)](https://packagist.org/packages/symplify/symplify-kernel/stats)
|
||||
|
||||
Do you use Symfony Kernel, but not for PHP projects?
|
||||
|
||||
Use Symfony Kernel for:
|
||||
|
||||
* light [Symfony Console Apps](https://tomasvotruba.com/blog/introducing-light-kernel-for-symfony-console-apps/) without Http
|
||||
* faster and easy-to-setup tests
|
||||
* merging of array parameters in 2 configs
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
composer require symplify/symplify-kernel --dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### 1. Light Kernel for Symfony CLI Apps
|
||||
|
||||
```php
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Symplify\SymplifyKernel\ContainerBuilderFactory;
|
||||
|
||||
final class MonorepoBuilderKernel
|
||||
{
|
||||
/**
|
||||
* @param string[] $configFiles
|
||||
*/
|
||||
public function createFromConfigs(array $configFiles): ContainerInterface
|
||||
{
|
||||
// local config here
|
||||
$configFiles[] = __DIR__ . '/../../config/config.php';
|
||||
|
||||
$containerBuilderFactory = new ContainerBuilderFactory();
|
||||
$containerBuilder = $containerBuilderFactory->create($configFiles, [], []);
|
||||
|
||||
// build the container
|
||||
$containerBuilder->compile();
|
||||
|
||||
return $containerBuilder;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then use in your `bin/app.php` file:
|
||||
|
||||
```php
|
||||
$easyCIKernel = new MonorepoBuilderKernel();
|
||||
$easyCIKernel->createFromConfigs([__DIR__ . '/config/config.php']);
|
||||
|
||||
$container = $easyCIKernel->getContainer();
|
||||
|
||||
/** @var Application $application */
|
||||
$application = $container->get(Application::class);
|
||||
exit($application->run());
|
||||
```
|
||||
|
||||
That's it!
|
||||
|
||||
<br>
|
||||
|
||||
## Report Issues
|
||||
|
||||
In case you are experiencing a bug or want to request a new feature head over to the [Symplify monorepo issue tracker](https://github.com/symplify/symplify/issues)
|
||||
|
||||
## Contribute
|
||||
|
||||
The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on [symplify/symplify](https://github.com/symplify/symplify).
|
51
vendor/symplify/symplify-kernel/composer.json
vendored
51
vendor/symplify/symplify-kernel/composer.json
vendored
@ -1,51 +0,0 @@
|
||||
{
|
||||
"name": "symplify\/symplify-kernel",
|
||||
"description": "Internal Kernel for Symplify packages",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=8.0",
|
||||
"symfony\/console": "^6.0",
|
||||
"symfony\/dependency-injection": "^6.0",
|
||||
"symplify\/smart-file-system": "^11.1.7",
|
||||
"symplify\/autowire-array-parameter": "^11.1.7",
|
||||
"symplify\/package-builder": "^11.1.7",
|
||||
"webmozart\/assert": "^1.10"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit\/phpunit": "^9.5.23"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202209\\Symplify\\SymplifyKernel\\": "src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"RectorPrefix202209\\Symplify\\SymplifyKernel\\Tests\\": "tests"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "11.2-dev"
|
||||
}
|
||||
},
|
||||
"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\/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\/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.7"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Console\Style\SymfonyStyleFactory;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Parameter\ParameterProvider;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\FileSystemFilter;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\FileSystemGuard;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\Finder\FinderSanitizer;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\Finder\SmartFinder;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\SmartFileSystem;
|
||||
use function RectorPrefix202209\Symfony\Component\DependencyInjection\Loader\Configurator\service;
|
||||
return static function (ContainerConfigurator $containerConfigurator) : void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->defaults()->public()->autowire();
|
||||
// symfony style
|
||||
$services->set(SymfonyStyleFactory::class);
|
||||
$services->set(SymfonyStyle::class)->factory([service(SymfonyStyleFactory::class), 'create']);
|
||||
// filesystem
|
||||
$services->set(FinderSanitizer::class);
|
||||
$services->set(SmartFileSystem::class);
|
||||
$services->set(SmartFinder::class);
|
||||
$services->set(FileSystemGuard::class);
|
||||
$services->set(FileSystemFilter::class);
|
||||
$services->set(ParameterProvider::class)->args([service('service_container')]);
|
||||
$services->set(PrivatesAccessor::class);
|
||||
};
|
9
vendor/symplify/symplify-kernel/phpunit.xml
vendored
9
vendor/symplify/symplify-kernel/phpunit.xml
vendored
@ -1,9 +0,0 @@
|
||||
<phpunit
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
verbose="true"
|
||||
>
|
||||
<testsuite name="all">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</phpunit>
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\Config\Loader;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\Config\FileLocator;
|
||||
use RectorPrefix202209\Symfony\Component\Config\Loader\DelegatingLoader;
|
||||
use RectorPrefix202209\Symfony\Component\Config\Loader\GlobFileLoader;
|
||||
use RectorPrefix202209\Symfony\Component\Config\Loader\LoaderResolver;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\DependencyInjection\FileLoader\ParameterMergingPhpFileLoader;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\Contract\Config\LoaderFactoryInterface;
|
||||
final class ParameterMergingLoaderFactory implements LoaderFactoryInterface
|
||||
{
|
||||
public function create(ContainerBuilder $containerBuilder, string $currentWorkingDirectory) : \RectorPrefix202209\Symfony\Component\Config\Loader\LoaderInterface
|
||||
{
|
||||
$fileLocator = new FileLocator([$currentWorkingDirectory]);
|
||||
$loaders = [new GlobFileLoader($fileLocator), new ParameterMergingPhpFileLoader($containerBuilder, $fileLocator)];
|
||||
$loaderResolver = new LoaderResolver($loaders);
|
||||
return new DelegatingLoader($loaderResolver);
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\Contract\Config\LoaderFactoryInterface;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\DependencyInjection\LoadExtensionConfigsCompilerPass;
|
||||
use RectorPrefix202209\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Symplify\SymplifyKernel\Tests\ContainerBuilderFactory\ContainerBuilderFactoryTest
|
||||
*/
|
||||
final class ContainerBuilderFactory
|
||||
{
|
||||
/**
|
||||
* @var \Symplify\SymplifyKernel\Contract\Config\LoaderFactoryInterface
|
||||
*/
|
||||
private $loaderFactory;
|
||||
public function __construct(LoaderFactoryInterface $loaderFactory)
|
||||
{
|
||||
$this->loaderFactory = $loaderFactory;
|
||||
}
|
||||
/**
|
||||
* @param string[] $configFiles
|
||||
* @param CompilerPassInterface[] $compilerPasses
|
||||
* @param ExtensionInterface[] $extensions
|
||||
*/
|
||||
public function create(array $configFiles, array $compilerPasses, array $extensions) : ContainerBuilder
|
||||
{
|
||||
Assert::allIsAOf($extensions, ExtensionInterface::class);
|
||||
Assert::allIsAOf($compilerPasses, CompilerPassInterface::class);
|
||||
Assert::allString($configFiles);
|
||||
Assert::allFile($configFiles);
|
||||
$containerBuilder = new ContainerBuilder();
|
||||
$this->registerExtensions($containerBuilder, $extensions);
|
||||
$this->registerConfigFiles($containerBuilder, $configFiles);
|
||||
$this->registerCompilerPasses($containerBuilder, $compilerPasses);
|
||||
// this calls load() method in every extensions
|
||||
// ensure these extensions are implicitly loaded
|
||||
$compilerPassConfig = $containerBuilder->getCompilerPassConfig();
|
||||
$compilerPassConfig->setMergePass(new LoadExtensionConfigsCompilerPass());
|
||||
return $containerBuilder;
|
||||
}
|
||||
/**
|
||||
* @param ExtensionInterface[] $extensions
|
||||
*/
|
||||
private function registerExtensions(ContainerBuilder $containerBuilder, array $extensions) : void
|
||||
{
|
||||
foreach ($extensions as $extension) {
|
||||
$containerBuilder->registerExtension($extension);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param CompilerPassInterface[] $compilerPasses
|
||||
*/
|
||||
private function registerCompilerPasses(ContainerBuilder $containerBuilder, array $compilerPasses) : void
|
||||
{
|
||||
foreach ($compilerPasses as $compilerPass) {
|
||||
$containerBuilder->addCompilerPass($compilerPass);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param string[] $configFiles
|
||||
*/
|
||||
private function registerConfigFiles(ContainerBuilder $containerBuilder, array $configFiles) : void
|
||||
{
|
||||
$delegatingLoader = $this->loaderFactory->create($containerBuilder, \getcwd());
|
||||
foreach ($configFiles as $configFile) {
|
||||
$delegatingLoader->load($configFile);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\Contract\Config;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
interface LoaderFactoryInterface
|
||||
{
|
||||
public function create(ContainerBuilder $containerBuilder, string $currentWorkingDirectory) : LoaderInterface;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\Contract;
|
||||
|
||||
use RectorPrefix202209\Psr\Container\ContainerInterface;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
interface LightKernelInterface
|
||||
{
|
||||
/**
|
||||
* @param string[] $configFiles
|
||||
*/
|
||||
public function createFromConfigs(array $configFiles) : ContainerInterface;
|
||||
public function getContainer() : ContainerInterface;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\DependencyInjection;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
/**
|
||||
* Mimics @see \Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass without dependency on
|
||||
* symfony/http-kernel
|
||||
*/
|
||||
final class LoadExtensionConfigsCompilerPass extends MergeExtensionConfigurationPass
|
||||
{
|
||||
public function process(ContainerBuilder $containerBuilder) : void
|
||||
{
|
||||
$extensionNames = \array_keys($containerBuilder->getExtensions());
|
||||
foreach ($extensionNames as $extensionName) {
|
||||
$containerBuilder->loadFromExtension($extensionName, []);
|
||||
}
|
||||
parent::process($containerBuilder);
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\Exception;
|
||||
|
||||
use Exception;
|
||||
final class BootException extends Exception
|
||||
{
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\Exception;
|
||||
|
||||
use Exception;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class ShouldNotHappenException extends Exception
|
||||
{
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\HttpKernel;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Container;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
|
||||
use RectorPrefix202209\Symplify\AutowireArrayParameter\DependencyInjection\CompilerPass\AutowireArrayParameterCompilerPass;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\Config\Loader\ParameterMergingLoaderFactory;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\ContainerBuilderFactory;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\Contract\LightKernelInterface;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\Exception\ShouldNotHappenException;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\ValueObject\SymplifyKernelConfig;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
abstract class AbstractSymplifyKernel implements LightKernelInterface
|
||||
{
|
||||
/**
|
||||
* @var \Symfony\Component\DependencyInjection\Container|null
|
||||
*/
|
||||
private $container = null;
|
||||
/**
|
||||
* @param string[] $configFiles
|
||||
* @param CompilerPassInterface[] $compilerPasses
|
||||
* @param ExtensionInterface[] $extensions
|
||||
*/
|
||||
public function create(array $configFiles, array $compilerPasses = [], array $extensions = []) : ContainerInterface
|
||||
{
|
||||
$containerBuilderFactory = new ContainerBuilderFactory(new ParameterMergingLoaderFactory());
|
||||
$compilerPasses[] = new AutowireArrayParameterCompilerPass();
|
||||
$configFiles[] = SymplifyKernelConfig::FILE_PATH;
|
||||
$containerBuilder = $containerBuilderFactory->create($configFiles, $compilerPasses, $extensions);
|
||||
$containerBuilder->compile();
|
||||
$this->container = $containerBuilder;
|
||||
return $containerBuilder;
|
||||
}
|
||||
public function getContainer() : \RectorPrefix202209\Psr\Container\ContainerInterface
|
||||
{
|
||||
if (!$this->container instanceof Container) {
|
||||
throw new ShouldNotHappenException();
|
||||
}
|
||||
return $this->container;
|
||||
}
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\ValueObject;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\Console\Application;
|
||||
use RectorPrefix202209\Symfony\Component\Console\Command\Command;
|
||||
use RectorPrefix202209\Symfony\Component\HttpKernel\KernelInterface;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Console\Input\StaticInputDetector;
|
||||
use RectorPrefix202209\Symplify\PackageBuilder\Console\Style\SymfonyStyleFactory;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\Contract\LightKernelInterface;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\Exception\BootException;
|
||||
use Throwable;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class KernelBootAndApplicationRun
|
||||
{
|
||||
/**
|
||||
* @var class-string<(KernelInterface | LightKernelInterface)>
|
||||
*/
|
||||
private $kernelClass;
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $extraConfigs = [];
|
||||
/**
|
||||
* @param class-string<KernelInterface|LightKernelInterface> $kernelClass
|
||||
* @param string[] $extraConfigs
|
||||
*/
|
||||
public function __construct(string $kernelClass, array $extraConfigs = [])
|
||||
{
|
||||
$this->kernelClass = $kernelClass;
|
||||
$this->extraConfigs = $extraConfigs;
|
||||
$this->validateKernelClass($this->kernelClass);
|
||||
}
|
||||
public function run() : void
|
||||
{
|
||||
try {
|
||||
$this->booKernelAndRunApplication();
|
||||
} catch (Throwable $throwable) {
|
||||
$symfonyStyleFactory = new SymfonyStyleFactory();
|
||||
$symfonyStyle = $symfonyStyleFactory->create();
|
||||
$symfonyStyle->error($throwable->getMessage());
|
||||
exit(Command::FAILURE);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @return \Symfony\Component\HttpKernel\KernelInterface|\Symplify\SymplifyKernel\Contract\LightKernelInterface
|
||||
*/
|
||||
private function createKernel()
|
||||
{
|
||||
// random has is needed, so cache is invalidated and changes from config are loaded
|
||||
$kernelClass = $this->kernelClass;
|
||||
if (\is_a($kernelClass, LightKernelInterface::class, \true)) {
|
||||
return new $kernelClass();
|
||||
}
|
||||
$environment = 'prod' . \random_int(1, 100000);
|
||||
return new $kernelClass($environment, StaticInputDetector::isDebug());
|
||||
}
|
||||
private function booKernelAndRunApplication() : void
|
||||
{
|
||||
$kernel = $this->createKernel();
|
||||
if ($kernel instanceof LightKernelInterface) {
|
||||
$container = $kernel->createFromConfigs($this->extraConfigs);
|
||||
} else {
|
||||
$kernel->boot();
|
||||
$container = $kernel->getContainer();
|
||||
}
|
||||
/** @var Application $application */
|
||||
$application = $container->get(Application::class);
|
||||
// remove --no-interaction (with -n shortcut) option from Application
|
||||
// because we need to create option with -n shortcuts too
|
||||
// for example: --dry-run with shortcut -n
|
||||
$inputDefinition = $application->getDefinition();
|
||||
$options = $inputDefinition->getOptions();
|
||||
$options = \array_filter($options, static function ($option) {
|
||||
return $option->getName() !== 'no-interaction';
|
||||
});
|
||||
$inputDefinition->setOptions($options);
|
||||
exit($application->run());
|
||||
}
|
||||
/**
|
||||
* @param class-string $kernelClass
|
||||
*/
|
||||
private function validateKernelClass(string $kernelClass) : void
|
||||
{
|
||||
if (\is_a($kernelClass, KernelInterface::class, \true)) {
|
||||
return;
|
||||
}
|
||||
if (\is_a($kernelClass, LightKernelInterface::class, \true)) {
|
||||
return;
|
||||
}
|
||||
$currentValueType = \get_debug_type($kernelClass);
|
||||
$errorMessage = \sprintf('Class "%s" must by type of "%s" or "%s". "%s" given', $kernelClass, KernelInterface::class, LightKernelInterface::class, $currentValueType);
|
||||
throw new BootException($errorMessage);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\ValueObject;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class SymplifyKernelConfig
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const FILE_PATH = __DIR__ . '/../../config/common-config.php';
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209\Symplify\SymplifyKernel\Tests\ContainerBuilderFactory;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\SmartFileSystem;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\Config\Loader\ParameterMergingLoaderFactory;
|
||||
use RectorPrefix202209\Symplify\SymplifyKernel\ContainerBuilderFactory;
|
||||
final class ContainerBuilderFactoryTest extends TestCase
|
||||
{
|
||||
public function test() : void
|
||||
{
|
||||
$containerBuilderFactory = new ContainerBuilderFactory(new ParameterMergingLoaderFactory());
|
||||
$containerBuilder = $containerBuilderFactory->create([__DIR__ . '/config/some_services.php'], [], []);
|
||||
$hasSmartFileSystemService = $containerBuilder->has(SmartFileSystem::class);
|
||||
$this->assertTrue($hasSmartFileSystemService);
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202209;
|
||||
|
||||
use RectorPrefix202209\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
use RectorPrefix202209\Symplify\SmartFileSystem\SmartFileSystem;
|
||||
return static function (ContainerConfigurator $containerConfigurator) : void {
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(SmartFileSystem::class);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user