Conditions | 5 |
Paths | 6 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
51 | 8 | public function resolve( |
|
52 | StreamInterface $built, |
||
53 | Definitions $definitions |
||
54 | ): StreamInterface { |
||
55 | try { |
||
56 | 8 | $value = $definitions->arguments()->get($this->name); |
|
57 | 7 | } catch (ArgumentNotProvided $e) { |
|
58 | 3 | if ($e->argument()->hasDefault()) { |
|
59 | 2 | $value = $definitions->build($e->argument()->default()); |
|
60 | } |
||
61 | |||
62 | 3 | if ($e->argument()->optional()) { |
|
63 | 3 | $value = null; |
|
64 | } |
||
65 | 4 | } catch (ArgumentNotDefined $e) { |
|
66 | 4 | $value = $definitions->build($this->name); |
|
67 | } |
||
68 | |||
69 | 8 | return $built->add($value); |
|
70 | } |
||
72 |