diff --git a/src/Illuminate/Console/Parser.php b/src/Illuminate/Console/Parser.php index 3325c6ca2ad2..a44aedf686c7 100644 --- a/src/Illuminate/Console/Parser.php +++ b/src/Illuminate/Console/Parser.php @@ -25,12 +25,11 @@ public static function parse($expression) preg_match('/[^\s]+/', $expression, $matches); - if (isset($matches[0])) { - $name = $matches[0]; - } else { + if (!isset($matches[0])) { throw new InvalidArgumentException('Unable to determine command name from signature.'); } - + + $name = $matches[0]; preg_match_all('/\{\s*(.*?)\s*\}/', $expression, $matches); $tokens = isset($matches[1]) ? $matches[1] : [];