Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit a2f6a08

Browse files
author
Joan He
authored
Merge pull request #2365 from magento-engcom/libs-upgrade
MAGETWO-72139: Add support for PHP 7.2.x - Magento 2.3.0
2 parents 4874a83 + 3362a14 commit a2f6a08

File tree

385 files changed

+2005
-2018
lines changed

Some content is hidden

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

385 files changed

+2005
-2018
lines changed

.travis.yml

+11
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

+1-1
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": "*",
1111
"magento/module-backend": "*",

app/code/Magento/AdvancedPricingImportExport/composer.json

+1-1
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": "*",
1010
"magento/module-catalog": "*",
1111
"magento/module-catalog-import-export": "*",

app/code/Magento/AdvancedSearch/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"magento/module-customer": "*",
1414
"magento/module-search": "*",
1515
"magento/module-store": "*",
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
"license": [

app/code/Magento/Amqp/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/framework": "*",
99
"magento/framework-amqp": "*",
1010
"magento/framework-message-queue": "*",
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
"license": [

app/code/Magento/Analytics/composer.json

+1-1
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": "*",
77
"magento/module-config": "*",
88
"magento/module-integration": "*",

app/code/Magento/AsynchronousOperations/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"magento/module-backend": "*",
1212
"magento/module-ui": "*",
1313
"magento/module-user": "*",
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": "*",

app/code/Magento/Authorization/composer.json

+1-1
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": "*",
1010
"magento/module-backend": "*"
1111
},

app/code/Magento/Authorizenet/composer.json

+1-1
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": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-catalog": "*",

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

+7-3
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

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

+1-1
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": "*",
1010
"magento/module-backup": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/Backend/view/adminhtml/templates/widget/grid.phtml

+1-1
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

+1-1
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": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-cron": "*",

app/code/Magento/Braintree/composer.json

+2-2
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": "*",
1111
"magento/magento-composer-installer": "*",
1212
"magento/module-catalog": "*",

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

+4-3
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

+1-1
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": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/BundleGraphQl/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "N/A",
44
"type": "magento2-module",
55
"require": {
6-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
6+
"php": "~7.1.3||~7.2.0",
77
"magento/module-catalog": "*",
88
"magento/module-bundle": "*",
99
"magento/module-catalog-graph-ql": "*",

app/code/Magento/BundleImportExport/composer.json

+1-1
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": "*",
1010
"magento/module-bundle": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/CacheInvalidate/composer.json

+1-1
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": "*",
1010
"magento/module-page-cache": "*"
1111
},

app/code/Magento/Captcha/composer.json

+1-1
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": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-checkout": "*",

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

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

+2-1
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/ResourceModel/AbstractResource.php

+1-1
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/ProductTest.php

+16-16
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@ protected function setUp()
330330

331331
$this->mediaGalleryEntryFactoryMock =
332332
$this->getMockBuilder(\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterfaceFactory::class)
333-
->setMethods(['create'])
334-
->disableOriginalConstructor()
335-
->getMock();
333+
->setMethods(['create'])
334+
->disableOriginalConstructor()
335+
->getMock();
336336

337337
$this->metadataServiceMock = $this->createMock(\Magento\Catalog\Api\ProductAttributeRepositoryInterface::class);
338338
$this->attributeValueFactory = $this->getMockBuilder(\Magento\Framework\Api\AttributeValueFactory::class)
@@ -1171,19 +1171,19 @@ public function testSetMediaGalleryEntries()
11711171
];
11721172

11731173
$entryMock = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class)
1174-
->setMethods(
1175-
[
1176-
'getId',
1177-
'getFile',
1178-
'getLabel',
1179-
'getPosition',
1180-
'isDisabled',
1181-
'types',
1182-
'getContent',
1183-
'getMediaType'
1184-
]
1185-
)
1186-
->getMockForAbstractClass();
1174+
->setMethods(
1175+
[
1176+
'getId',
1177+
'getFile',
1178+
'getLabel',
1179+
'getPosition',
1180+
'isDisabled',
1181+
'types',
1182+
'getContent',
1183+
'getMediaType'
1184+
]
1185+
)
1186+
->getMockForAbstractClass();
11871187

11881188
$result = [
11891189
'value_id' => 1,

app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/AbstractTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function _getAttributes()
2525
foreach ($codes as $code) {
2626
$mock = $this->createPartialMock(
2727
\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class,
28-
['isInSet', 'getBackend', '__wakeup']
28+
['isInSet', 'getApplyTo', 'getBackend', '__wakeup']
2929
);
3030

3131
$mock->setAttributeId($code);

app/code/Magento/Catalog/composer.json

+1-1
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": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-catalog-inventory": "*",

app/code/Magento/CatalogAnalytics/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-catalog-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/framework": "*",
77
"magento/module-catalog": "*"
88
},

app/code/Magento/CatalogGraphQl/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "N/A",
44
"type": "magento2-module",
55
"require": {
6-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
6+
"php": "~7.1.3||~7.2.0",
77
"magento/module-eav": "*",
88
"magento/module-catalog": "*",
99
"magento/module-catalog-inventory": "*",

app/code/Magento/CatalogImportExport/composer.json

+1-1
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
"ext-ctype": "*",
1010
"magento/framework": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/CatalogInventory/composer.json

+1-1
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": "*",
1010
"magento/module-catalog": "*",
1111
"magento/module-config": "*",

app/code/Magento/CatalogRule/composer.json

+1-1
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": "*",
1010
"magento/module-backend": "*",
1111
"magento/module-catalog": "*",

app/code/Magento/CatalogRuleConfigurable/composer.json

+1-1
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": "*",
1010
"magento/magento-composer-installer": "*",
1111
"magento/module-catalog": "*",

0 commit comments

Comments
 (0)