| Conditions | 5 |
| Paths | 12 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function validate(InputInterface $input) |
||
| 18 | { |
||
| 19 | $hasValidInput = true; |
||
| 20 | |||
| 21 | $sizes = $input->getOption(BenchmarkCommand::SIZE_OPTION); |
||
| 22 | $iterations = $input->getOption(BenchmarkCommand::ITERATIONS_OPTION); |
||
| 23 | $seed = $input->getOption(BenchmarkCommand::SEED_OPTION); |
||
| 24 | |||
| 25 | foreach ($sizes as $size) { |
||
| 26 | if (!$this->isPositiveInteger($size)) { |
||
| 27 | $this->output->error('The size must be an integer greater than 0'); |
||
| 28 | $hasValidInput = false; |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | if (!$this->isPositiveInteger($iterations)) { |
||
| 33 | $this->output->error('The number of iterations must be an integer greater than 0'); |
||
| 34 | $hasValidInput = false; |
||
| 35 | } |
||
| 36 | |||
| 37 | if (!$this->isOptionalInteger($seed)) { |
||
| 38 | $this->output->error('The seed must be an integer'); |
||
| 39 | $hasValidInput = false; |
||
| 40 | } |
||
| 41 | |||
| 42 | return $hasValidInput; |
||
| 43 | } |
||
| 44 | |||
| 59 |