Skip to content

Commit fe2cdc1

Browse files
committed
Fixed coding standard violations in the Framework\Config namespace, so that it will be checked bij PHP CS and no longer be ignored while doing CI checks. Made the following changes:
- Removed @codingStandardsIgnoreFile at the head of the files - Fixed indentation - Changed is_null call to the === null compare
1 parent d5f2939 commit fe2cdc1

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

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

Lines changed: 11 additions & 13 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)
@@ -172,14 +170,14 @@ protected function _mergeNode(\DOMElement $node, $parentPath)
172170
if ($matchedNode) {
173171
//different node type
174172
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-
)
173+
$this->typeAttributeName
174+
) && $matchedNode->hasAttribute(
175+
$this->typeAttributeName
176+
) && $node->getAttribute(
177+
$this->typeAttributeName
178+
) !== $matchedNode->getAttribute(
179+
$this->typeAttributeName
180+
)
183181
) {
184182
$parentMatchedNode = $this->_getMatchedNode($parentPath);
185183
$newNode = $this->dom->importNode($node, true);
@@ -247,7 +245,7 @@ protected function _mergeAttributes($baseNode, $mergeNode)
247245
*/
248246
protected function _getNodePathByParent(\DOMElement $node, $parentPath)
249247
{
250-
$prefix = is_null($this->rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':';
248+
$prefix = $this->rootNamespace === null ? '' : self::ROOT_NAMESPACE_PREFIX . ':';
251249
$path = $parentPath . '/' . $prefix . $node->tagName;
252250
$idAttribute = $this->nodeMergingConfig->getIdAttribute($path);
253251
if (is_array($idAttribute)) {
@@ -441,7 +439,7 @@ public function setSchemaFile($schemaFile)
441439
*/
442440
private function _getAttributeName($attribute)
443441
{
444-
if (!is_null($attribute->prefix) && !empty($attribute->prefix)) {
442+
if ($attribute->prefix !== null && !empty($attribute->prefix)) {
445443
$attributeName = $attribute->prefix . ':' . $attribute->name;
446444
} else {
447445
$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: 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;
108

119
class DataTest extends \PHPUnit_Framework_TestCase

0 commit comments

Comments
 (0)