Skip to content

Commit fd449e8

Browse files
author
Volodymyr Kublytskyi
authored
Merge pull request magento#1031 from magento-engcom/merge-mainline
Merge mainline
2 parents 3321569 + d9601e9 commit fd449e8

File tree

475 files changed

+14454
-2337
lines changed

Some content is hidden

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

475 files changed

+14454
-2337
lines changed

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
44
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.png)](https://crowdin.com/project/magento-2)
55
<h2>Welcome</h2>
6-
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results.
6+
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
77

88
## Magento system requirements
9-
[Magento system requirements](http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements2.html)
9+
[Magento system requirements](http://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html)
1010

1111
## Install Magento
1212
To install Magento, see either:
1313

14-
* [Magento DevBox](https://magento.com/tech-resources/download), the easiest way to get started with Magento.
15-
* [Installation guide](http://devdocs.magento.com/guides/v2.2/install-gde/bk-install-guide.html)
14+
* [Installation guide](http://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html)
1615

1716
<h2>Contributing to the Magento 2 code base</h2>
1817
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.
@@ -23,11 +22,24 @@ To learn about issues, click [here][2]. To open an issue, click [here][3].
2322

2423
To suggest documentation improvements, click [here][4].
2524

26-
[1]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html>
27-
[2]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#report>
25+
[1]: <http://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html>
26+
[2]: <http://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#report>
2827
[3]: <https://github.com/magento/magento2/issues>
2928
[4]: <http://devdocs.magento.com>
3029

30+
<h3>Community Maintainers</h3>
31+
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks these Community Maintainers for their valuable contributions.
32+
33+
<a href="https://magento.com/magento-contributors#maintainers">
34+
<img src="https://github.com/raw/wiki/magento/magento2/images/maintainers.png"/>
35+
</a>
36+
37+
<h3>Top Contributors</h3>
38+
Magento is thankful for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform.
39+
<a href="https://magento.com/magento-contributors">
40+
<img src="https://github.com/raw/wiki/magento/magento2/images/contributors.png"/>
41+
</a>
42+
3143
<h3>Labels applied by the Magento team</h3>
3244

3345
| Label | Description |

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Radio.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ public function getCondition()
3131
{
3232
if ($this->getValue()) {
3333
return $this->getColumn()->getValue();
34-
} else {
35-
return [['neq' => $this->getColumn()->getValue()], ['is' => new \Zend_Db_Expr('NULL')]];
3634
}
35+
return [['neq' => $this->getColumn()->getValue()], ['is' => new \Zend_Db_Expr('NULL')]];
3736
}
3837
}

app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,8 @@ public function getSelectedJson()
223223
if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) {
224224
$selected = explode(',', $selected);
225225
return join(',', $selected);
226-
} else {
227-
return '';
228226
}
227+
return '';
229228
}
230229

231230
/**
@@ -238,9 +237,8 @@ public function getSelected()
238237
if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) {
239238
$selected = explode(',', $selected);
240239
return $selected;
241-
} else {
242-
return [];
243240
}
241+
return [];
244242
}
245243

246244
/**

app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,8 @@ public function getSelectedJson()
219219
if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) {
220220
$selected = explode(',', $selected);
221221
return join(',', $selected);
222-
} else {
223-
return '';
224222
}
223+
return '';
225224
}
226225

227226
/**
@@ -234,9 +233,8 @@ public function getSelected()
234233
if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) {
235234
$selected = explode(',', $selected);
236235
return $selected;
237-
} else {
238-
return [];
239236
}
237+
return [];
240238
}
241239

242240
/**

app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ public function execute()
5050
// redirect according to rewrite rule
5151
if ($requestUrl != $backendUrl) {
5252
return $this->getRedirect($backendUrl);
53-
} else {
54-
return $this->resultPageFactory->create();
5553
}
54+
return $this->resultPageFactory->create();
5655
}
5756

5857
/**

app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ private function getSecurityCookie()
3232
{
3333
if (!($this->securityCookie instanceof SecurityCookie)) {
3434
return \Magento\Framework\App\ObjectManager::getInstance()->get(SecurityCookie::class);
35-
} else {
36-
return $this->securityCookie;
3735
}
36+
return $this->securityCookie;
3837
}
3938

4039
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,11 @@ public function populateFromArray(array $data)
503503
$this->_tooltip = $this->_getArgument($data, 'toolTip');
504504
$this->_title = $this->_getArgument($data, 'title');
505505
$this->target = $this->_getArgument($data, 'target');
506+
$this->_submenu = null;
506507
if (isset($data['sub_menu'])) {
507508
$menu = $this->_menuFactory->create();
508509
$menu->populateFromArray($data['sub_menu']);
509510
$this->_submenu = $menu;
510-
} else {
511-
$this->_submenu = null;
512511
}
513512
}
514513
}

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

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -202,33 +202,36 @@ public function getUrl($routePath = null, $routeParams = null)
202202
}
203203

204204
$cacheSecretKey = false;
205-
if (is_array($routeParams) && isset($routeParams['_cache_secret_key'])) {
205+
if (isset($routeParams['_cache_secret_key'])) {
206206
unset($routeParams['_cache_secret_key']);
207207
$cacheSecretKey = true;
208208
}
209209
$result = parent::getUrl($routePath, $routeParams);
210210
if (!$this->useSecretKey()) {
211211
return $result;
212212
}
213+
214+
$this->getRouteParamsResolver()->unsetData('route_params');
213215
$this->_setRoutePath($routePath);
216+
$extraParams = $this->getRouteParamsResolver()->getRouteParams();
214217
$routeName = $this->_getRouteName('*');
215218
$controllerName = $this->_getControllerName(self::DEFAULT_CONTROLLER_NAME);
216219
$actionName = $this->_getActionName(self::DEFAULT_ACTION_NAME);
217-
if ($cacheSecretKey) {
218-
$secret = [self::SECRET_KEY_PARAM_NAME => "\${$routeName}/{$controllerName}/{$actionName}\$"];
219-
} else {
220-
$secret = [
221-
self::SECRET_KEY_PARAM_NAME => $this->getSecretKey($routeName, $controllerName, $actionName),
222-
];
223-
}
224-
if (is_array($routeParams)) {
225-
$routeParams = array_merge($secret, $routeParams);
226-
} else {
227-
$routeParams = $secret;
220+
221+
if (!isset($routeParams[self::SECRET_KEY_PARAM_NAME])) {
222+
if (!is_array($routeParams)) {
223+
$routeParams = [];
224+
}
225+
$secretKey = $cacheSecretKey
226+
? "\${$routeName}/{$controllerName}/{$actionName}\$"
227+
: $this->getSecretKey($routeName, $controllerName, $actionName);
228+
$routeParams[self::SECRET_KEY_PARAM_NAME] = $secretKey;
228229
}
229-
if (is_array($this->_getRouteParams())) {
230-
$routeParams = array_merge($this->_getRouteParams(), $routeParams);
230+
231+
if (!empty($extraParams)) {
232+
$routeParams = array_merge($extraParams, $routeParams);
231233
}
234+
232235
return parent::getUrl("{$routeName}/{$controllerName}/{$actionName}", $routeParams);
233236
}
234237

app/code/Magento/Backend/Test/Unit/Model/Config/SessionLifetime/BackendModelTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public function testBeforeSave($value, $errorMessage = null)
2121
\Magento\Backend\Model\Config\SessionLifetime\BackendModel::class
2222
);
2323
if ($errorMessage !== null) {
24-
$this->expectException(\Magento\Framework\Exception\LocalizedException::class, $errorMessage);
24+
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
25+
$this->expectExceptionMessage($errorMessage);
2526
}
2627
$model->setValue($value);
2728
$object = $model->beforeSave();

app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeTransactionStub.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ public function __get($name)
3434
{
3535
if (array_key_exists($name, $this->_attributes)) {
3636
return $this->_attributes[$name];
37-
} else {
38-
trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE);
39-
return null;
4037
}
38+
trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE);
39+
return null;
4140
}
4241

4342
/**

app/code/Magento/Braintree/view/adminhtml/web/js/braintree.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ define([
145145
_initBraintree: function () {
146146
var self = this;
147147

148+
this.disableEventListeners();
149+
148150
self.braintree.setup(self.clientToken, 'custom', {
149151
id: self.selector,
150152
hostedFields: self.getHostedFields(),
@@ -154,6 +156,7 @@ define([
154156
*/
155157
onReady: function () {
156158
$('body').trigger('processStop');
159+
self.enableEventListeners();
157160
},
158161

159162
/**

app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ public function getChildren($item)
9595

9696
if (isset($itemsArray[$item->getOrderItem()->getId()])) {
9797
return $itemsArray[$item->getOrderItem()->getId()];
98-
} else {
99-
return null;
10098
}
99+
return null;
101100
}
102101

103102
/**
@@ -219,9 +218,8 @@ public function getOrderItem()
219218
{
220219
if ($this->getItem() instanceof \Magento\Sales\Model\Order\Item) {
221220
return $this->getItem();
222-
} else {
223-
return $this->getItem()->getOrderItem();
224221
}
222+
return $this->getItem()->getOrderItem();
225223
}
226224

227225
/**

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,8 @@ public function isSelected($selection)
189189
return in_array($selection->getSelectionId(), $selectedOptions);
190190
} elseif ($selectedOptions == 'None') {
191191
return false;
192-
} else {
193-
return $selection->getIsDefault() && $selection->isSaleable();
194192
}
193+
return $selection->getIsDefault() && $selection->isSaleable();
195194
}
196195

197196
/**

app/code/Magento/Bundle/Block/Sales/Order/Items/Renderer.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ public function getValueHtml($item)
142142
if ($attributes = $this->getSelectionAttributes($item)) {
143143
return sprintf('%d', $attributes['qty']) . ' x ' . $this->escapeHtml($item->getName()) . " "
144144
. $this->getOrder()->formatPrice($attributes['price']);
145-
} else {
146-
return $this->escapeHtml($item->getName());
147145
}
146+
return $this->escapeHtml($item->getName());
148147
}
149148

150149
/**
@@ -179,9 +178,8 @@ public function getChildren($item)
179178

180179
if (isset($itemsArray[$item->getOrderItem()->getId()])) {
181180
return $itemsArray[$item->getOrderItem()->getId()];
182-
} else {
183-
return null;
184181
}
182+
return null;
185183
}
186184

187185
/**

app/code/Magento/Bundle/Model/Plugin/PriceBackend.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ public function aroundValidate(
2929
&& $object->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC
3030
) {
3131
return true;
32-
} else {
33-
return $proceed($object);
3432
}
33+
return $proceed($object);
3534
}
3635
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,8 @@ public function shakeSelections($firstItem, $secondItem)
10071007
];
10081008
if ($aPosition == $bPosition) {
10091009
return 0;
1010-
} else {
1011-
return $aPosition < $bPosition ? -1 : 1;
10121010
}
1011+
return $aPosition < $bPosition ? -1 : 1;
10131012
}
10141013

10151014
/**

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/AbstractItems.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ public function getChildren($item)
9292

9393
if (isset($itemsArray[$item->getOrderItem()->getId()])) {
9494
return $itemsArray[$item->getOrderItem()->getId()];
95-
} else {
96-
return null;
9795
}
96+
return null;
9897
}
9998

10099
/**
@@ -244,9 +243,8 @@ public function getOrderItem()
244243
{
245244
if ($this->getItem() instanceof \Magento\Sales\Model\Order\Item) {
246245
return $this->getItem();
247-
} else {
248-
return $this->getItem()->getOrderItem();
249246
}
247+
return $this->getItem()->getOrderItem();
250248
}
251249

252250
/**

app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,8 @@ public function calculateBundleAmount($basePriceValue, $bundleProduct, $selectio
271271
{
272272
if ($bundleProduct->getPriceType() == Price::PRICE_TYPE_FIXED) {
273273
return $this->calculateFixedBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude);
274-
} else {
275-
return $this->calculateDynamicBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude);
276274
}
275+
return $this->calculateDynamicBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude);
277276
}
278277

279278
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ public function getProduct()
178178
{
179179
if ($this->bundleProduct->getPriceType() == Price::PRICE_TYPE_DYNAMIC) {
180180
return parent::getProduct();
181-
} else {
182-
return $this->bundleProduct;
183181
}
182+
return $this->bundleProduct;
184183
}
185184
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ public function getValue()
140140
$this->priceInfo
141141
->getPrice(BundleDiscountPrice::PRICE_CODE)
142142
->calculateDiscount($configuredOptionsAmount);
143-
} else {
144-
return parent::getValue();
145143
}
144+
return parent::getValue();
146145
}
147146

148147
/**

app/code/Magento/Captcha/Test/Unit/Model/CaptchaFactoryTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,9 @@ public function testCreateNegative()
5454
$this->returnValue($defaultCaptchaMock)
5555
);
5656

57-
$this->expectException(
58-
'InvalidArgumentException',
59-
'Magento\Captcha\Model\\' . ucfirst(
60-
$captchaType
61-
) . ' does not implement \Magento\Captcha\Model\CaptchaInterface'
62-
);
57+
$this->expectException('InvalidArgumentException');
58+
$this->expectExceptionMessage('Magento\Captcha\Model\\' . ucfirst($captchaType) .
59+
' does not implement \Magento\Captcha\Model\CaptchaInterface');
6360

6461
$this->assertEquals($defaultCaptchaMock, $this->_model->create($captchaType, 'form_id'));
6562
}

app/code/Magento/Catalog/Helper/Product/View.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ public function __construct(
110110
private function preparePageMetadata(ResultPage $resultPage, $product)
111111
{
112112
$pageLayout = $resultPage->getLayout();
113-
$pageLayout->createBlock(\Magento\Catalog\Block\Breadcrumbs::class);
114-
115113
$pageConfig = $resultPage->getConfig();
116114

117115
$title = $product->getMetaTitle();
118116
if ($title) {
119117
$pageConfig->getTitle()->set($title);
118+
} else {
119+
$pageConfig->getTitle()->set($product->getName());
120120
}
121121

122122
$keyword = $product->getMetaKeyword();

0 commit comments

Comments
 (0)