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 | 59 | public function getBest($header, array $priorities) |
|
52 | |||
53 | /** |
||
54 | * @param string $header accept header part or server priority |
||
55 | * |
||
56 | * @return AcceptHeader Parsed header object |
||
57 | */ |
||
58 | abstract protected function acceptFactory($header); |
||
59 | |||
60 | /** |
||
61 | * @param AcceptHeader $header |
||
62 | * @param AcceptHeader $priority |
||
63 | * @param integer $index |
||
64 | * |
||
65 | * @return Match|null Headers matched |
||
66 | */ |
||
67 | 17 | protected function match(AcceptHeader $header, AcceptHeader $priority, $index) |
|
82 | |||
83 | /** |
||
84 | * @param string $header A string that contains an `Accept*` header. |
||
85 | * |
||
86 | * @return AcceptHeader[] |
||
87 | */ |
||
88 | 72 | private function parseHeader($header) |
|
98 | |||
99 | /** |
||
100 | * @param AcceptHeader[] $headerParts |
||
101 | * @param Priority[] $priorities Configured priorities |
||
102 | * |
||
103 | * @return Match[] Headers matched |
||
104 | */ |
||
105 | 57 | private function findMatches(array $headerParts, array $priorities) |
|
118 | } |
||
119 |
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: