Skip to content

Commit

Permalink
Use Str::startsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot committed Jun 29, 2015
1 parent 8359cec commit 271a3eb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Parser.php
Expand Up @@ -87,13 +87,13 @@ protected static function parseArgument($token)
}

switch (true) {
case ends_with($token, '?*'):
case Str::endsWith($token, '?*'):
return new InputArgument(trim($token, '?*'), InputArgument::IS_ARRAY, $description);

case ends_with($token, '*'):
case Str::endsWith($token, '*'):
return new InputArgument(trim($token, '*'), InputArgument::IS_ARRAY | InputArgument::REQUIRED, $description);

case ends_with($token, '?'):
case Str::endsWith($token, '?'):
return new InputArgument(trim($token, '?'), InputArgument::OPTIONAL, $description);

case (preg_match('/(.+)\=(.+)/', $token, $matches)):
Expand Down Expand Up @@ -123,10 +123,10 @@ protected static function parseOption($token)
}

switch (true) {
case ends_with($token, '='):
case Str::endsWith($token, '='):
return new InputOption(trim($token, '='), null, InputOption::VALUE_OPTIONAL, $description);

case ends_with($token, '=*'):
case Str::endsWith($token, '=*'):
return new InputOption(trim($token, '=*'), null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, $description);

case (preg_match('/(.+)\=(.+)/', $token, $matches)):
Expand Down

0 comments on commit 271a3eb

Please sign in to comment.