| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 54 | 2 | public function getValue(string $columnName, Collection $relation): string |
|
| 55 | { |
||
| 56 | 2 | $aggregateFunctionSet = $this->aggregate !== 'first'; |
|
| 57 | 2 | if ($aggregateFunctionSet) |
|
| 58 | { |
||
| 59 | 1 | return $relation->{$this->aggregate}($columnName); |
|
| 60 | } |
||
| 61 | |||
| 62 | 1 | return (string) $relation->first()->{$columnName}; |
|
| 63 | } |
||
| 64 | } |