Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for symfony/console of version ^7.0 #189

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .phpunit-watcher.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 2.1.2 under development

- no changes in this release.
- Enh #189: Add support for `symfony/console` of version `^7.0` (@vjik)

## 2.1.1 November 05, 2023

Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"psr/container": "^1.0|^2.0",
"psr/event-dispatcher": "^1.0",
"psr/log": "^1.0|^2.0|^3.0",
"symfony/console": "^5.4|^6.0",
"symfony/console": "^5.4|^6.0|^7.0",
"symfony/event-dispatcher-contracts": "^2.2|^3.0",
"yiisoft/friendly-exception": "^1.0"
},
Expand All @@ -40,7 +40,6 @@
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.18.0",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.30|^5.6",
"yiisoft/config": "^1.3",
"yiisoft/di": "^1.2",
Expand Down
5 changes: 2 additions & 3 deletions src/Command/Game.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Yiisoft\Yii\Console\Command;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -14,11 +15,9 @@
/**
* @codeCoverageIgnore
*/
#[AsCommand('|yii', 'A Guessing Game')]
final class Game extends Command
{
protected static $defaultName = '|yii';
protected static $defaultDescription = 'A Guessing Game';

protected function execute(InputInterface $input, OutputInterface $output): int
{
$steps = 1;
Expand Down
5 changes: 2 additions & 3 deletions src/Command/Serve.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Yiisoft\Yii\Console\Command;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;
Expand All @@ -21,6 +22,7 @@
use function is_dir;
use function passthru;

#[AsCommand('serve', 'Runs PHP built-in web server')]
final class Serve extends Command
{
public const EXIT_CODE_NO_DOCUMENT_ROOT = 2;
Expand All @@ -33,9 +35,6 @@ final class Serve extends Command
private string $defaultRouter;
private int $defaultWorkers;

protected static $defaultName = 'serve';
protected static $defaultDescription = 'Runs PHP built-in web server';

/**
* @psalm-param array{
* address?:non-empty-string,
Expand Down
7 changes: 3 additions & 4 deletions tests/Stub/ErrorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@

namespace Yiisoft\Yii\Console\Tests\Stub;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Yiisoft\Yii\Console\ExitCode;

#[AsCommand('error', 'Error command tests')]
final class ErrorCommand extends Command
{
protected static $defaultName = 'error';
protected static $defaultDescription = 'Error command tests';

public function __construct(private NonExistsClass $class)
{
parent::__construct();
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
return ExitCode::OK;
}
Expand Down
Loading