1 | <?php |
||
8 | abstract class AbstractNegotiator |
||
9 | { |
||
10 | /** |
||
11 | * @param string $header A string containing an `Accept|Accept-*` header. |
||
12 | * @param array $priorities A set of server priorities. |
||
13 | * |
||
14 | * @return AcceptHeader|null best matching type |
||
15 | */ |
||
16 | 69 | public function getBest($header, array $priorities, $strict = false) |
|
54 | |||
55 | /** |
||
56 | * @param string $header A string containing an `Accept|Accept-*` header. |
||
57 | * |
||
58 | * @return [AcceptHeader] An ordered list of accept header elements |
||
59 | */ |
||
60 | public function getOrderedElements($header) |
||
82 | 22 | ||
83 | |||
84 | /** |
||
85 | * @param string $header accept header part or server priority |
||
86 | * |
||
87 | * @return AcceptHeader Parsed header object |
||
88 | */ |
||
89 | abstract protected function acceptFactory($header); |
||
90 | 82 | ||
91 | /** |
||
92 | 82 | * @param AcceptHeader $header |
|
93 | * @param AcceptHeader $priority |
||
94 | 82 | * @param integer $index |
|
95 | * |
||
96 | * @return Match|null Headers matched |
||
97 | */ |
||
98 | 82 | protected function match(AcceptHeader $header, AcceptHeader $priority, $index) |
|
113 | 56 | ||
114 | 56 | /** |
|
115 | 66 | * @param string $header A string that contains an `Accept*` header. |
|
116 | 66 | * |
|
117 | * @return AcceptHeader[] |
||
118 | 66 | */ |
|
119 | private function parseHeader($header) |
||
129 | |||
130 | /** |
||
131 | * @param AcceptHeader[] $headerParts |
||
132 | * @param Priority[] $priorities Configured priorities |
||
133 | * |
||
134 | * @return Match[] Headers matched |
||
135 | */ |
||
136 | private function findMatches(array $headerParts, array $priorities) |
||
149 | } |
||
150 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: