| Conditions | 5 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 25 | public function add($relationship) |
||
| 26 | { |
||
| 27 | $data = \explode('.', (string) $relationship); |
||
| 28 | $type = $data[0]; |
||
| 29 | $attribute = (!empty($data[1])) ? $data[1] : null; |
||
| 30 | |||
| 31 | if (null === $attribute) { |
||
| 32 | $this->included[$type] = $type; |
||
| 33 | } else { |
||
| 34 | if (!empty($this->included[$type]) && is_string($this->included[$type])) { |
||
| 35 | $this->included[$type] = []; |
||
| 36 | } |
||
| 37 | $this->included[$type][] = $attribute; |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 57 |