| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 43 | 3 | final public function add(HydrableObjectInterface $object) |
|
| 44 | { |
||
| 45 | 3 | $type = static::T; |
|
| 46 | |||
| 47 | 3 | if (!($object instanceof $type)) { |
|
| 48 | 1 | throw new InvalidArgumentException(sprintf( |
|
| 49 | 1 | 'The <%s> collection must contain only the <%s> objects.', |
|
| 50 | 1 | get_called_class(), |
|
| 51 | 1 | $type, |
|
| 52 | )); |
||
| 53 | } |
||
| 54 | |||
| 55 | 2 | $this->objects[] = $object; |
|
| 56 | 2 | } |
|
| 66 |