Skip to content

Commit

Permalink
Fix issue 26449: Fix code standard
Browse files Browse the repository at this point in the history
  • Loading branch information
tna274 committed Mar 20, 2020
1 parent 3b6b038 commit 19ceb3a
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Magento\Framework\Indexer\ActionInterface;
use Magento\ConfigurableProduct\Api\Data\OptionInterface;
use Magento\Catalog\Api\Data\ProductAttributeInterface;
use Magento\Framework\App\ObjectManager;

/**
* Plugin product resource model
Expand Down Expand Up @@ -55,15 +56,18 @@ class Product
public function __construct(
Configurable $configurable,
ActionInterface $productIndexer,
ProductAttributeRepositoryInterface $productAttributeRepository,
\Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
\Magento\Framework\Api\FilterBuilder $filterBuilder
ProductAttributeRepositoryInterface $productAttributeRepository = null,
\Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder = null,
\Magento\Framework\Api\FilterBuilder $filterBuilder = null
) {
$this->configurable = $configurable;
$this->productIndexer = $productIndexer;
$this->productAttributeRepository = $productAttributeRepository;
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
$this->filterBuilder = $filterBuilder;
$this->productAttributeRepository = $productAttributeRepository ?: ObjectManager::getInstance()
->get(ProductAttributeRepositoryInterface::class);
$this->searchCriteriaBuilder = $searchCriteriaBuilder ?: ObjectManager::getInstance()
->get(\Magento\Framework\Api\SearchCriteriaBuilder::class);
$this->filterBuilder = $filterBuilder ?: ObjectManager::getInstance()
->get(\Magento\Framework\Api\FilterBuilder::class);
}

/**
Expand Down

0 comments on commit 19ceb3a

Please sign in to comment.