| @@ 12-29 (lines=18) @@ | ||
| 9 | /** @var StringInput */ |
|
| 10 | protected $input; |
|
| 11 | ||
| 12 | protected function parseSignature() |
|
| 13 | { |
|
| 14 | list($name, $arguments, $options) = Parser::parse($this->signature); |
|
| 15 | ||
| 16 | $this->name = $name; |
|
| 17 | ||
| 18 | $inputDefinition = new InputDefinition(); |
|
| 19 | ||
| 20 | foreach($arguments as $argument) { |
|
| 21 | $inputDefinition->addArgument($argument); |
|
| 22 | } |
|
| 23 | ||
| 24 | foreach($options as $option) { |
|
| 25 | $inputDefinition->addOption($option); |
|
| 26 | } |
|
| 27 | ||
| 28 | $this->input = new StringInput($this->slashCommandData->text); |
|
| 29 | } |
|
| 30 | } |
|
| @@ 30-49 (lines=20) @@ | ||
| 27 | $this->parseSignature(); |
|
| 28 | } |
|
| 29 | ||
| 30 | protected function parseInput() |
|
| 31 | { |
|
| 32 | list($name, $arguments, $options) = Parser::parse($this->signature); |
|
| 33 | ||
| 34 | $this->name = $name; |
|
| 35 | ||
| 36 | $inputDefinition = new InputDefinition(); |
|
| 37 | ||
| 38 | foreach ($arguments as $argument) { |
|
| 39 | $inputDefinition->addArgument($argument); |
|
| 40 | } |
|
| 41 | ||
| 42 | foreach($options as $option) { |
|
| 43 | $inputDefinition->addOption($option); |
|
| 44 | } |
|
| 45 | ||
| 46 | $this->input = new StringInput($this->request->text); |
|
| 47 | ||
| 48 | $this->input->bind($inputDefinition); |
|
| 49 | } |
|
| 50 | ||
| 51 | ||
| 52 | protected function getArgument($foo) |
|