| 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 |
||
| 25 | 3 | public function add(string $key, $value): self |
|
| 26 | { |
||
| 27 | 3 | if (!is_scalar($value)) { |
|
|
|
|||
| 28 | 1 | throw new \InvalidArgumentException(sprintf( |
|
| 29 | 1 | 'MetadataBag expect scalar value, %s given', |
|
| 30 | 1 | gettype($value) |
|
| 31 | )); |
||
| 32 | } |
||
| 33 | |||
| 34 | 2 | $this->parameters[$key] = $value; |
|
| 35 | |||
| 36 | 2 | return $this; |
|
| 37 | } |
||
| 47 |