diff --git a/scoper.php b/scoper.php index 4a7a2fada2e..8152a1826b0 100644 --- a/scoper.php +++ b/scoper.php @@ -40,7 +40,6 @@ // excluded 'exclude-namespaces' => [ - '#^Symfony\\\\Component\\\\Config#', '#^Symplify\\\\ConfigTransformer#', '#^Symplify\\\\PhpConfigPrinter#', '#^Symfony\\\\Polyfill#', @@ -66,17 +65,6 @@ function (string $filePath, string $prefix, string $content): string { return Strings::replace($content, $pattern, 'public const $1 = \''); }, - function (string $filePath, string $prefix, string $content): string { - /** @see \Symplify\ConfigTransformer\Enum\SymfonyClass */ - if (! str_ends_with($filePath, 'src/Enum/SymfonyClass.php')) { - return $content; - } - - $pattern = sprintf('#public const (.*?) = \'%s\\\\\\\\#', $prefix); - - return Strings::replace($content, $pattern, 'public const $1 = \''); - }, - // unprefix strings class, used for node factory // fixes https://github.com/symplify/symplify/issues/3976 function (string $filePath, string $prefix, string $content): string { diff --git a/src/Console/Command/GenerateConfigClassesCommand.php b/src/Console/Command/GenerateConfigClassesCommand.php deleted file mode 100644 index e4f04ee3aa9..00000000000 --- a/src/Console/Command/GenerateConfigClassesCommand.php +++ /dev/null @@ -1,76 +0,0 @@ -setName('generate-config-classes'); - $this->setDescription('Generate Symfony config classes to /var/cache/Symfony directory, see https://symfony.com/blog/new-in-symfony-5-3-config-builder-classes'); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $this->symfonyStyle = new SymfonyStyle($input, $output); - - $configBuilderGenerator = new ConfigBuilderGenerator(getcwd() . '/var/cache'); - $this->symfonyStyle->newLine(); - - foreach (self::EXTENSION_CLASSES as $extensionClass) { - // skip for non-existing classes - if (! class_exists($extensionClass)) { - continue; - } - - $configuration = $this->createExtensionConfiguration($extensionClass); - if (! $configuration instanceof ConfigurationInterface) { - continue; - } - - $configBuilderGenerator->build($configuration); - } - - return self::SUCCESS; - } - - /** - * @param class-string $extensionClass - */ - private function createExtensionConfiguration(string $extensionClass): ?ConfigurationInterface - { - $containerBuilderClass = SymfonyClass::CONTAINER_BUILDER; - - $containerBuilder = new $containerBuilderClass(); - $containerBuilder->setParameter('kernel.debug', false); - - /** @var Extension $extension */ - $extension = new $extensionClass(); - - return $extension->getConfiguration([], $containerBuilder); - } -} diff --git a/src/Console/ConfigTransformerApplication.php b/src/Console/ConfigTransformerApplication.php index 3729d8c7b1f..8f1a6f5e1c4 100644 --- a/src/Console/ConfigTransformerApplication.php +++ b/src/Console/ConfigTransformerApplication.php @@ -5,21 +5,18 @@ namespace Symplify\ConfigTransformer\Console; use Symfony\Component\Console\Application; -use Symplify\ConfigTransformer\Console\Command\GenerateConfigClassesCommand; use Symplify\ConfigTransformer\Console\Command\SwitchFormatCommand; final class ConfigTransformerApplication extends Application { public function __construct( SwitchFormatCommand $switchFormatCommand, - GenerateConfigClassesCommand $generateConfigClassesCommand ) { // must be run before adding commands // otherwise the default command will be overridden to a "list" command parent::__construct(); $this->add($switchFormatCommand); - $this->add($generateConfigClassesCommand); // hide unnecesary command $this->get('help')->setHidden(); diff --git a/src/Enum/SymfonyClass.php b/src/Enum/SymfonyClass.php deleted file mode 100644 index 1f52d68f3e1..00000000000 --- a/src/Enum/SymfonyClass.php +++ /dev/null @@ -1,38 +0,0 @@ -