Conditions | 3 |
Paths | 1 |
Total Lines | 6 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | 2 | public function toMorph(string $key, Model $value, string $idKeyName = 'id', string $classKeyName = 'class'): static |
|
11 | { |
||
12 | 2 | $this->setAttribute($key ? "{$key}.{$idKeyName}" : $idKeyName, $value->getKey()); |
|
|
|||
13 | 2 | $this->setAttribute($key ? "{$key}.{$classKeyName}" : $classKeyName, $value->getMorphClass()); |
|
14 | |||
15 | 2 | return $this; |
|
16 | } |
||
39 |