8000 [Console] Add proper return type-hint to Command::execute() method in… · symfony/symfony@78d7da2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 78d7da2

Browse files
committed
[Console] Add proper return type-hint to Command::execute() method in all core Commands
1 parent 9db466d commit 78d7da2

14 files changed

+14
-14
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function configure()
5454
/**
5555
* {@inheritdoc}
5656
*/
57-
protected function execute(InputInterface $input, OutputInterface $output)
57+
protected function execute(InputInterface $input, OutputInterface $output): int
5858
{
5959
$io = new SymfonyStyle($input, $output);
6060

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function configure()
7272
/**
7373
* {@inheritdoc}
7474
*/
75-
protected function execute(InputInterface $input, OutputInterface $output)
75+
protected function execute(InputInterface $input, OutputInterface $output): int
7676
{
7777
$fs = $this->filesystem;
7878
$io = new SymfonyStyle($input, $output);

src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function configure()
6060
/**
6161
* {@inheritdoc}
6262
*/
63-
protected function execute(InputInterface $input, OutputInterface $output)
63+
protected function execute(InputInterface $input, OutputInterface $output): int
6464
{
6565
$io = new SymfonyStyle($input, $output);
6666
$kernel = $this->getApplication()->getKernel();

src/Symfony/Bundle/FrameworkBundle/Command/CachePoolDeleteCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function configure()
5959
/**
6060
* {@inheritdoc}
6161
*/
62-
protected function execute(InputInterface $input, OutputInterface $output)
62+
protected function execute(InputInterface $input, OutputInterface $output): int
6363
{
6464
$io = new SymfonyStyle($input, $output);
6565
$pool = $input->getArgument('pool');

src/Symfony/Bundle/FrameworkBundle/Command/CachePoolListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected function configure()
5151
/**
5252
* {@inheritdoc}
5353
*/
54-
protected function execute(InputInterface $input, OutputInterface $output)
54+
protected function execute(InputInterface $input, OutputInterface $output): int
5555
{
5656
$io = new SymfonyStyle($input, $output);
5757

src/Symfony/Bundle/FrameworkBundle/Command/CachePoolPruneCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function configure()
5757
/**
5858
* {@inheritdoc}
5959
*/
60-
protected function execute(InputInterface $input, OutputInterface $output)
60+
protected function execute(InputInterface $input, OutputInterface $output): int
6161
{
6262
$io = new SymfonyStyle($input, $output);
6363

src/Symfony/Bundle/FrameworkBundle/Command/CacheWarmupCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected function configure()
6666
/**
6767
* {@inheritdoc}
6868
*/
69-
protected function execute(InputInterface $input, OutputInterface $output)
69+
protected function execute(InputInterface $input, OutputInterface $output): int
7070
{
7171
$io = new SymfonyStyle($input, $output);
7272

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function configure()
6363
/**
6464
* {@inheritdoc}
6565
*/
66-
protected function execute(InputInterface $input, OutputInterface $output)
66+
protected function execute(InputInterface $input, OutputInterface $output): int
6767
{
6868
$io = new SymfonyStyle($input, $output);
6969
$errorIo = $io->getErrorStyle();

src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function configure()
114114
/**
115115
* {@inheritdoc}
116116
*/
117-
protected function execute(InputInterface $input, OutputInterface $output)
117+
protected function execute(InputInterface $input, OutputInterface $output): int
118118
{
119119
if ($input->getOption('show-private')) {
120120
@trigger_error('The "--show-private" option no longer has any effect and is deprecated since Symfony 4.1.', E_USER_DEPRECATED);

src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function configure()
6969
*
7070
* @throws \LogicException
7171
*/
72-
protected function execute(InputInterface $input, OutputInterface $output)
72+
protected function execute(InputInterface $input, OutputInterface $output): int
7373
{
7474
$io = new SymfonyStyle($input, $output);
7575

src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function configure()
7373
*
7474
* @throws InvalidArgumentException When route does not exist
7575
*/
76-
protected function execute(InputInterface $input, OutputInterface $output)
76+
protected function execute(InputInterface $input, OutputInterface $output): int
7777
{
7878
$io = new SymfonyStyle($input, $output);
7979
$name = $input->getArgument('name');

src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ protected function configure()
124124
/**
125125
* {@inheritdoc}
126126
*/
127-
protected function execute(InputInterface $input, OutputInterface $output)
127+
protected function execute(InputInterface $input, OutputInterface $output): int
128128
{
129129
$io = new SymfonyStyle($input, $output);
130130

src/Symfony/Bundle/FrameworkBundle/Command/WorkflowDumpCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function configure()
5959
/**
6060
* {@inheritdoc}
6161
*/
62-
protected function execute(InputInterface $input, OutputInterface $output)
62+
protected function execute(InputInterface $input, OutputInterface $output): int
6363
{
6464
$container = $this->getApplication()->getKernel()->getContainer();
6565
$serviceId = $input->getArgument('name');

src/Symfony/Component/Console/Command/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function run(InputInterface $input, OutputInterface $output)
254254
} else {
255255
$statusCode = $this->execute($input, $output);
256256

257-
if (!is_int($statusCode)) {
257+
if (!\is_int($statusCode)) {
258258
@trigger_error(sprintf('A non numeric or nullable $statusCode returned by Command::execute() is deprecated since Symfony 4.4, return an integer value instead.'), E_USER_DEPRECATED);
259259
}
260260
}

0 commit comments

Comments
 (0)
0