Skip to content

Commit

Permalink
Use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Mar 30, 2024
1 parent c527fbd commit 0e3927f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Util/ArgumentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
*/
class ArgumentProcessor
{

const SHORT_OPTION = '-short';

/**
* selectArgs selects the appropriate set of arguments for the command
* to be executed and orders them as needed.
Expand All @@ -28,7 +31,7 @@ class ArgumentProcessor
public function selectArgs(SiteAliasInterface $siteAlias, $args, $options = [], $optionsPassedAsArgs = [])
{
// Split args into three arrays separated by the `--`
list($leadingArgs, $dashDash, $remaingingArgs) = $this->findArgSeparator($args);
[$leadingArgs, $dashDash, $remaingingArgs] = $this->findArgSeparator($args);
$convertedOptions = $this->convertOptions($options);
$convertedOptionsPassedAsArgs = $this->convertOptions($optionsPassedAsArgs);

Expand Down Expand Up @@ -83,7 +86,7 @@ protected function convertOptions($options)
foreach ($options as $option => $value) {
if ($value === true || $value === null) {
$result[] = "--$option";
} elseif ($value === '-short') {
} elseif ($value === self::SHORT_OPTION) {
$result[] = "-$option";
} elseif ($value === false) {
// Ignore this option.
Expand Down

0 comments on commit 0e3927f

Please sign in to comment.