@@ -44,7 +44,7 @@ public function extend($source, $overwrite = false)
44
44
return $ this ;
45
45
}
46
46
47
- foreach ($ this -> getChildren ($ source ) as $ namespace => $ children ) {
47
+ foreach (self :: _getChildren ($ source ) as $ namespace => $ children ) {
48
48
foreach ($ children as $ child ) {
49
49
$ this ->extendChild ($ child , $ overwrite , $ namespace );
50
50
}
@@ -70,7 +70,7 @@ public function extendChild($source, $overwrite = false, $elmNamespace = '')
70
70
$ sourceName = $ source ->getName ();
71
71
72
72
// here we have children of our source node
73
- $ sourceChildren = $ this -> getChildren ($ source );
73
+ $ sourceChildren = self :: _getChildren ($ source );
74
74
75
75
if ($ elmNamespace == '' ) {
76
76
$ elmNamespace = null ;
@@ -81,7 +81,7 @@ public function extendChild($source, $overwrite = false, $elmNamespace = '')
81
81
$ elm = $ this ->getElementByName ($ source , $ elmNamespace );
82
82
if (!is_null ($ elm )) {
83
83
// if target already has children return without regard
84
- if ($ this -> getChildren ($ elm )) {
84
+ if (self :: _getChildren ($ elm )) {
85
85
return $ this ;
86
86
}
87
87
if ($ overwrite ) {
@@ -170,13 +170,24 @@ public function getAttributes($source, $namespace = null)
170
170
return $ attributes ;
171
171
}
172
172
173
+ /**
174
+ * @deprecated due to conflict with PHP8 parent class update
175
+ * @param Varien_Simplexml_Element $source
176
+ * @return array
177
+ */
178
+ public function getChildren ($ source = null )
179
+ {
180
+ Mage::log ('Use of deprecated method: ' .__METHOD__ );
181
+ return self ::_getChildren ($ source );
182
+ }
183
+
173
184
/**
174
185
* Return children of all namespaces
175
186
*
176
187
* @param Varien_Simplexml_Element $source
177
188
* @return array
178
189
*/
179
- public function getChildren ($ source )
190
+ protected static function _getChildren ($ source )
180
191
{
181
192
$ children = array ();
182
193
$ namespaces = $ source ->getNamespaces (true );
@@ -200,12 +211,12 @@ public function getChildren($source)
200
211
*/
201
212
public function hasChildren ()
202
213
{
203
- if (!$ this -> getChildren ($ this )) {
214
+ if (!self :: _getChildren ($ this )) {
204
215
return false ;
205
216
}
206
217
207
218
// simplexml bug: @attributes is in children() but invisible in foreach
208
- foreach ($ this -> getChildren ($ this ) as $ namespace => $ children ) {
219
+ foreach (self :: _getChildren ($ this ) as $ namespace => $ children ) {
209
220
foreach ($ children as $ k => $ child ) {
210
221
return true ;
211
222
}
0 commit comments