Skip to content

Commit

Permalink
MAGETWO-67558: Fixed coding standard violations in all Factory classe…
Browse files Browse the repository at this point in the history
…s located in app/code #9304
  • Loading branch information
Oleksii Korshenko authored Apr 19, 2017
2 parents 1139167 + 1f80e47 commit 43b12f0
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 34 deletions.
2 changes: 0 additions & 2 deletions app/code/Magento/Catalog/Model/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Model factory
*/
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\Catalog\Model\Layer\Filter\Dynamic;

use Magento\Framework\App\Config\ScopeConfigInterface;
Expand Down Expand Up @@ -48,8 +46,11 @@ class AlgorithmFactory
* @param ScopeConfigInterface $scopeConfig
* @param array $algorithms
*/
public function __construct(ObjectManagerInterface $objectManager, ScopeConfigInterface $scopeConfig, array $algorithms)
{
public function __construct(
ObjectManagerInterface $objectManager,
ScopeConfigInterface $scopeConfig,
array $algorithms
) {
$this->objectManager = $objectManager;
$this->scopeConfig = $scopeConfig;
$this->algorithms = $algorithms;
Expand All @@ -64,7 +65,10 @@ public function __construct(ObjectManagerInterface $objectManager, ScopeConfigIn
*/
public function create(array $data = [])
{
$calculationType = $this->scopeConfig->getValue(self::XML_PATH_RANGE_CALCULATION, ScopeInterface::SCOPE_STORE);
$calculationType = $this->scopeConfig->getValue(
self::XML_PATH_RANGE_CALCULATION,
ScopeInterface::SCOPE_STORE
);

if (!isset($this->algorithms[$calculationType])) {
throw new LocalizedException(__('%1 was not found in algorithms', $calculationType));
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/Catalog/Model/Template/Filter/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Template filter factory
*/
Expand Down
20 changes: 8 additions & 12 deletions app/code/Magento/Customer/Model/Metadata/ElementFactory.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
<?php
/**
* Customer Form Element Factory
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Customer Form Element Factory
*/
namespace Magento\Customer\Model\Metadata;

class ElementFactory
{
const OUTPUT_FORMAT_JSON = 'json';

const OUTPUT_FORMAT_TEXT = 'text';

const OUTPUT_FORMAT_HTML = 'html';

const OUTPUT_FORMAT_PDF = 'pdf';

const OUTPUT_FORMAT_ONELINE = 'oneline';

const OUTPUT_FORMAT_ARRAY = 'array';

// available only for multiply attributes
Expand All @@ -40,8 +34,10 @@ class ElementFactory
* @param \Magento\Framework\ObjectManagerInterface $objectManager
* @param \Magento\Framework\Stdlib\StringUtils $string
*/
public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, \Magento\Framework\Stdlib\StringUtils $string)
{
public function __construct(
\Magento\Framework\ObjectManagerInterface $objectManager,
\Magento\Framework\Stdlib\StringUtils $string
) {
$this->_objectManager = $objectManager;
$this->_string = $string;
}
Expand All @@ -64,7 +60,7 @@ public function create(
$dataModelClass = $attribute->getDataModel();
$params = [
'entityTypeCode' => $entityTypeCode,
'value' => is_null($value) ? false : $value,
'value' => $value === null ? false : $value,
'isAjax' => $isAjax,
'attribute' => $attribute,
];
Expand Down
7 changes: 0 additions & 7 deletions app/code/Magento/Eav/Model/AttributeDataFactory.php
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\Eav\Model;

/**
Expand All @@ -16,15 +14,10 @@
class AttributeDataFactory
{
const OUTPUT_FORMAT_JSON = 'json';

const OUTPUT_FORMAT_TEXT = 'text';

const OUTPUT_FORMAT_HTML = 'html';

const OUTPUT_FORMAT_PDF = 'pdf';

const OUTPUT_FORMAT_ONELINE = 'oneline';

const OUTPUT_FORMAT_ARRAY = 'array';

// available only for multiply attributes
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

/**
* Export entity factory
*/
Expand All @@ -30,7 +28,7 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan

/**
* @param string $className
* @return \Magento\ImportExport\Model\Export\Entity\AbstractEntity|\Magento\ImportExport\Model\Export\AbstractEntity
* @return AbstractEntity|\Magento\ImportExport\Model\Export\AbstractEntity
* @throws \InvalidArgumentException
*/
public function create($className)
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

/**
* Import entity factory
*/
Expand All @@ -30,7 +28,7 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan

/**
* @param string $className
* @return \Magento\ImportExport\Model\Import\Entity\AbstractEntity|\Magento\ImportExport\Model\Import\AbstractEntity
* @return AbstractEntity|\Magento\ImportExport\Model\Import\AbstractEntity
* @throws \InvalidArgumentException
*/
public function create($className)
Expand Down

0 comments on commit 43b12f0

Please sign in to comment.