Skip to content

Commit 57db07c

Browse files
Merge branch '2.3-develop' of github.com:magento/magento2 into quisse-2.3
2 parents 2025035 + cea1437 commit 57db07c

File tree

1,072 files changed

+13977
-9202
lines changed

Some content is hidden

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

1,072 files changed

+13977
-9202
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Backend\Block;
108

119
/**
@@ -137,7 +135,9 @@ protected function _getAnchorLabel($menuItem)
137135
*/
138136
protected function _renderMouseEvent($menuItem)
139137
{
140-
return $menuItem->hasChildren() ? 'onmouseover="Element.addClassName(this,\'over\')" onmouseout="Element.removeClassName(this,\'over\')"' : '';
138+
return $menuItem->hasChildren()
139+
? 'onmouseover="Element.addClassName(this,\'over\')" onmouseout="Element.removeClassName(this,\'over\')"'
140+
: '';
141141
}
142142

143143
/**

app/code/Magento/Backend/Block/Widget/Tabs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function addTab($tabId, $tab)
164164
*/
165165
protected function _addTabByName($tab, $tabId)
166166
{
167-
if (strpos($tab, '\Block\\')) {
167+
if (strpos($tab, '\Block\\') !== false) {
168168
$this->_tabs[$tabId] = $this->getLayout()->createBlock($tab, $this->getNameInLayout() . '_tab_' . $tabId);
169169
} elseif ($this->getChildBlock($tab)) {
170170
$this->_tabs[$tabId] = $this->getChildBlock($tab);

app/code/Magento/Backend/Test/Unit/Model/UrlTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
/**
1212
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
13-
* @codingStandardsIgnoreFile
1413
*/
1514
class UrlTest extends \PHPUnit\Framework\TestCase
1615
{
@@ -81,7 +80,10 @@ class UrlTest extends \PHPUnit\Framework\TestCase
8180
protected function setUp()
8281
{
8382
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
84-
$this->_menuMock = $this->createPartialMock(\Magento\Backend\Model\Menu::class, ['getFirstAvailableChild', 'get', 'getFirstAvailable']);
83+
$this->_menuMock = $this->createPartialMock(
84+
\Magento\Backend\Model\Menu::class,
85+
['getFirstAvailableChild', 'get', 'getFirstAvailable']
86+
);
8587

8688
$this->_menuConfigMock = $this->createMock(\Magento\Backend\Model\Menu\Config::class);
8789
$this->_menuConfigMock->expects($this->any())->method('getMenu')->will($this->returnValue($this->_menuMock));
@@ -136,7 +138,9 @@ protected function setUp()
136138
->method('getHash')
137139
->willReturnArgument(0);
138140
$routeParamsResolver = $this->createMock(\Magento\Framework\Url\RouteParamsResolver::class);
139-
$this->routeParamsResolverFactoryMock = $this->createMock(\Magento\Framework\Url\RouteParamsResolverFactory::class);
141+
$this->routeParamsResolverFactoryMock = $this->createMock(
142+
\Magento\Framework\Url\RouteParamsResolverFactory::class
143+
);
140144
$this->routeParamsResolverFactoryMock->expects($this->any())
141145
->method('create')
142146
->willReturn($routeParamsResolver);

app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab;
108

119
/**

app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ public function getExtendedElement($switchAttributeCode)
142142
[
143143
'name' => "product[{$switchAttributeCode}]",
144144
'values' => $this->getOptions(),
145-
'value' => $switchAttributeCode,
146145
'class' => 'required-entry next-toinput',
147146
'no_span' => true,
148147
'disabled' => $this->isDisabledField(),

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Bundle\Block\Catalog\Product\View\Type\Bundle;
108

119
/**
@@ -93,7 +91,7 @@ public function __construct(
9391
*/
9492
public function showSingle()
9593
{
96-
if (is_null($this->_showSingle)) {
94+
if ($this->_showSingle === null) {
9795
$option = $this->getOption();
9896
$selections = $option->getSelections();
9997

@@ -238,7 +236,11 @@ public function getProduct()
238236
public function getSelectionQtyTitlePrice($selection, $includeContainer = true)
239237
{
240238
$this->setFormatProduct($selection);
241-
$priceTitle = '<span class="product-name">' . $selection->getSelectionQty() * 1 . ' x ' . $this->escapeHtml($selection->getName()) . '</span>';
239+
$priceTitle = '<span class="product-name">'
240+
. $selection->getSelectionQty() * 1
241+
. ' x '
242+
. $this->escapeHtml($selection->getName())
243+
. '</span>';
242244

243245
$priceTitle .= ' &nbsp; ' . ($includeContainer ? '<span class="price-notice">' : '') . '+' .
244246
$this->renderPriceString($selection, $includeContainer) . ($includeContainer ? '</span>' : '');

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Bundle\Model\Product;
108

119
use Magento\Framework\App\ObjectManager;
@@ -897,8 +895,7 @@ public function getOptionsByIds($optionIds, $product)
897895
$usedOptions = $product->getData($this->_keyUsedOptions);
898896
$usedOptionsIds = $product->getData($this->_keyUsedOptionsIds);
899897

900-
if (
901-
!$usedOptions
898+
if (!$usedOptions
902899
|| $this->serializer->serialize($usedOptionsIds) != $this->serializer->serialize($optionIds)
903900
) {
904901
$usedOptions = $this->_bundleOption
@@ -1261,7 +1258,9 @@ protected function checkIsAllRequiredOptions($product, $isStrictProcessMode, $op
12611258
if (!$product->getSkipCheckRequiredOption() && $isStrictProcessMode) {
12621259
foreach ($optionsCollection->getItems() as $option) {
12631260
if ($option->getRequired() && !isset($options[$option->getId()])) {
1264-
throw new \Magento\Framework\Exception\LocalizedException(__('Please select all required options.'));
1261+
throw new \Magento\Framework\Exception\LocalizedException(
1262+
__('Please select all required options.')
1263+
);
12651264
}
12661265
}
12671266
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
/**
1212
* Order invoice pdf default items renderer
13-
*
14-
* @codingStandardsIgnoreFile
1513
*/
1614
class Invoice extends AbstractItems
1715
{

app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/Bundle/OptionTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Bundle\Test\Unit\Block\Catalog\Product\View\Type\Bundle;
108

119
class OptionTest extends \PHPUnit\Framework\TestCase
@@ -65,8 +63,8 @@ public function testSetOption()
6563
->will($this->returnValue(true));
6664
$this->product->expects($this->atLeastOnce())
6765
->method('getPreconfiguredValues')
68-
->will($this->returnValue(
69-
new \Magento\Framework\DataObject(['bundle_option' => [15 => 315, 16 => 316]]))
66+
->will(
67+
$this->returnValue(new \Magento\Framework\DataObject(['bundle_option' => [15 => 315, 16 => 316]]))
7068
);
7169

7270
$option = $this->createMock(\Magento\Bundle\Model\Option::class);

app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* See COPYING.txt for license details.
66
*/
77

8-
// @codingStandardsIgnoreFile
9-
108
namespace Magento\Bundle\Test\Unit\Model;
119

1210
use Magento\Bundle\Model\LinkManagement;
@@ -136,9 +134,8 @@ protected function setUp()
136134
->disableOriginalConstructor()
137135
->getMock();
138136
$this->selectionCollection = $this->getMockBuilder(
139-
\Magento\Bundle\Model\ResourceModel\Selection\Collection::class)
140-
->disableOriginalConstructor()
141-
->getMock();
137+
\Magento\Bundle\Model\ResourceModel\Selection\Collection::class
138+
)->disableOriginalConstructor()->getMock();
142139
$this->product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
143140
->setMethods(['getTypeInstance', 'getStoreId', 'getTypeId', '__wakeup', 'getId', 'getData'])
144141
->disableOriginalConstructor()
@@ -150,9 +147,18 @@ protected function setUp()
150147
->setMethods(['create'])
151148
->disableOriginalConstructor()
152149
->getMock();
153-
$this->bundleSelectionMock = $this->createPartialMock(\Magento\Bundle\Model\SelectionFactory::class, ['create']);
154-
$this->bundleFactoryMock = $this->createPartialMock(\Magento\Bundle\Model\ResourceModel\BundleFactory::class, ['create']);
155-
$this->optionCollectionFactoryMock = $this->createPartialMock(\Magento\Bundle\Model\ResourceModel\Option\CollectionFactory::class, ['create']);
150+
$this->bundleSelectionMock = $this->createPartialMock(
151+
\Magento\Bundle\Model\SelectionFactory::class,
152+
['create']
153+
);
154+
$this->bundleFactoryMock = $this->createPartialMock(
155+
\Magento\Bundle\Model\ResourceModel\BundleFactory::class,
156+
['create']
157+
);
158+
$this->optionCollectionFactoryMock = $this->createPartialMock(
159+
\Magento\Bundle\Model\ResourceModel\Option\CollectionFactory::class,
160+
['create']
161+
);
156162
$this->storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class);
157163
$this->metadataPoolMock = $this->getMockBuilder(\Magento\Framework\EntityManager\MetadataPool::class)
158164
->disableOriginalConstructor()
@@ -626,7 +632,8 @@ public function testSaveChild()
626632
$productLink->expects($this->any())->method('getQty')->will($this->returnValue($qty));
627633
$productLink->expects($this->any())->method('getPriceType')->will($this->returnValue($priceType));
628634
$productLink->expects($this->any())->method('getPrice')->will($this->returnValue($price));
629-
$productLink->expects($this->any())->method('getCanChangeQuantity')->will($this->returnValue($canChangeQuantity));
635+
$productLink->expects($this->any())->method('getCanChangeQuantity')
636+
->will($this->returnValue($canChangeQuantity));
630637
$productLink->expects($this->any())->method('getIsDefault')->will($this->returnValue($isDefault));
631638
$productLink->expects($this->any())->method('getSelectionId')->will($this->returnValue($optionId));
632639

app/code/Magento/Bundle/Test/Unit/Model/OptionRepositoryTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* See COPYING.txt for license details.
66
*/
77

8-
// @codingStandardsIgnoreFile
9-
108
namespace Magento\Bundle\Test\Unit\Model;
119

1210
use Magento\Bundle\Model\OptionRepository;
@@ -89,7 +87,10 @@ protected function setUp()
8987
$this->dataObjectHelperMock = $this->getMockBuilder(\Magento\Framework\Api\DataObjectHelper::class)
9088
->disableOriginalConstructor()
9189
->getMock();
92-
$this->optionResourceMock = $this->createPartialMock(\Magento\Bundle\Model\ResourceModel\Option::class, ['delete', '__wakeup', 'save', 'removeOptionSelections']);
90+
$this->optionResourceMock = $this->createPartialMock(
91+
\Magento\Bundle\Model\ResourceModel\Option::class,
92+
['delete', '__wakeup', 'save', 'removeOptionSelections']
93+
);
9394
$this->storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class);
9495
$this->linkManagementMock = $this->createMock(\Magento\Bundle\Api\ProductLinkManagementInterface::class);
9596
$this->optionListMock = $this->createMock(\Magento\Bundle\Model\Product\OptionList::class);
@@ -166,7 +167,10 @@ public function testGet()
166167
$optionId = 100;
167168
$optionData = ['title' => 'option title'];
168169

169-
$productMock = $this->createPartialMock(\Magento\Catalog\Model\Product::class, ['getTypeId', 'getTypeInstance', 'getStoreId', 'getPriceType', '__wakeup', 'getSku']);
170+
$productMock = $this->createPartialMock(
171+
\Magento\Catalog\Model\Product::class,
172+
['getTypeId', 'getTypeInstance', 'getStoreId', 'getPriceType', '__wakeup', 'getSku']
173+
);
170174
$productMock->expects($this->once())
171175
->method('getTypeId')
172176
->willReturn(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE);
@@ -292,7 +296,6 @@ public function testSaveExistingOption()
292296
);
293297
$optionCollectionMock->expects($this->once())->method('getFirstItem')->willReturn($optionMock);
294298

295-
296299
$metadataMock = $this->createMock(\Magento\Framework\EntityManager\EntityMetadata::class);
297300
$metadataMock->expects($this->once())->method('getLinkField')->willReturn('product_option');
298301

app/code/Magento/Bundle/Test/Unit/Pricing/Adjustment/CalculatorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Bundle\Test\Unit\Pricing\Adjustment;
108

119
use Magento\Bundle\Model\ResourceModel\Selection\Collection;
@@ -110,7 +108,8 @@ function ($type) {
110108
\Magento\Bundle\Pricing\Adjustment\SelectionPriceListProviderInterface::class
111109
)->getMock();
112110

113-
$this->model = (new ObjectManager($this))->getObject(\Magento\Bundle\Pricing\Adjustment\Calculator::class,
111+
$this->model = (new ObjectManager($this))->getObject(
112+
\Magento\Bundle\Pricing\Adjustment\Calculator::class,
114113
[
115114
'calculator' => $this->baseCalculator,
116115
'amountFactory' => $this->amountFactory,
@@ -577,7 +576,8 @@ public function testGetOptionsAmount($searchMin, $useRegularPrice)
577576

578577
$result = $calculatorMock->getOptionsAmount(
579578
$this->saleableItem,
580-
$exclude, $searchMin,
579+
$exclude,
580+
$searchMin,
581581
$amount,
582582
$useRegularPrice
583583
);

app/code/Magento/Bundle/Test/Unit/Pricing/Price/DiscountCalculatorTest.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Bundle\Test\Unit\Pricing\Price;
108

119
/**
@@ -44,7 +42,10 @@ class DiscountCalculatorTest extends \PHPUnit\Framework\TestCase
4442
protected function setUp()
4543
{
4644
$this->productMock = $this->createMock(\Magento\Catalog\Model\Product::class);
47-
$this->priceInfoMock = $this->createPartialMock(\Magento\Framework\Pricing\PriceInfo\Base::class, ['getPrice', 'getPrices']);
45+
$this->priceInfoMock = $this->createPartialMock(
46+
\Magento\Framework\Pricing\PriceInfo\Base::class,
47+
['getPrice', 'getPrices']
48+
);
4849
$this->finalPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\FinalPrice::class);
4950
$this->priceMock = $this->getMockForAbstractClass(
5051
\Magento\Bundle\Pricing\Price\DiscountProviderInterface::class
@@ -84,14 +85,15 @@ public function testCalculateDiscountWithDefaultAmount()
8485
->will($this->returnValue(100));
8586
$this->priceInfoMock->expects($this->once())
8687
->method('getPrices')
87-
->will($this->returnValue(
88-
[
89-
$this->getPriceMock(30),
90-
$this->getPriceMock(20),
91-
$this->getPriceMock(40),
92-
]
93-
)
94-
);
88+
->will(
89+
$this->returnValue(
90+
[
91+
$this->getPriceMock(30),
92+
$this->getPriceMock(20),
93+
$this->getPriceMock(40),
94+
]
95+
)
96+
);
9597
$this->assertEquals(20, $this->calculator->calculateDiscount($this->productMock));
9698
}
9799

@@ -105,7 +107,8 @@ public function testCalculateDiscountWithCustomAmount()
105107
->will($this->returnValue($this->priceInfoMock));
106108
$this->priceInfoMock->expects($this->once())
107109
->method('getPrices')
108-
->will($this->returnValue(
110+
->will(
111+
$this->returnValue(
109112
[
110113
$this->getPriceMock(30),
111114
$this->getPriceMock(20),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ protected function parseOption($values)
217217
$option = [];
218218
foreach ($values as $keyValue) {
219219
$keyValue = trim($keyValue);
220-
if ($pos = strpos($keyValue, self::PAIR_VALUE_SEPARATOR)) {
220+
$pos = strpos($keyValue, self::PAIR_VALUE_SEPARATOR);
221+
if ($pos !== false) {
221222
$key = substr($keyValue, 0, $pos);
222223
$value = substr($keyValue, $pos + 1);
223224
if ($key == 'type') {

0 commit comments

Comments
 (0)