1 | <?php declare(strict_types=1); |
||
17 | class Document extends \DOMDocument |
||
18 | { |
||
19 | use CommonTrait; |
||
20 | use TraversalTrait; |
||
21 | use ManipulationTrait; |
||
22 | |||
23 | 140 | public function __construct(string $version = '1.0', string $encoding = 'UTF-8') { |
|
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | 138 | public function document(): ?\DOMDocument { |
|
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | 134 | public function collection(): NodeList { |
|
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | 1 | public function result(NodeList $nodeList) { |
|
51 | 1 | if ($nodeList->count()) { |
|
52 | return $nodeList->first(); |
||
53 | } |
||
54 | |||
55 | 1 | return null; |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | 1 | public function parent() { |
|
62 | 1 | return null; |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | 1 | public function parents() { |
|
69 | 1 | return $this->newNodeList(); |
|
70 | } |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function replaceWith($newNode): self { |
||
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | 1 | public function _clone() { |
|
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | 2 | public function getHtml(): string { |
|
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | 140 | public function setHtml($html): self { |
|
126 | } |
||
127 |
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: