Skip to content

Commit 0a882d1

Browse files
author
Joan He
committed
Merge remote-tracking branch 'engcom/libs-upgrade' into 94-eliminate-zend-service-dependency
2 parents d5aec16 + 4c28437 commit 0a882d1

File tree

418 files changed

+2862
-2061
lines changed

Some content is hidden

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

418 files changed

+2862
-2061
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
language: php
1818
php:
1919
- 7.1
20+
- 7.2
2021
env:
2122
global:
2223
- COMPOSER_BIN_DIR=~/bin
@@ -32,6 +33,16 @@ env:
3233
- TEST_SUITE=integration INTEGRATION_INDEX=2
3334
- TEST_SUITE=integration INTEGRATION_INDEX=3
3435
- TEST_SUITE=functional
36+
matrix:
37+
exclude:
38+
- php: 7.1
39+
env: TEST_SUITE=static
40+
- php: 7.1
41+
env: TEST_SUITE=js GRUNT_COMMAND=spec
42+
- php: 7.1
43+
env: TEST_SUITE=js GRUNT_COMMAND=static
44+
- php: 7.1
45+
env: TEST_SUITE=functional
3546
cache:
3647
apt: true
3748
directories:

app/code/Magento/AdminNotification/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"lib-libxml": "*",
1010
"magento/framework": "100.3.*",
1111
"magento/module-backend": "100.3.*",

app/code/Magento/AdvancedPricingImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "100.3.*",
1010
"magento/module-catalog": "101.2.*",
1111
"magento/module-catalog-import-export": "100.3.*",

app/code/Magento/AdvancedSearch/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"magento/module-customer": "100.3.*",
1414
"magento/module-search": "100.3.*",
1515
"magento/module-store": "100.3.*",
16-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0"
16+
"php": "~7.1.3||~7.2.0"
1717
},
1818
"type": "magento2-module",
1919
"version": "100.3.0-dev",

app/code/Magento/Amqp/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/framework": "100.3.*",
99
"magento/framework-amqp": "100.1.*",
1010
"magento/framework-message-queue": "100.3.*",
11-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0"
11+
"php": "~7.1.3||~7.2.0"
1212
},
1313
"type": "magento2-module",
1414
"version": "100.3.0-dev",

app/code/Magento/Analytics/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-analytics",
33
"description": "N/A",
44
"require": {
5-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
5+
"php": "~7.1.3||~7.2.0",
66
"magento/module-backend": "100.3.*",
77
"magento/module-config": "100.3.*",
88
"magento/module-integration": "100.3.*",

app/code/Magento/AsynchronousOperations/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"magento/module-backend": "100.3.*",
1212
"magento/module-ui": "100.3.*",
1313
"magento/module-user": "100.3.*",
14-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0"
14+
"php": "~7.1.3||~7.2.0"
1515
},
1616
"suggest": {
1717
"magento/module-admin-notification": "100.3.*",

app/code/Magento/Authorization/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "100.3.*",
1010
"magento/module-backend": "100.3.*"
1111
},

app/code/Magento/Authorizenet/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "100.3.*",
1010
"magento/module-backend": "100.3.*",
1111
"magento/module-catalog": "101.2.*",

