| Total Complexity | 5 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | trait HasValuePresenter |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Check if a model has field's presenter. |
||
| 12 | * |
||
| 13 | * @param Model $model |
||
| 14 | * @param string $field |
||
| 15 | * @return null|callable |
||
| 16 | */ |
||
| 17 | public function hasPresenter(Model $model, string $field): ?callable |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param callable $presenter |
||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | public function callPresenter(callable $presenter) |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param string $fieldName |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | public function presenterMethod(string $fieldName): string |
||
| 43 |