Skip to content

Commit 27c1fa1

Browse files
authored
[minor] support Symfony 6.1 (#24)
1 parent 50539fe commit 27c1fa1

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"symfony/console": "^4.4|^5.0|^6.0",
1717
"symfony/polyfill-php80": "^1.15",
1818
"symfony/string": "^5.0|^6.0",
19-
"zenstruck/callback": "^1.4.1"
19+
"zenstruck/callback": "^1.4.2"
2020
},
2121
"require-dev": {
2222
"phpdocumentor/reflection-docblock": "^5.2",

src/IO.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ final public function __construct(InputInterface $input, OutputInterface $output
2727
parent::__construct($this->input = $input, $this->output = $output);
2828
}
2929

30+
public function __toString(): string
31+
{
32+
if (!\method_exists($this->input, '__toString')) {
33+
// InputInterface extends \Stringable in 6.1+
34+
return 'Unsupported...';
35+
}
36+
37+
return $this->input->__toString();
38+
}
39+
3040
/**
3141
* Helper for {@see ProgressBar::iterate()}.
3242
*

tests/Fixture/Command/ServiceCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
*/
1717
final class ServiceCommand extends InvokableServiceCommand
1818
{
19-
protected static $defaultName = 'service-command';
20-
2119
public function __invoke(IO $io, InputInterface $input, OutputInterface $output, StyleInterface $style, $none, LoggerInterface $logger, ?RouterInterface $router = null, ?Table $optional = null): void
2220
{
2321
$io->comment(\sprintf('IO: %s', \get_debug_type($io)));
@@ -32,4 +30,9 @@ public function __invoke(IO $io, InputInterface $input, OutputInterface $output,
3230

3331
$io->success('done!');
3432
}
33+
34+
public static function getDefaultName(): string
35+
{
36+
return 'service-command';
37+
}
3538
}

tests/Fixture/Command/ServiceSubscriberTraitCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@ final class ServiceSubscriberTraitCommand extends InvokableServiceCommand
1616
{
1717
use ServiceSubscriberTrait;
1818

19-
protected static $defaultName = 'service-subscriber-trait-command';
20-
2119
public function __invoke(IO $io, RouterInterface $router): void
2220
{
2321
$io->comment(\sprintf('IO: %s', \get_debug_type($io)));
2422
$io->comment(\sprintf('RouterInterface: %s', \get_debug_type($router)));
2523
$io->comment(\sprintf('LoggerInterface: %s', \get_debug_type($this->logger())));
2624
}
2725

26+
public static function getDefaultName(): string
27+
{
28+
return 'service-subscriber-trait-command';
29+
}
30+
2831
#[SubscribedService]
2932
private function logger(): LoggerInterface
3033
{

tests/Unit/AutoNameTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function can_remove_prefix(): void
3333

3434
/**
3535
* @test
36+
* @group legacy
3637
*/
3738
public function can_use_traditional_naming_method(): void
3839
{

tests/Unit/DocblockConfigureTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public function parse_arguments_and_options(): void
144144

145145
/**
146146
* @test
147+
* @group legacy
147148
*/
148149
public function can_override_docblock_configuration_with_traditional_configuration(): void
149150
{

0 commit comments

Comments
 (0)