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