| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class Value implements ArgumentParserInterface |
||
| 20 | { |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Service argument to parse |
||
| 24 | * |
||
| 25 | * @var array |
||
| 26 | */ |
||
| 27 | private $argument; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Constructor |
||
| 31 | * |
||
| 32 | * @param array $argument |
||
| 33 | * Service argument to parse |
||
| 34 | */ |
||
| 35 | 18 | public function __construct(array $argument) |
|
| 36 | { |
||
| 37 | // remember arguments |
||
| 38 | 18 | $this->argument = $argument; |
|
| 39 | // check argument |
||
| 40 | 18 | if (! isset($this->argument['value'])) { |
|
| 41 | 3 | throw new Exception('No "value" argument'); |
|
| 42 | } |
||
| 43 | 15 | } |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Parse service argument and return argument to service constructor |
||
| 47 | * |
||
| 48 | * @return mixed Parsed argument |
||
| 49 | * @see \Kocuj\Di\ArgumentParser\ArgumentParserInterface::parse() |
||
| 50 | */ |
||
| 51 | 15 | public function parse() |
|
| 55 | } |
||
| 56 | } |
||
| 57 |