| Total Complexity | 6 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | final class SerializeFormatResolver |
||
| 23 | { |
||
| 24 | private RequestStack $requestStack; |
||
| 25 | private string $defaultFormat; |
||
| 26 | |||
| 27 | public function __construct(RequestStack $requestStack, string $defaultFormat = 'jsonld') |
||
| 31 | } |
||
| 32 | |||
| 33 | public function getFormat(): string |
||
| 34 | { |
||
| 35 | $request = $this->requestStack->getMasterRequest(); |
||
| 36 | if (!$request) { |
||
| 37 | return $this->defaultFormat; |
||
| 38 | } |
||
| 39 | |||
| 40 | return $this->getFormatFromRequest($request); |
||
| 41 | } |
||
| 42 | |||
| 43 | public function getFormatFromRequest(Request $request): string |
||
| 46 | } |
||
| 47 | } |
||
| 48 |