| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0625 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 50 | public function associate(DataInterface $included) |
|
| 28 | { |
||
| 29 | 50 | 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 | 50 | $this->setId($included->getId()); |
|
| 36 | 50 | $this->setType($included->getType()); |
|
| 37 | |||
| 38 | 50 | $this->included = $included; |
|
| 39 | |||
| 40 | 50 | return $this; |
|
| 41 | } |
||
| 89 |