Skip to content

Commit

Permalink
Using an alias for attribute code validator
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard13 committed Jan 24, 2019
1 parent adb1a8f commit 3c8acbb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/code/Magento/Eav/Model/Entity/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
namespace Magento\Eav\Model\Entity;

use Magento\Eav\Model\Validator\Attribute\Code;
use Magento\Eav\Model\Validator\Attribute\Code as AttributeCodeValidator;
use Magento\Framework\Api\AttributeValueFactory;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Exception\LocalizedException;
Expand Down Expand Up @@ -83,7 +83,7 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im
protected $dateTimeFormatter;

/**
* @var Code|null
* @var AttributeCodeValidator|null
*/
private $attributeCodeValidator;

Expand All @@ -106,7 +106,7 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im
* @param DateTimeFormatterInterface $dateTimeFormatter
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param Code|null $attributeCodeValidator
* @param AttributeCodeValidator|null $attributeCodeValidator
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @codeCoverageIgnore
Expand All @@ -131,7 +131,7 @@ public function __construct(
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = [],
Code $attributeCodeValidator = null
AttributeCodeValidator $attributeCodeValidator = null
) {
parent::__construct(
$context,
Expand All @@ -155,7 +155,7 @@ public function __construct(
$this->reservedAttributeList = $reservedAttributeList;
$this->dateTimeFormatter = $dateTimeFormatter;
$this->attributeCodeValidator = $attributeCodeValidator ?: ObjectManager::getInstance()->get(
Code::class
AttributeCodeValidator::class
);
}

Expand Down

0 comments on commit 3c8acbb

Please sign in to comment.