app/code/Magento/Backend/Block/Menu.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ protected function _addSubMenu($menuItem, $level, $limit, $id = null)
352352
return $output;
353353
}
354354
$output .= '<div class="submenu"' . ($level == 0 && isset($id) ? ' aria-labelledby="' . $id . '"' : '') . '>';
355-
$colStops = null;
355+
$colStops = [];
356356
if ($level == 0 && $limit) {
357357
$colStops = $this->_columnBrake($menuItem->getChildren(), $limit);
358358
$output .= '<strong class="submenu-title">' . $this->_getAnchorLabel($menuItem) . '</strong>';
@@ -387,7 +387,11 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
387387
$itemName = substr($menuId, strrpos($menuId, '::') + 2);
388388
$itemClass = str_replace('_', '-', strtolower($itemName));
389389

390-
if (count($colBrakes) && $colBrakes[$itemPosition]['colbrake'] && $itemPosition != 1) {
390+
if (is_array($colBrakes)
391+
&& count($colBrakes)
392+
&& $colBrakes[$itemPosition]['colbrake']
393+
&& $itemPosition != 1
394+
) {
391395
$output .= '</ul></li><li class="column"><ul role="menu">';
392396
}
393397

@@ -401,7 +405,7 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
401405
$itemPosition++;
402406
}
403407

404-
if (count($colBrakes) && $limit) {
408+
if (is_array($colBrakes) && count($colBrakes) && $limit) {
405409
$output = '<li class="column"><ul role="menu">' . $output . '</ul></li>';
406410
}
407411

app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ public function getRowUrl($item)
258258
*/
259259
public function getMultipleRows($item)
260260
{
261-
return $item->getChildren();
261+
$children = $item->getChildren();
262+
return $children ?: [];
262263
}
263264

264265
/**

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/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "100.3.*",
1010
"magento/module-backup": "100.3.*",
1111
"magento/module-catalog": "101.2.*",

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/Backend/view/adminhtml/templates/widget/grid.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
*/
2121
/* @var $block \Magento\Backend\Block\Widget\Grid */
22-
$numColumns = sizeof($block->getColumns());
22+
$numColumns = !is_null($block->getColumns()) ? sizeof($block->getColumns()) : 0;
2323
?>
2424
<?php if ($block->getCollection()): ?>
2525

app/code/Magento/Backup/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "100.3.*",
1010
"magento/module-backend": "100.3.*",
1111
"magento/module-cron": "100.3.*",

app/code/Magento/Braintree/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
9-
"braintree/braintree_php": "3.22.0",
8+
"php": "~7.1.3||~7.2.0",
9+
"braintree/braintree_php": "3.28.0",
1010
"magento/framework": "100.3.*",
1111
"magento/magento-composer-installer": "*",
1212
"magento/module-catalog": "101.2.*",

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
706706

707707
$selections = $this->mergeSelectionsWithOptions($options, $selections);
708708
}
709-
if (count($selections) > 0 || !$isStrictProcessMode) {
709+
if ((is_array($selections) && count($selections) > 0) || !$isStrictProcessMode) {
710710
$uniqueKey = [$product->getId()];
711711
$selectionIds = [];
712712
$qtys = $buyRequest->getBundleOptionQty();
@@ -1322,8 +1322,9 @@ protected function checkIsResult($_result)
13221322
protected function mergeSelectionsWithOptions($options, $selections)
13231323
{
13241324
foreach ($options as $option) {
1325-
if ($option->getRequired() && count($option->getSelections()) == 1) {
1326-
$selections = array_merge($selections, $option->getSelections());
1325+
$optionSelections = $option->getSelections();
1326+
if ($option->getRequired() && is_array($optionSelections) && count($optionSelections) == 1) {
1327+
$selections = array_merge($selections, $optionSelections);
13271328
} else {
13281329
$selections = [];
13291330
break;

app/code/Magento/Bundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "100.3.*",
1010
"magento/module-backend": "100.3.*",
1111
"magento/module-catalog": "101.2.*",

app/code/Magento/BundleGraphQl/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "magento2-module",
55
"version": "100.0.0-dev",
66
"require": {
7-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
7+
"php": "~7.1.3||~7.2.0",
88
"magento/module-catalog": "101.2.*",
99
"magento/module-bundle": "100.3.*",
1010
"magento/module-catalog-graph-ql": "100.0.*",

app/code/Magento/BundleImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "100.3.*",
1010
"magento/module-bundle": "100.3.*",
1111
"magento/module-catalog": "101.2.*",

app/code/Magento/CacheInvalidate/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "100.3.*",
1010
"magento/module-page-cache": "100.3.*"
1111
},

app/code/Magento/Captcha/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
8+
"php": "~7.1.3||~7.2.0",
99
"magento/framework": "100.3.*",
1010
"magento/module-backend": "100.3.*",
1111
"magento/module-checkout": "100.3.*",

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/Decimal.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getRange(FilterInterface $filter)
5656
$index = 1;
5757
do {
5858
$range = pow(10, strlen(floor($maxValue)) - $index);
59-
$items = $this->getRangeItemCounts($range, $filter);
59+
$items = $this->getRangeItemCounts($range, $filter) ?: [];
6060
$index++;
6161
} while ($range > self::MIN_RANGE_POWER && count($items) < 2);
6262
$this->range = $range;
@@ -109,7 +109,7 @@ public function getMinValue(FilterInterface $filter)
109109
*
110110
* @param int $range
111111
* @param FilterInterface $filter
112-
* @return mixed
112+
* @return array
113113
*/
114114
public function getRangeItemCounts($range, FilterInterface $filter)
115115
{

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/Option/Type/Select.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public function validateUserValue($values)
7171
}
7272
if (!$this->_isSingleSelection()) {
7373
$valuesCollection = $option->getOptionValuesByOptionId($value, $this->getProduct()->getStoreId())->load();
74-
if ($valuesCollection->count() != count($value)) {
74+
$valueCount = is_array($value) ? count($value) : 1;
75+
if ($valuesCollection->count() != $valueCount) {
7576
$this->setIsValid(false);
7677
throw new LocalizedException(
7778
__(

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();

app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getDefaultStoreId()
7878
*/
7979
protected function _isApplicableAttribute($object, $attribute)
8080
{
81-
$applyTo = $attribute->getApplyTo();
81+
$applyTo = $attribute->getApplyTo() ?: [];
8282
return (count($applyTo) == 0 || in_array($object->getTypeId(), $applyTo))
8383
&& $attribute->isInSet($object->getAttributeSetId());
8484
}

app/code/Magento/Catalog/Test/Unit/Model/Api/SearchCriteria/CollectionProcessor/FilterProcessor/ProductCategoryFilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testApply()
3131
->disableOriginalConstructor()
3232
->getMock();
3333

34-
$filterMock->expects($this->exactly(2))
34+
$filterMock->expects($this->exactly(1))
3535
->method('getConditionType')
3636
->willReturn('condition');
3737
$filterMock->expects($this->once())

0 commit comments

Comments
 (0)