1 | <?php |
||
24 | class Parser implements ParserInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var array|UserInterface[] |
||
28 | */ |
||
29 | private $mentions = []; |
||
30 | |||
31 | /** |
||
32 | * @param string $html |
||
33 | * @param array|UserInterface[] $mentions |
||
34 | * @return NodeList |
||
35 | */ |
||
36 | public function parse(string $html, array $mentions): NodeList |
||
46 | |||
47 | /** |
||
48 | * @param string $html |
||
49 | * @return string |
||
50 | */ |
||
51 | private function removeUnusedTags(string $html): string |
||
55 | |||
56 | /** |
||
57 | * @param string $html |
||
58 | * @return \DOMNode |
||
59 | */ |
||
60 | private function createRoot(string $html): \DOMNode |
||
69 | |||
70 | /** |
||
71 | * @param \DOMNode $root |
||
72 | * @return \Generator |
||
73 | */ |
||
74 | private function transformXml(\DOMNode $root): \Generator |
||
85 | |||
86 | /** |
||
87 | * @param \DOMElement|\DOMText $child |
||
88 | * @return \Generator |
||
89 | */ |
||
90 | private function transformChildren($child): \Generator |
||
105 | |||
106 | /** |
||
107 | * @param \DOMElement $user |
||
108 | * @return UserNode|TextNode|NodeInterface |
||
109 | */ |
||
110 | private function parseUser(\DOMElement $user): NodeInterface |
||
124 | |||
125 | /** |
||
126 | * @param \DOMElement $code |
||
127 | * @return CodeNode |
||
128 | */ |
||
129 | private function parseCode(\DOMElement $code): CodeNode |
||
135 | } |
||
136 |
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: