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

Commit 91f0b53

Browse files
committed
Merge remote-tracking branch 'upstream/2.3-develop' into sku-uniqueness
2 parents b117089 + 89d8f80 commit 91f0b53

File tree

255 files changed

+4207
-891
lines changed

Some content is hidden

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

255 files changed

+4207
-891
lines changed

app/bootstrap.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
// Sets default autoload mappings, may be overridden in Bootstrap::create
3232
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);
3333

34-
require_once BP . '/app/functions.php';
35-
3634
/* Custom umask value may be provided in optional mage_umask file in root */
3735
$umaskFile = BP . '/magento_umask';
3836
$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;

app/code/Magento/Analytics/ReportXml/ReportProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(
5555
private function getIteratorName(Query $query)
5656
{
5757
$config = $query->getConfig();
58-
return isset($config['iterator']) ? $config['iterator'] : null;
58+
return $config['iterator'] ?? null;
5959
}
6060

6161
/**

app/code/Magento/Backend/App/DefaultPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public function __construct(\Magento\Backend\App\ConfigInterface $config)
4242
*/
4343
public function getPart($code)
4444
{
45-
return isset($this->_parts[$code]) ? $this->_parts[$code] : null;
45+
return $this->_parts[$code] ?? null;
4646
}
4747
}

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,23 @@ class Menu extends \Magento\Backend\Block\Template
7474
*/
7575
private $anchorRenderer;
7676

