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