Skip to content

Commit 67d8227

Browse files
committed
[Console] Add deprecation message for non-int return value in Command::execute()
1 parent 001777a commit 67d8227

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ public function run(InputInterface $input, OutputInterface $output)
253253
$statusCode = ($this->code)($input, $output);
254254
} else {
255255
$statusCode = $this->execute($input, $output);
256+
257+
if (!is_numeric($statusCode) || null === $statusCode) {
258+
@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);
259+
}
256260
}
257261

258262
return is_numeric($statusCode) ? (int) $statusCode : 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy