| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2.0932 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 60 | public function associate(DataInterface $included) |
|
| 28 | { |
||
| 29 | 60 | if (!$included instanceof ItemInterface) { |
|
| 30 | throw new \InvalidArgumentException( |
||
| 31 | sprintf('%s expects relation to be an instance of %s', static::class, ItemInterface::class) |
||
| 32 | ); |
||
| 33 | } |
||
| 34 | |||
| 35 | 60 | $this->setId($included->getId()); |
|
| 36 | |||
| 37 | 60 | $this->included = $included; |
|
| 38 | |||
| 39 | 60 | return $this; |
|
| 40 | } |
||
| 90 |