From c41e5b950b89d2de152a2c2fd185218fb92275aa Mon Sep 17 00:00:00 2001 From: Kristof Torfs Date: Tue, 5 Dec 2023 08:35:05 +0100 Subject: [PATCH] Add support for Symfony 7 (#314) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add support for Symfony 7 * Fixed tests * Added return types * Fix: Update CHANGELOG.md --------- Co-authored-by: Andreas Möller --- CHANGELOG.md | 6 ++++++ composer.json | 6 +++--- psalm-baseline.xml | 16 +++++----------- src/Console/Application.php | 6 +++--- src/Console/LintCommand.php | 4 ++-- src/Console/RegDebugCommand.php | 4 ++-- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 032e596..6445710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), For a full diff see [`6.3.0...main`][6.3.0...main]. +### Added + +- Added support for `symfony/console:^7.0.0`, `symfony/filesystem:^7.0.0`, and `symfony/finder:^7.0.0` ([#314]), by [@kristoftorfs] + ## [`6.3.0`][6.3.0] For a full diff see [`6.2.0...6.3.0`][6.2.0...6.3.0]. @@ -165,6 +169,8 @@ For a full diff see [`b139b06...1.0.0`][b139b06...1.0.0]. [#270]: https://github.com/friendsoftwig/twigcs/pull/270 [#296]: https://github.com/friendsoftwig/twigcs/pull/296 +[#314]: https://github.com/friendsoftwig/twigcs/pull/314 +[@kristoftorfs]: https://github.com/kristoftorfs [@localheinz]: https://github.com/localheinz [@rajeshreeputra]: https://github.com/rajeshreeputra diff --git a/composer.json b/composer.json index 37e6daa..abd894f 100644 --- a/composer.json +++ b/composer.json @@ -15,9 +15,9 @@ "ext-json": "*", "ext-mbstring": "*", "ext-simplexml": "*", - "symfony/console": "^4.4 || ^5.3 || ^6.0", - "symfony/filesystem": "^4.4 || ^5.3 || ^6.0", - "symfony/finder": "^4.4 || ^5.3 || ^6.0" + "symfony/console": "^4.4 || ^5.3 || ^6.0 || ^7.0", + "symfony/filesystem": "^4.4 || ^5.3 || ^6.0 || ^7.0", + "symfony/finder": "^4.4 || ^5.3 || ^6.0 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^9.6.15", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 0df8109..b0d74d5 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -122,9 +122,6 @@ getRealPath - - configure - $file $finder @@ -153,13 +150,10 @@ validate - str_replace(getcwd(), '', $realPath) + - - configure - getColumn()]]> getReason()]]> @@ -1466,8 +1460,8 @@ - '([{' - ')]}' + + $state @@ -1787,8 +1781,8 @@ skipToOneOf - $possibility['type'] - $possibility['value'] + + $possibility diff --git a/src/Console/Application.php b/src/Console/Application.php index 2311564..372a880 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -25,12 +25,12 @@ public function __construct(bool $singleCommand = true) $this->setDefaultCommand($command->getName(), $singleCommand); } - public function add(Command $command) + public function add(Command $command): ?Command { - parent::add($command); - if ($command instanceof ContainerAwareCommand) { $command->setContainer($this->container); } + + return parent::add($command); } } diff --git a/src/Console/LintCommand.php b/src/Console/LintCommand.php index 45f636d..496822a 100644 --- a/src/Console/LintCommand.php +++ b/src/Console/LintCommand.php @@ -24,7 +24,7 @@ class LintCommand extends ContainerAwareCommand */ public const DISPLAY_ALL = 'all'; - public function configure() + public function configure(): void { $this ->setName('lint') @@ -40,7 +40,7 @@ public function configure() ; } - public function execute(InputInterface $input, OutputInterface $output) + public function execute(InputInterface $input, OutputInterface $output): int { $container = $this->getContainer(); diff --git a/src/Console/RegDebugCommand.php b/src/Console/RegDebugCommand.php index 80afd5e..df65508 100644 --- a/src/Console/RegDebugCommand.php +++ b/src/Console/RegDebugCommand.php @@ -16,7 +16,7 @@ class RegDebugCommand extends ContainerAwareCommand { - public function configure() + public function configure(): void { $this ->setName('reg:debug') @@ -25,7 +25,7 @@ public function configure() ; } - public function execute(InputInterface $input, OutputInterface $output) + public function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output);