Skip to content

Commit 55dfce3

Browse files
jfcherngktomk
authored andcommitted
fix: symfony/console v6 compatibility
Nullable type is a PHP 7.1 feature. Signed-off-by: Jack Cherng <[email protected]>
1 parent 5c4bb62 commit 55dfce3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

bin/symfony-autocomplete

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env php
22
<?php
33

4+
use Bamarni\Symfony\Console\Autocomplete\DumpCommand;
45
use Symfony\Component\Console\Application as BaseApplication;
56
use Symfony\Component\Console\Command\Command;
7+
use Symfony\Component\Console\Input\InputDefinition;
68
use Symfony\Component\Console\Input\InputInterface;
7-
use Bamarni\Symfony\Console\Autocomplete\DumpCommand;
89

910
if (file_exists($autoload = __DIR__.'/../../../autoload.php')) {
1011
require_once $autoload;
@@ -23,20 +24,20 @@ class Application extends BaseApplication
2324
parent::__construct();
2425
}
2526

26-
protected function getCommandName(InputInterface $input)
27+
protected function getCommandName(InputInterface $input): ?string
2728
{
2829
return $this->command->getName();
2930
}
3031

31-
protected function getDefaultCommands()
32+
protected function getDefaultCommands(): array
3233
{
3334
$defaultCommands = parent::getDefaultCommands();
3435
$defaultCommands[] = $this->command;
3536

3637
return $defaultCommands;
3738
}
3839

39-
public function getDefinition()
40+
public function getDefinition(): InputDefinition
4041
{
4142
$inputDefinition = parent::getDefinition();
4243
$inputDefinition->setArguments();

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Shell completion for Symfony Console based scripts",
44
"license": "MIT",
55
"require": {
6-
"php": "^7.0|^8.0",
6+
"php": "^7.1|^8.0",
77
"ext-simplexml": "*",
88
"symfony/console": "^2.5|^3|^4|^5|^6",
99
"symfony/process": "^2.5|^3|^4|^5|^6"

0 commit comments

Comments
 (0)