| @@ 78-89 (lines=12) @@ | ||
| 75 | } |
|
| 76 | ||
| 77 | $this->matcher->matchDecoder($header); |
|
| 78 | if (null === $this->matcher->getDecoderHeaderMatchedType()) { |
|
| 79 | throw new JsonApiException( |
|
| 80 | new Error( |
|
| 81 | rand(), |
|
| 82 | null, |
|
| 83 | JsonApiException::HTTP_CODE_UNSUPPORTED_MEDIA_TYPE, |
|
| 84 | self::UNSUPPORTED_CONTENT_TYPE_ERROR, |
|
| 85 | 'Unsupported content type' |
|
| 86 | ), |
|
| 87 | JsonApiException::HTTP_CODE_UNSUPPORTED_MEDIA_TYPE |
|
| 88 | ); |
|
| 89 | } |
|
| 90 | } |
|
| 91 | ||
| 92 | /** |
|
| @@ 102-113 (lines=12) @@ | ||
| 99 | { |
|
| 100 | $this->matcher->matchEncoder($header); |
|
| 101 | ||
| 102 | if (null === $this->matcher->getEncoderHeaderMatchedType()) { |
|
| 103 | throw new JsonApiException( |
|
| 104 | new Error( |
|
| 105 | rand(), |
|
| 106 | null, |
|
| 107 | JsonApiException::HTTP_CODE_UNSUPPORTED_MEDIA_TYPE, |
|
| 108 | self::UNSUPPORTED_ACCEPT_ERROR, |
|
| 109 | 'Unsupported media type' |
|
| 110 | ), |
|
| 111 | JsonApiException::HTTP_CODE_UNSUPPORTED_MEDIA_TYPE |
|
| 112 | ); |
|
| 113 | } |
|
| 114 | } |
|
| 115 | } |
|