Skip to content

Commit 68866fb

Browse files
bug symfony#38114 [Console] guard $argv + $token against null, preventing unnecessary exceptions (bilogic)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead. Discussion ---------- [Console] guard $argv + $token against null, preventing unnecessary exceptions | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | Tickets | Fix symfony#38105 | License | MIT This issue was causing an unnecessary exception, leading to difficulty in locating the actual offending code as reported by many cases as detailed in symfony#38105 Commits ------- dbe335d guard $argv + $token against null, preventing unnecessary exceptions
2 parents 91b6739 + dbe335d commit 68866fb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Symfony/Component/Console/Input/ArgvInput.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ class ArgvInput extends Input
4949
*/
5050
public function __construct(array $argv = null, InputDefinition $definition = null)
5151
{
52-
if (null === $argv) {
53-
$argv = $_SERVER['argv'];
54-
}
52+
$argv = $argv ?? $_SERVER['argv'] ?? [];
5553

5654
// strip the application name
5755
array_shift($argv);

0 commit comments

Comments
 (0)