From 1a8f8ef3c28308bc572f096aa5bf9806afe2ec4d Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Mon, 22 Apr 2024 16:20:44 +0200 Subject: [PATCH 1/3] feat: support symfony 7 --- composer.json | 14 +++++++------- src/Command/AbstractCommand.php | 4 +++- src/Console/Application.php | 2 +- .../ContainerAwareInterface.php | 11 +++++++++++ tests/Console/DummyCommand.php | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 src/DependencyInjection/ContainerAwareInterface.php diff --git a/composer.json b/composer.json index 01cb54e..d0061a6 100644 --- a/composer.json +++ b/composer.json @@ -14,13 +14,13 @@ "monolog/monolog": "^3.0", "php": ">=8.1.0", "psr/log": "^2.0 || ^3.0", - "symfony/console": "^6.0", - "symfony/dependency-injection": "^6.0", - "symfony/finder": "^6.0", - "symfony/process": "^6.0", - "symfony/yaml": "^6.0", - "symfony/http-client": "^6.0", - "symfony/http-foundation": "^6.0", + "symfony/console": "^6.0 || ^7.0", + "symfony/dependency-injection": "^6.0 || ^7.0", + "symfony/finder": "^6.0 || ^7.0", + "symfony/process": "^6.0 || ^7.0", + "symfony/yaml": "^6.0 || ^7.0", + "symfony/http-client": "^6.0 || ^7.0", + "symfony/http-foundation": "^6.0 || ^7.0", "consolidation/self-update": "~2.1.0" }, "require-dev": { diff --git a/src/Command/AbstractCommand.php b/src/Command/AbstractCommand.php index bac5935..cee76fd 100644 --- a/src/Command/AbstractCommand.php +++ b/src/Command/AbstractCommand.php @@ -11,8 +11,10 @@ namespace CacheTool\Command; +use CacheTool\CacheTool; + +use CacheTool\DependencyInjection\ContainerAwareInterface; use Symfony\Component\Console\Command\Command; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; abstract class AbstractCommand extends Command implements ContainerAwareInterface diff --git a/src/Console/Application.php b/src/Console/Application.php index 728f002..f3b921d 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -18,6 +18,7 @@ use CacheTool\Adapter\Web; use CacheTool\CacheTool; use CacheTool\Command as CacheToolCommand; +use CacheTool\DependencyInjection\ContainerAwareInterface; use CacheTool\Monolog\ConsoleHandler; use Monolog\Logger; use SelfUpdate\SelfUpdateCommand; @@ -27,7 +28,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/src/DependencyInjection/ContainerAwareInterface.php b/src/DependencyInjection/ContainerAwareInterface.php new file mode 100644 index 0000000..7a91925 --- /dev/null +++ b/src/DependencyInjection/ContainerAwareInterface.php @@ -0,0 +1,11 @@ + Date: Thu, 19 Sep 2024 15:12:06 +0200 Subject: [PATCH 2/3] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d0061a6..b43c883 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "symfony/yaml": "^6.0 || ^7.0", "symfony/http-client": "^6.0 || ^7.0", "symfony/http-foundation": "^6.0 || ^7.0", - "consolidation/self-update": "~2.1.0" + "consolidation/self-update": "~2.1.0 || ^3.0" }, "require-dev": { "phpunit/phpunit": "^9.0" From a37609d1e5338f87bb0f73a3d040a58ee984f19a Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Mon, 25 Nov 2024 09:13:44 +0100 Subject: [PATCH 3/3] feat: support symfony 7 --- src/Console/Application.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Console/Application.php b/src/Console/Application.php index f3b921d..d0ca10e 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -22,6 +22,7 @@ use CacheTool\Monolog\ConsoleHandler; use Monolog\Logger; use SelfUpdate\SelfUpdateCommand; +use SelfUpdate\SelfUpdateManager; use Symfony\Component\Console\Application as BaseApplication; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputDefinition; @@ -62,11 +63,13 @@ public function __construct(Config $config) protected function getDefaultCommands(): array { $commands = parent::getDefaultCommands(); - $commands[] = new SelfUpdateCommand( + + $selfUpdateManager = new SelfUpdateManager( 'gordalina/cachetool', '@package_version@', 'gordalina/cachetool' ); + $commands[] = new SelfUpdateCommand($selfUpdateManager); if (in_array('apcu', $this->config['extensions'], true)) { $commands[] = new CacheToolCommand\ApcuCacheClearCommand();