Skip to content

Commit 91aaab5

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/2.3-develop' into MAGETWO-89776
2 parents 80f08d4 + 659c737 commit 91aaab5

File tree

49 files changed

+838
-58
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+838
-58
lines changed

app/code/Magento/Backend/Model/Widget/Grid/Parser.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ public function parseExpression($expression)
3030
$expression = trim($expression);
3131
foreach ($this->_operations as $operation) {
3232
$splittedExpr = preg_split('/\\' . $operation . '/', $expression, -1, PREG_SPLIT_DELIM_CAPTURE);
33-
if (count($splittedExpr) > 1) {
34-
for ($i = 0; $i < count($splittedExpr); $i++) {
33+
$count = count($splittedExpr);
34+
if ($count > 1) {
35+
for ($i = 0; $i < $count; $i++) {
3536
$stack = array_merge($stack, $this->parseExpression($splittedExpr[$i]));
3637
if ($i > 0) {
3738
$stack[] = $operation;

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,9 @@
159159
</argument>
160160
</arguments>
161161
</type>
162+
<type name="Magento\Framework\View\Layout\Generator\Block">
163+
<arguments>
164+
<argument name="defaultClass" xsi:type="string">Magento\Backend\Block\Template</argument>
165+
</arguments>
166+
</type>
162167
</config>

app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/FilterProcessor/ProductCategoryFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ProductCategoryFilter implements CustomFilterInterface
2121
*/
2222
public function apply(Filter $filter, AbstractDb $collection)
2323
{
24-
$conditionType = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
24+
$conditionType = $filter->getConditionType() ?: 'eq';
2525
$categoryFilter = [$conditionType => [$filter->getValue()]];
2626

2727
/** @var Collection $collection */

app/code/Magento/Catalog/Model/CategoryRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
129129
*/
130130
public function get($categoryId, $storeId = null)
131131
{
132-
$cacheKey = null !== $storeId ? $storeId : 'all';
132+
$cacheKey = $storeId ?? 'all';
133133
if (!isset($this->instances[$categoryId][$cacheKey])) {
134134
/** @var Category $category */
135135
$category = $this->categoryFactory->create();

app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ public function getMaxPrice()
282282
public function getPriorFilters($filterParams)
283283
{
284284
$priorFilters = [];
285-
for ($i = 1; $i < count($filterParams); ++$i) {
285+
$count = count($filterParams);
286+
for ($i = 1; $i < $count; ++$i) {
286287
$priorFilter = $this->validateFilter($filterParams[$i]);
287288
if ($priorFilter) {
288289
$priorFilters[] = $priorFilter;

app/code/Magento/Catalog/Model/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2006,7 +2006,7 @@ public function getIsVirtual()
20062006
*/
20072007
public function addCustomOption($code, $value, $product = null)
20082008
{
2009-
$product = $product ? $product : $this;
2009+
$product = $product ?: $this;
20102010
$option = $this->_itemOptionFactory->create()->addData(
20112011
['product_id' => $product->getId(), 'product' => $product, 'code' => $code, 'value' => $value]
20122012
);

app/code/Magento/Catalog/Model/Product/Option/Type/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function __construct(
127127
$this->mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA);
128128
$this->validatorInfo = $validatorInfo;
129129
$this->validatorFile = $validatorFile;
130-
$this->serializer = $serializer ? $serializer : ObjectManager::getInstance()->get(Json::class);
130+
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
131131
parent::__construct($checkoutSession, $scopeConfig, $data);
132132
}
133133

app/code/Magento/Catalog/Model/Product/ProductList/Toolbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ public function getLimit()
102102
public function getCurrentPage()
103103
{
104104
$page = (int) $this->request->getParam(self::PAGE_PARM_NAME);
105-
return $page ? $page : 1;
105+
return $page ?: 1;
106106
}
107107
}

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function getTierPrice($qty, $product)
341341
}
342342
}
343343

344-
return $prices ? $prices : [];
344+
return $prices ?: [];
345345
}
346346

347347
/**

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ protected function addFilterGroupToCollection(
740740
$fields = [];
741741
$categoryFilter = [];
742742
foreach ($filterGroup->getFilters() as $filter) {
743-
$conditionType = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
743+
$conditionType = $filter->getConditionType() ?: 'eq';
744744

745745
if ($filter->getField() == 'category_id') {
746746
$categoryFilter[$conditionType][] = $filter->getValue();

0 commit comments

Comments
 (0)