From b10eaf374f5799a082b4a0c255bacc8ca028f7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Peri=C4=87?= Date: Thu, 8 Sep 2016 10:57:53 +0200 Subject: [PATCH] Get rid of else --- src/Illuminate/Console/Parser.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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] : [];