|
4 | 4 | * See COPYING.txt for license details.
|
5 | 5 | */
|
6 | 6 |
|
7 |
| -// @codingStandardsIgnoreFile |
8 |
| - |
9 | 7 | /**
|
10 | 8 | * Magento configuration XML DOM utility
|
11 | 9 | */
|
@@ -120,7 +118,7 @@ public function __construct(
|
120 | 118 | /**
|
121 | 119 | * Retrieve array of xml errors
|
122 | 120 | *
|
123 |
| - * @param $errorFormat |
| 121 | + * @param string $errorFormat |
124 | 122 | * @return string[]
|
125 | 123 | */
|
126 | 124 | private static function getXmlErrors($errorFormat)
|
@@ -171,15 +169,10 @@ protected function _mergeNode(\DOMElement $node, $parentPath)
|
171 | 169 | /* Update matched node attributes and value */
|
172 | 170 | if ($matchedNode) {
|
173 | 171 | //different node type
|
174 |
| - if ($this->typeAttributeName && $node->hasAttribute( |
175 |
| - $this->typeAttributeName |
176 |
| - ) && $matchedNode->hasAttribute( |
177 |
| - $this->typeAttributeName |
178 |
| - ) && $node->getAttribute( |
179 |
| - $this->typeAttributeName |
180 |
| - ) !== $matchedNode->getAttribute( |
181 |
| - $this->typeAttributeName |
182 |
| - ) |
| 172 | + if ($this->typeAttributeName && |
| 173 | + $node->hasAttribute($this->typeAttributeName) && |
| 174 | + $matchedNode->hasAttribute($this->typeAttributeName) && |
| 175 | + $node->getAttribute($this->typeAttributeName) !== $matchedNode->getAttribute($this->typeAttributeName) |
183 | 176 | ) {
|
184 | 177 | $parentMatchedNode = $this->_getMatchedNode($parentPath);
|
185 | 178 | $newNode = $this->dom->importNode($node, true);
|
@@ -247,7 +240,7 @@ protected function _mergeAttributes($baseNode, $mergeNode)
|
247 | 240 | */
|
248 | 241 | protected function _getNodePathByParent(\DOMElement $node, $parentPath)
|
249 | 242 | {
|
250 |
| - $prefix = is_null($this->rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; |
| 243 | + $prefix = $this->rootNamespace === null ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; |
251 | 244 | $path = $parentPath . '/' . $prefix . $node->tagName;
|
252 | 245 | $idAttribute = $this->nodeMergingConfig->getIdAttribute($path);
|
253 | 246 | if (is_array($idAttribute)) {
|
@@ -441,7 +434,7 @@ public function setSchemaFile($schemaFile)
|
441 | 434 | */
|
442 | 435 | private function _getAttributeName($attribute)
|
443 | 436 | {
|
444 |
| - if (!is_null($attribute->prefix) && !empty($attribute->prefix)) { |
| 437 | + if ($attribute->prefix !== null && !empty($attribute->prefix)) { |
445 | 438 | $attributeName = $attribute->prefix . ':' . $attribute->name;
|
446 | 439 | } else {
|
447 | 440 | $attributeName = $attribute->name;
|
|
0 commit comments