Skip to content

Commit dbe335d

Browse files
bilogicnicolas-grekas
authored andcommitted
guard $argv + $token against null, preventing unnecessary exceptions
1 parent 91b6739 commit dbe335d

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)