77+
/**
78+
* @var ConfigInterface
79+
*/
80+
private $routeConfig;
81+
7782
/**
7883
* @param Template\Context $context
7984
* @param \Magento\Backend\Model\UrlInterface $url
8085
* @param \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory
8186
* @param \Magento\Backend\Model\Auth\Session $authSession
8287
* @param \Magento\Backend\Model\Menu\Config $menuConfig
8388
* @param \Magento\Framework\Locale\ResolverInterface $localeResolver
89+
* @param \Magento\Framework\App\Route\ConfigInterface $routeConfig
8490
* @param array $data
8591
* @param MenuItemChecker|null $menuItemChecker
8692
* @param AnchorRenderer|null $anchorRenderer
93+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8794
*/
8895
public function __construct(
8996
\Magento\Backend\Block\Template\Context $context,
@@ -94,7 +101,8 @@ public function __construct(
94101
\Magento\Framework\Locale\ResolverInterface $localeResolver,
95102
array $data = [],
96103
MenuItemChecker $menuItemChecker = null,
97-
AnchorRenderer $anchorRenderer = null
104+
AnchorRenderer $anchorRenderer = null,
105+
\Magento\Framework\App\Route\ConfigInterface $routeConfig = null
98106
) {
99107
$this->_url = $url;
100108
$this->_iteratorFactory = $iteratorFactory;
@@ -103,6 +111,9 @@ public function __construct(
103111
$this->_localeResolver = $localeResolver;
104112
$this->menuItemChecker = $menuItemChecker;
105113
$this->anchorRenderer = $anchorRenderer;
114+
$this->routeConfig = $routeConfig ?:
115+
\Magento\Framework\App\ObjectManager::getInstance()
116+
->get(\Magento\Framework\App\Route\ConfigInterface::class);
106117
parent::__construct($context, $data);
107118
}
108119

@@ -203,8 +214,9 @@ protected function _afterToHtml($html)
203214
*/
204215
protected function _callbackSecretKey($match)
205216
{
217+
$routeId = $this->routeConfig->getRouteByFrontName($match[1]);
206218
return \Magento\Backend\Model\UrlInterface::SECRET_KEY_PARAM_NAME . '/' . $this->_url->getSecretKey(
207-
$match[1],
219+
$routeId,
208220
$match[2],
209221
$match[3]
210222
);

app/code/Magento/Backend/Block/Widget/Button/ButtonList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ public function getItems()
127127
*/
128128
public function sortButtons(Item $itemA, Item $itemB)
129129
{
130-
$sortOrderA = intval($itemA->getSortOrder());
131-
$sortOrderB = intval($itemB->getSortOrder());
130+
$sortOrderA = (int) $itemA->getSortOrder();
131+
$sortOrderB = (int) $itemB->getSortOrder();
132132

133133
if ($sortOrderA == $sortOrderB) {
134134
return 0;

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Currency.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function render(\Magento\Framework\DataObject $row)
8282
{
8383
if ($data = (string)$this->_getValue($row)) {
8484
$currency_code = $this->_getCurrencyCode($row);
85-
$data = floatval($data) * $this->_getRate($row);
85+
$data = (float)$data * $this->_getRate($row);
8686
$sign = (bool)(int)$this->getColumn()->getShowNumberSign() && $data > 0 ? '+' : '';
8787
$data = sprintf("%f", $data);
8888
$data = $this->_localeCurrency->getCurrency($currency_code)->toCurrency($data);
@@ -118,10 +118,10 @@ protected function _getCurrencyCode($row)
118118
protected function _getRate($row)
119119
{
120120
if ($rate = $this->getColumn()->getRate()) {
121-
return floatval($rate);
121+
return (float)$rate;
122122
}
123123
if ($rate = $row->getData($this->getColumn()->getRateField())) {
124-
return floatval($rate);
124+
return (float)$rate;
125125
}
126126
return $this->_defaultBaseCurrency->getRate($this->_getCurrencyCode($row));
127127
}

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Price.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function render(\Magento\Framework\DataObject $row)
6060
return $data;
6161
}
6262

63-
$data = floatval($data) * $this->_getRate($row);
63+
$data = (float)$data * $this->_getRate($row);
6464
$data = sprintf("%f", $data);
6565
$data = $this->_localeCurrency->getCurrency($currencyCode)->toCurrency($data);
6666
return $data;
@@ -94,10 +94,10 @@ protected function _getCurrencyCode($row)
9494
protected function _getRate($row)
9595
{
9696
if ($rate = $this->getColumn()->getRate()) {
97-
return floatval($rate);
97+
return (float)$rate;
9898
}
9999
if ($rate = $row->getData($this->getColumn()->getRateField())) {
100-
return floatval($rate);
100+
return (float)$rate;
101101
}
102102
return 1;
103103
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function add(Item $item, $parentId = null, $index = null)
8383
}
8484
$parentItem->getChildren()->add($item, null, $index);
8585
} else {
86-
$index = intval($index);
86+
$index = (int) $index;
8787
if (!isset($this[$index])) {
8888
$this->offsetSet($index, $item);
8989
$this->_logger->info(

app/code/Magento/Backend/Model/Menu/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ public function getResult(\Magento\Backend\Model\Menu $menu)
102102
*/
103103
protected function _getParam($params, $paramName, $defaultValue = null)
104104
{
105-
return isset($params[$paramName]) ? $params[$paramName] : $defaultValue;
105+
return $params[$paramName] ?? $defaultValue;
106106
}
107107
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="AdminDashboardPage" url="admin/dashboard/" area="admin" module="Magento_Backend">
12+
<section name="AdminMenuSection"/>
13+
</page>
14+
</pages>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminMenuSection">
12+
<element name="catalog" type="button" selector="#menu-magento-catalog-catalog"/>
13+
<element name="customers" type="button" selector="#menu-magento-customer-customer"/>
14+
<element name="content" type="button" selector="#menu-magento-backend-content"/>
15+
<element name="widgets" type="button" selector="#nav li[data-ui-id='menu-magento-widget-cms-widget-instance']"/>
16+
<element name="stores" type="button" selector="#menu-magento-backend-stores"/>
17+
<element name="configuration" type="button" selector="#nav li[data-ui-id='menu-magento-config-system-config']"/>
18+
</section>
19+
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@
234234
<field id="destinations" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
235235
<label>Top destinations</label>
236236
<source_model>Magento\Directory\Model\Config\Source\Country</source_model>
237+
<can_be_empty>1</can_be_empty>
237238
</field>
238239
</group>
239240
<group id="locale" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="1">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ $numColumns = !is_null($block->getColumns()) ? sizeof($block->getColumns()) : 0;
107107
<?= /* @escapeNotVerified */ __('of %1', '<span>' . $block->getCollection()->getLastPageNumber() . '</span>') ?>
108108
</label>
109109
<?php if ($_curPage < $_lastPage): ?>
110-
<button title="<?= /* @escapeNotVerified */ __('Next page') ?>"
110+
<button type="button" title="<?= /* @escapeNotVerified */ __('Next page') ?>"
111111
class="action-next"
112112
onclick="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.setPage('<?= /* @escapeNotVerified */ ($_curPage + 1) ?>');return false;">
113113
<span><?= /* @escapeNotVerified */ __('Next page') ?></span>

app/code/Magento/Backup/Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function getBackupsDir()
110110
public function getExtensionByType($type)
111111
{
112112
$extensions = $this->getExtensions();
113-
return isset($extensions[$type]) ? $extensions[$type] : '';
113+
return $extensions[$type] ?? '';
114114
}
115115

116116
/**

app/code/Magento/Backup/Model/Config/Backend/Cron.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public function afterSave()
7676

7777
if ($enabled) {
7878
$cronExprArray = [
79-
intval($time[1]), # Minute
80-
intval($time[0]), # Hour
79+
(int) $time[1], # Minute
80+
(int) $time[0], # Hour
8181
$frequency == $frequencyMonthly ? '1' : '*', # Day of the Month
8282
'*', # Month of the Year
8383
$frequency == $frequencyWeekly ? '1' : '*', # Day of the Week

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
559559
*/
560560
public function prepareQuoteItemQty($qty, $product)
561561
{
562-
return intval($qty);
562+
return (int) $qty;
563563
}
564564

565565
/**

app/code/Magento/Bundle/Pricing/Price/BundleSelectionFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function create(
5454
) {
5555
$arguments['bundleProduct'] = $bundleProduct;
5656
$arguments['saleableItem'] = $selection;
57-
$arguments['quantity'] = $quantity ? floatval($quantity) : 1.;
57+
$arguments['quantity'] = $quantity ? (float)$quantity : 1.;
5858

5959
return $this->objectManager->create(self::SELECTION_CLASS_DEFAULT, $arguments);
6060
}

app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClearFiltersActionGroup.xml

100644100755
File mode changed.

app/code/Magento/BundleImportExport/Model/Export/RowCustomizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ function ($title, $storeName) {
322322
*/
323323
protected function getTypeValue($type)
324324
{
325-
return isset($this->typeMapping[$type]) ? $this->typeMapping[$type] : self::VALUE_DYNAMIC;
325+
return $this->typeMapping[$type] ?? self::VALUE_DYNAMIC;
326326
}
327327

328328
/**
@@ -333,7 +333,7 @@ protected function getTypeValue($type)
333333
*/
334334
protected function getPriceViewValue($type)
335335
{
336-
return isset($this->priceViewMapping[$type]) ? $this->priceViewMapping[$type] : self::VALUE_PRICE_RANGE;
336+
return $this->priceViewMapping[$type] ?? self::VALUE_PRICE_RANGE;
337337
}
338338

339339
/**
@@ -344,7 +344,7 @@ protected function getPriceViewValue($type)
344344
*/
345345
protected function getPriceTypeValue($type)
346346
{
347-
return isset($this->priceTypeMapping[$type]) ? $this->priceTypeMapping[$type] : null;
347+
return $this->priceTypeMapping[$type] ?? null;
348348
}
349349

350350
/**
@@ -355,7 +355,7 @@ protected function getPriceTypeValue($type)
355355
*/
356356
private function getShipmentTypeValue($type)
357357
{
358-
return isset($this->shipmentTypeMapping[$type]) ? $this->shipmentTypeMapping[$type] : null;
358+
return $this->shipmentTypeMapping[$type] ?? null;
359359
}
360360

361361
/**

app/code/Magento/Captcha/Observer/CaptchaStringResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ public function resolve(\Magento\Framework\App\RequestInterface $request, $formI
1818
{
1919
$captchaParams = $request->getPost(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE);
2020

21-
return isset($captchaParams[$formId]) ? $captchaParams[$formId] : '';
21+
return $captchaParams[$formId] ?? '';
2222
}
2323
}

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getFieldSuffix()
7474
public function getStoreId()
7575
{
7676
$storeId = $this->getRequest()->getParam('store');
77-
return intval($storeId);
77+
return (int) $storeId;
7878
}
7979

8080
/**

app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace Magento\Catalog\Block\Product\ProductList;
88

99
use Magento\Catalog\Model\ResourceModel\Product\Collection;
10-
use Magento\Framework\View\Element\AbstractBlock;
1110

1211
/**
1312
* Catalog product upsell items block
@@ -170,8 +169,8 @@ public function getRowCount()
170169
*/
171170
public function setColumnCount($columns)
172171
{
173-
if (intval($columns) > 0) {
174-
$this->_columnCount = intval($columns);
172+
if ((int) $columns > 0) {
173+
$this->_columnCount = (int) $columns;
175174
}
176175
return $this;
177176
}
@@ -213,8 +212,8 @@ public function getIterableItem()
213212
*/
214213
public function setItemLimit($type, $limit)
215214
{
216-
if (intval($limit) > 0) {
217-
$this->_itemLimits[$type] = intval($limit);
215+
if ((int) $limit > 0) {
216+
$this->_itemLimits[$type] = (int) $limit;
218217
}
219218
return $this;
220219
}

app/code/Magento/Catalog/Block/Product/View/Gallery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function getImageAttribute($imageId, $attributeName, $default = null)
205205
{
206206
$attributes =
207207
$this->getConfigView()->getMediaAttributes('Magento_Catalog', Image::MEDIA_TYPE_CONFIG_NODE, $imageId);
208-
return isset($attributes[$attributeName]) ? $attributes[$attributeName] : $default;
208+
return $attributes[$attributeName] ?? $default;
209209
}
210210

211211
/**

0 commit comments

Comments
 (0)