@@ 32-45 (lines=14) @@ | ||
29 | * |
|
30 | * @return NegotiatedValue|null |
|
31 | */ |
|
32 | public function negotiate(Request $request) |
|
33 | { |
|
34 | if ([] === $this->supportedMimeTypes) { |
|
35 | return null; |
|
36 | } |
|
37 | ||
38 | if (!$request->hasHeader('Accept')) { |
|
39 | return null; |
|
40 | } |
|
41 | ||
42 | $aggregatedValues = $this->aggregatedValues($request->getHeaderLine('Accept')); |
|
43 | ||
44 | return $this->compareAgainstSupportedTypes($aggregatedValues); |
|
45 | } |
|
46 | ||
47 | /** |
|
48 | * @param string $header |
@@ 32-43 (lines=12) @@ | ||
29 | * |
|
30 | * @return NegotiatedValue|null |
|
31 | */ |
|
32 | public function negotiate(Request $request) |
|
33 | { |
|
34 | if ([] === $this->supportedMimeTypes) { |
|
35 | return null; |
|
36 | } |
|
37 | ||
38 | if (!$request->hasHeader('Content-Type')) { |
|
39 | return null; |
|
40 | } |
|
41 | ||
42 | return $this->compareAgainstSupportedTypes($request->getHeaderLine('Content-Type')); |
|
43 | } |
|
44 | ||
45 | /** |
|
46 | * @param string $header |