Conditions | 4 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
49 | public function onEdit(): array |
||
50 | { |
||
51 | $relation = $this->relation(); |
||
52 | |||
53 | if (static::MODE_CHECKBOXES === $this->editMode && $this->completeList) { |
||
54 | $values = $this->query |
||
55 | ? call_user_func_array($this->query, [$relation->getRelated()->query()]) |
||
56 | : $relation->getRelated()->all(); |
||
57 | } else { |
||
58 | $values = $this->value(); |
||
59 | } |
||
60 | |||
61 | return [ |
||
62 | 'relation' => $relation, |
||
63 | 'searchable' => \get_class($relation->getRelated()), |
||
64 | 'values' => $values, |
||
65 | 'completeList' => $this->completeList, |
||
66 | 'titleField' => $this->titleField, |
||
67 | 'editMode' => $this->editMode, |
||
68 | ]; |
||
71 |