1 | <?php |
||
21 | class XmlDifferenceService |
||
22 | { |
||
23 | use PropertiesDifferenceTrait; |
||
24 | |||
25 | /** |
||
26 | * @var XmlConvertibleInterface |
||
27 | */ |
||
28 | protected $source; |
||
29 | |||
30 | /** |
||
31 | * @var XmlConvertibleInterface |
||
32 | */ |
||
33 | protected $target; |
||
34 | |||
35 | |||
36 | /** |
||
37 | * XmlDifferenceService constructor. |
||
38 | * @param XmlConvertibleInterface $source |
||
39 | * @param XmlConvertibleInterface $target |
||
40 | */ |
||
41 | 4 | public function __construct( |
|
50 | |||
51 | /** |
||
52 | * @return XmlConvertibleInterface|null |
||
53 | */ |
||
54 | 4 | public function difference() |
|
70 | |||
71 | /** |
||
72 | * Difference by element name, children count and properties |
||
73 | */ |
||
74 | 4 | public function getIsCommonDifferent() |
|
80 | |||
81 | /** |
||
82 | * @return array |
||
83 | */ |
||
84 | 2 | public function getDifferentChildren() |
|
98 | |||
99 | /** |
||
100 | * @param XmlConvertibleInterface|\DOMNode|\DOMDocument $object |
||
101 | * @return XmlConvertibleInterface |
||
102 | */ |
||
103 | 2 | protected function transform($object) |
|
109 | |||
110 | /** |
||
111 | * @param XmlConvertibleInterface $child |
||
112 | * @return XmlConvertibleInterface|null |
||
113 | */ |
||
114 | 2 | protected function findDifference( |
|
128 | |||
129 | /** |
||
130 | * @return XmlConvertibleInterface |
||
131 | */ |
||
132 | 4 | public function getSource(): XmlConvertibleInterface |
|
136 | |||
137 | /** |
||
138 | * @param XmlConvertibleInterface $source |
||
139 | * @return $this |
||
140 | */ |
||
141 | 4 | public function setSource(XmlConvertibleInterface $source) |
|
147 | |||
148 | /** |
||
149 | * @return XmlConvertibleInterface |
||
150 | */ |
||
151 | 4 | public function getTarget(): XmlConvertibleInterface |
|
155 | |||
156 | /** |
||
157 | * @param XmlConvertibleInterface $target |
||
158 | * @return $this |
||
159 | */ |
||
160 | 4 | public function setTarget(XmlConvertibleInterface $target) |
|
166 | } |
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: