From 140f401a4e90288656548e5a70f4fc949f54f8a4 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Tue, 23 Jan 2024 16:22:17 -0500 Subject: [PATCH] [make:*] drop Symfony 6.3 support --- .github/workflows/ci.yaml | 5 ++--- composer.json | 24 ++++++++++++------------ src/Test/MakerTestEnvironment.php | 30 ++++-------------------------- 3 files changed, 18 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec1ea0730..5324b5427 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -92,7 +92,6 @@ jobs: php-version: - '8.2' symfony-version: - - '6.3.x-dev' - '6.4.x-dev' - '7.0.x-dev' dependency-versions: ['highest'] @@ -100,11 +99,11 @@ jobs: include: # testing lowest PHP+dependencies with lowest Symfony - php-version: '8.1' - symfony-version: '6.3.*' + symfony-version: '6.4.*' dependency-versions: 'lowest' # testing lowest PHP+dependencies with highest Symfony - php-version: '8.1' - symfony-version: '6.3.*' + symfony-version: '6.4.*' dependency-versions: 'highest' steps: diff --git a/composer.json b/composer.json index 6798c08fb..2c7db2232 100644 --- a/composer.json +++ b/composer.json @@ -16,24 +16,24 @@ "php": ">=8.1", "doctrine/inflector": "^2.0", "nikic/php-parser": "^4.18|^5.0", - "symfony/config": "^6.3|^7.0", - "symfony/console": "^6.3|^7.0", - "symfony/dependency-injection": "^6.3|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", "symfony/deprecation-contracts": "^2.2|^3", - "symfony/filesystem": "^6.3|^7.0", - "symfony/finder": "^6.3|^7.0", - "symfony/framework-bundle": "^6.3|^7.0", - "symfony/http-kernel": "^6.3|^7.0", - "symfony/process": "^6.3|^7.0" + "symfony/filesystem": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/framework-bundle": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0" }, "require-dev": { "composer/semver": "^3.0", "doctrine/doctrine-bundle": "^2.5.0", "doctrine/orm": "^2.10.0", - "symfony/http-client": "^6.3|^7.0", - "symfony/phpunit-bridge": "^6.3|^7.0", - "symfony/security-core": "^6.3|^7.0", - "symfony/yaml": "^6.3|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/phpunit-bridge": "^6.4.1|^7.0", + "symfony/security-core": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0", "twig/twig": "^3.0|^4.x-dev" }, "config": { diff --git a/src/Test/MakerTestEnvironment.php b/src/Test/MakerTestEnvironment.php index 7970a19e7..29187b94d 100644 --- a/src/Test/MakerTestEnvironment.php +++ b/src/Test/MakerTestEnvironment.php @@ -158,16 +158,12 @@ public function prepareDirectory(): void $dependencies = $this->determineMissingDependencies(); if ($dependencies) { // -v actually silences the "very" verbose output in case of an error - $composerProcess = MakerTestProcess::create(sprintf('composer require %s -v', implode(' ', $dependencies)), $this->path); + $composerProcess = MakerTestProcess::create(sprintf('composer require %s -v', implode(' ', $dependencies)), $this->path) + ->run(true) + ; - // @legacy Temporary code until doctrine/dbal 3.7 is out (which supports symfony/console 7.0 - $composerProcess->run(true); if (!$composerProcess->isSuccessful()) { - if (str_contains($composerProcess->getErrorOutput(), 'Declaration of Doctrine\DBAL\Tools\Console\Command\RunSqlCommand::execute')) { - $this->patchDoctrineDbalForSymfony7(); - } else { - throw new \Exception(sprintf('Error running command: composer require %s -v. Output: "%s". Error: "%s"', implode(' ', $dependencies), $composerProcess->getOutput(), $composerProcess->getErrorOutput())); - } + throw new \Exception(sprintf('Error running command: composer require %s -v. Output: "%s". Error: "%s"', implode(' ', $dependencies), $composerProcess->getOutput(), $composerProcess->getErrorOutput())); } } @@ -449,22 +445,4 @@ private function addMakerBundleRepoToComposer(string $composerJsonPath): void file_put_contents($composerJsonPath, json_encode($composerJson, \JSON_THROW_ON_ERROR | \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)); } - - private function patchDoctrineDbalForSymfony7(): void - { - $commandPath = $this->path.'/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php'; - $contents = file_get_contents($commandPath); - - $needle = 'protected function execute(InputInterface $input, OutputInterface $output)'; - if (str_contains($contents, $needle.': int')) { - return; - } - - $contents = str_replace( - $needle, - $needle.': int', - $contents - ); - file_put_contents($commandPath, $contents); - } }