| @@ 131-146 (lines=16) @@ | ||
| 128 | * Store the data from a @default annotation in our argument or option store, |
|
| 129 | * as appropriate. |
|
| 130 | */ |
|
| 131 | protected function processDefaultTag($tag) |
|
| 132 | { |
|
| 133 | if (!$this->pregMatchNameAndDescription($tag->getDescription(), $match)) { |
|
| 134 | return; |
|
| 135 | } |
|
| 136 | $variableName = $match['name']; |
|
| 137 | $defaultValue = $this->interpretDefaultValue($match['description']); |
|
| 138 | if ($this->commandInfo->arguments()->exists($variableName)) { |
|
| 139 | $this->commandInfo->arguments()->setDefaultValue($variableName, $defaultValue); |
|
| 140 | return; |
|
| 141 | } |
|
| 142 | $variableName = $this->commandInfo->findMatchingOption($variableName); |
|
| 143 | if ($this->commandInfo->options()->exists($variableName)) { |
|
| 144 | $this->commandInfo->options()->setDefaultValue($variableName, $defaultValue); |
|
| 145 | } |
|
| 146 | } |
|
| 147 | ||
| 148 | /** |
|
| 149 | * Process the comma-separated list of aliases |
|
| @@ 145-160 (lines=16) @@ | ||
| 142 | * Store the data from a @default annotation in our argument or option store, |
|
| 143 | * as appropriate. |
|
| 144 | */ |
|
| 145 | protected function processDefaultTag($tag) |
|
| 146 | { |
|
| 147 | if (!$this->pregMatchNameAndDescription((string)$tag->getDescription(), $match)) { |
|
| 148 | return; |
|
| 149 | } |
|
| 150 | $variableName = $match['name']; |
|
| 151 | $defaultValue = $this->interpretDefaultValue($match['description']); |
|
| 152 | if ($this->commandInfo->arguments()->exists($variableName)) { |
|
| 153 | $this->commandInfo->arguments()->setDefaultValue($variableName, $defaultValue); |
|
| 154 | return; |
|
| 155 | } |
|
| 156 | $variableName = $this->commandInfo->findMatchingOption($variableName); |
|
| 157 | if ($this->commandInfo->options()->exists($variableName)) { |
|
| 158 | $this->commandInfo->options()->setDefaultValue($variableName, $defaultValue); |
|
| 159 | } |
|
| 160 | } |
|
| 161 | ||
| 162 | /** |
|
| 163 | * Process the comma-separated list of aliases |
|