Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | 3 | public function add(string $key, $value): self |
|
33 | { |
||
34 | 3 | if (!is_scalar($value)) { |
|
35 | 1 | throw new \InvalidArgumentException(sprintf( |
|
36 | 1 | 'MetadataBag expect scalar value, %s given', |
|
37 | 1 | gettype($value) |
|
38 | )); |
||
39 | } |
||
40 | |||
41 | 2 | $this->parameters[$key] = $value; |
|
42 | |||
43 | 2 | return $this; |
|
44 | } |
||
54 |