Skip to content

Fixed coding standard violations in the Framework\Config namespace #9328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions lib/internal/Magento/Framework/Config/Dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Magento configuration XML DOM utility
*/
Expand Down Expand Up @@ -120,7 +118,7 @@ public function __construct(
/**
* Retrieve array of xml errors
*
* @param $errorFormat
* @param string $errorFormat
* @return string[]
*/
private static function getXmlErrors($errorFormat)
Expand Down Expand Up @@ -171,15 +169,10 @@ protected function _mergeNode(\DOMElement $node, $parentPath)
/* Update matched node attributes and value */
if ($matchedNode) {
//different node type
if ($this->typeAttributeName && $node->hasAttribute(
$this->typeAttributeName
) && $matchedNode->hasAttribute(
$this->typeAttributeName
) && $node->getAttribute(
$this->typeAttributeName
) !== $matchedNode->getAttribute(
$this->typeAttributeName
)
if ($this->typeAttributeName &&
$node->hasAttribute($this->typeAttributeName) &&
$matchedNode->hasAttribute($this->typeAttributeName) &&
$node->getAttribute($this->typeAttributeName) !== $matchedNode->getAttribute($this->typeAttributeName)
) {
$parentMatchedNode = $this->_getMatchedNode($parentPath);
$newNode = $this->dom->importNode($node, true);
Expand Down Expand Up @@ -247,7 +240,7 @@ protected function _mergeAttributes($baseNode, $mergeNode)
*/
protected function _getNodePathByParent(\DOMElement $node, $parentPath)
{
$prefix = is_null($this->rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':';
$prefix = $this->rootNamespace === null ? '' : self::ROOT_NAMESPACE_PREFIX . ':';
$path = $parentPath . '/' . $prefix . $node->tagName;
$idAttribute = $this->nodeMergingConfig->getIdAttribute($path);
if (is_array($idAttribute)) {
Expand Down Expand Up @@ -441,7 +434,7 @@ public function setSchemaFile($schemaFile)
*/
private function _getAttributeName($attribute)
{
if (!is_null($attribute->prefix) && !empty($attribute->prefix)) {
if ($attribute->prefix !== null && !empty($attribute->prefix)) {
$attributeName = $attribute->prefix . ':' . $attribute->name;
} else {
$attributeName = $attribute->name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Framework\Config\Test\Unit\Composer;

use \Magento\Framework\Config\Composer\Package;
Expand Down
4 changes: 1 addition & 3 deletions lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Framework\Config\Test\Unit;

class DataTest extends \PHPUnit_Framework_TestCase
{
/**
/**
* @var \Magento\Framework\Config\ReaderInterface|\PHPUnit_Framework_MockObject_MockObject
*/
private $readerMock;
Expand Down