| Total Complexity | 4 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Sarala |
||
| 11 | { |
||
| 12 | private Collection $handlers; |
||
| 13 | |||
| 14 | private $handler; |
||
| 15 | |||
| 16 | private array $supportedMediaTypes; |
||
| 17 | |||
| 18 | public function __construct() |
||
| 19 | { |
||
| 20 | $this->handlers = collect(config('sarala.handlers')); |
||
| 21 | |||
| 22 | $this->handler = $this->handlers |
||
| 23 | ->where('media_type', request()->header('Accept')) |
||
| 24 | ->first(); |
||
| 25 | |||
| 26 | $this->supportedMediaTypes = $this->handlers |
||
| 27 | ->pluck('media_type') |
||
| 28 | ->all(); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getSerializer() |
||
| 36 | } |
||
| 37 | |||
| 38 | public function getSupportedMediaTypes(): array |
||
| 43 |