Skip to content

Commit ff7287d

Browse files
author
Oleksii Korshenko
committed
MAGETWO-67612: Fixed coding standard violations in the Framework\Config namespace #9328
- Merge Pull Request #9328 from dverkade/magento2:Fix_coding_standard_in_Framework-Config
2 parents 53a4af4 + 776efe6 commit ff7287d

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

lib/internal/Magento/Framework/Config/Dom.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* Magento configuration XML DOM utility
119
*/
@@ -120,7 +118,7 @@ public function __construct(
120118
/**
121119
* Retrieve array of xml errors
122120
*
123-
* @param $errorFormat
121+
* @param string $errorFormat
124122
* @return string[]
125123
*/
126124
private static function getXmlErrors($errorFormat)
@@ -171,15 +169,10 @@ protected function _mergeNode(\DOMElement $node, $parentPath)
171169
/* Update matched node attributes and value */
172170
if ($matchedNode) {
173171
//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)
183176
) {
184177
$parentMatchedNode = $this->_getMatchedNode($parentPath);
185178
$newNode = $this->dom->importNode($node, true);
@@ -247,7 +240,7 @@ protected function _mergeAttributes($baseNode, $mergeNode)
247240
*/
248241
protected function _getNodePathByParent(\DOMElement $node, $parentPath)
249242
{
250-
$prefix = is_null($this->rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':';
243+
$prefix = $this->rootNamespace === null ? '' : self::ROOT_NAMESPACE_PREFIX . ':';
251244
$path = $parentPath . '/' . $prefix . $node->tagName;
252245
$idAttribute = $this->nodeMergingConfig->getIdAttribute($path);
253246
if (is_array($idAttribute)) {
@@ -441,7 +434,7 @@ public function setSchemaFile($schemaFile)
441434
*/
442435
private function _getAttributeName($attribute)
443436
{
444-
if (!is_null($attribute->prefix) && !empty($attribute->prefix)) {
437+
if ($attribute->prefix !== null && !empty($attribute->prefix)) {
445438
$attributeName = $attribute->prefix . ':' . $attribute->name;
446439
} else {
447440
$attributeName = $attribute->name;

lib/internal/Magento/Framework/Config/Test/Unit/Composer/PackageTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\Config\Test\Unit\Composer;
108

119
use \Magento\Framework\Config\Composer\Package;

lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\Config\Test\Unit;
108

119
class DataTest extends \PHPUnit_Framework_TestCase
1210
{
13-
/**
11+
/**
1412
* @var \Magento\Framework\Config\ReaderInterface|\PHPUnit_Framework_MockObject_MockObject
1513
*/
1614
private $readerMock;

0 commit comments

Comments
 (0)