@@ -30,11 +30,12 @@ class Element extends \SimpleXMLElement
30
30
* @param \Magento\Framework\Simplexml\Element $element
31
31
* @return void
32
32
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
33
+ * phpcs:disable Magento2.CodeAnalysis.EmptyBlock
33
34
*/
34
35
public function setParent ($ element )
35
36
{
36
- //$this->_parent = $element;
37
37
}
38
+ // phpcs:enable
38
39
39
40
/**
40
41
* Returns parent node for the element
@@ -179,7 +180,8 @@ public function asArray()
179
180
}
180
181
181
182
/**
182
- * asArray() analog, but without attributes
183
+ * The asArray() analog, but without attributes
184
+ *
183
185
* @return array|string
184
186
*/
185
187
public function asCanonicalArray ()
@@ -245,7 +247,7 @@ public function asNiceXml($filename = '', $level = 0)
245
247
$ attributes = $ this ->attributes ();
246
248
if ($ attributes ) {
247
249
foreach ($ attributes as $ key => $ value ) {
248
- $ out .= ' ' . $ key . '=" ' . str_replace ('" ' , '\" ' , ( string ) $ value ) . '" ' ;
250
+ $ out .= ' ' . $ key . '=" ' . str_replace ('" ' , '\" ' , $ this -> xmlentities ( $ value) ) . '" ' ;
249
251
}
250
252
}
251
253
@@ -471,6 +473,7 @@ public function setNode($path, $value, $overwrite = true)
471
473
* Unset self from the XML-node tree
472
474
*
473
475
* Note: trying to refer this object as a variable after "unsetting" like this will result in E_WARNING
476
+ *
474
477
* @return void
475
478
*/
476
479
public function unsetSelf ()
0 commit comments