Skip to content

Commit 644dd7b

Browse files
committed
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGETWO-71231
2 parents 99dd4aa + 9badb94 commit 644dd7b

File tree

27 files changed

+362
-108
lines changed

27 files changed

+362
-108
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Indexer/ActiveTableSwitcher.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
class ActiveTableSwitcher
1313
{
1414
/**
15-
* @var
15+
* Suffix for replica index table.
16+
*
17+
* @var string
1618
* @since 2.2.0
1719
*/
1820
private $additionalTableSuffix = '_replica';
1921

2022
/**
21-
* @var
23+
* Suffix for outdated index table.
24+
*
25+
* @var string
2226
* @since 2.2.0
2327
*/
2428
private $outdatedTableSuffix = '_outdated';

app/code/Magento/Config/Model/Config/Backend/Admin/Custom.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Custom extends \Magento\Framework\App\Config\Value
5555
const XML_PATH_PAYMENT = 'payment';
5656

5757
/**
58-
* @var
58+
* @var \Magento\Framework\App\Config\Storage\WriterInterface
5959
* @since 2.0.0
6060
*/
6161
protected $_configWriter;

app/code/Magento/Deploy/Model/Filesystem.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ public function cleanupFilesystem($directoryCodeList)
325325
* @param int $dirPermissions
326326
* @param int $filePermissions
327327
* @return void
328-
* @deprecated 2.1.0 As magento2 doesn't control indirectly the access permissions to the files and directories anymore.
328+
* @deprecated 2.1.0 As magento2 doesn't control indirectly
329+
* the access permissions to the files and directories anymore.
329330
* Access permissions to the files and directories are set during deploy Magento 2, directly after
330331
* uploading code of Magento. Also it is possible to specify the value
331332
* of inverse mask for setting access permissions to files and directories generated by Magento.
@@ -350,7 +351,8 @@ protected function changePermissions($directoryCodeList, $dirPermissions, $fileP
350351
* Change permissions on static resources
351352
*
352353
* @return void
353-
* @deprecated 2.1.0 As magento2 doesn't control indirectly the access permissions to the files and directories anymore.
354+
* @deprecated 2.1.0 As magento2 doesn't control indirectly the access permissions to the files
355+
* and directories anymore.
354356
* Access permissions to the files and directories are set during deploy Magento 2, directly after
355357
* uploading code of Magento. Also it is possible to specify the value
356358
* of inverse mask for setting access permissions to files and directories generated by Magento.

app/code/Magento/Dhl/Model/Carrier.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ protected function _getWeight($weight, $maxWeight = false, $configWeightUnit = f
705705

706706
if ($configWeightUnit != $countryWeightUnit) {
707707
$weight = $this->_carrierHelper->convertMeasureWeight(
708-
sprintf('%.3f', $weight),
708+
(float)$weight,
709709
$configWeightUnit,
710710
$countryWeightUnit
711711
);
@@ -908,7 +908,7 @@ protected function _getDimension($dimension, $configWeightUnit = false)
908908

909909
if ($configDimensionUnit != $countryDimensionUnit) {
910910
$dimension = $this->_carrierHelper->convertMeasureDimension(
911-
sprintf('%.3f', $dimension),
911+
(float)$dimension,
912912
$configDimensionUnit,
913913
$countryDimensionUnit
914914
);
@@ -928,9 +928,9 @@ protected function _addDimension($nodePiece)
928928
{
929929
$sizeChecker = (string)$this->getConfigData('size');
930930

931-
$height = $this->_getDimension((string)$this->getConfigData('height'));
932-
$depth = $this->_getDimension((string)$this->getConfigData('depth'));
933-
$width = $this->_getDimension((string)$this->getConfigData('width'));
931+
$height = $this->_getDimension((float)$this->getConfigData('height'));
932+
$depth = $this->_getDimension((float)$this->getConfigData('depth'));
933+
$width = $this->_getDimension((float)$this->getConfigData('width'));
934934

935935
if ($sizeChecker && $height && $depth && $width) {
936936
$nodePiece->addChild('Height', $height);

app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,15 @@ function ($data) {
167167

168168
$this->errorFactory->expects($this->any())->method('create')->willReturn($this->error);
169169

170+
$localeResolver = $this->getMockForAbstractClass(\Magento\Framework\Locale\ResolverInterface::class);
171+
$localeResolver->method('getLocale')->willReturn('fr_FR');
172+
173+
$carrierHelper = $this->objectManager->getObject(
174+
\Magento\Shipping\Helper\Carrier::class,
175+
[
176+
'localeResolver' => $localeResolver
177+
]
178+
);
170179
$this->model = $this->objectManager->getObject(
171180
\Magento\Dhl\Model\Carrier::class,
172181
[
@@ -179,6 +188,7 @@ function ($data) {
179188
'httpClientFactory' => $httpClientFactory,
180189
'readFactory' => $readFactory,
181190
'storeManager' => $storeManager,
191+
'carrierHelper' => $carrierHelper,
182192
'data' => ['id' => 'dhl', 'store' => '1']
183193
]
184194
);
@@ -205,7 +215,11 @@ public function scopeConfigGetValue($path)
205215
'carriers/dhl/showmethod' => 1,
206216
'carriers/dhl/title' => 'dhl Title',
207217
'carriers/dhl/specificerrmsg' => 'dhl error message',
208-
'carriers/dhl/unit_of_measure' => 'L',
218+
'carriers/dhl/unit_of_measure' => 'K',
219+
'carriers/dhl/size' => '1',
220+
'carriers/dhl/height' => '1.6',
221+
'carriers/dhl/width' => '1.6',
222+
'carriers/dhl/depth' => '1.6',
209223
];
210224
return isset($pathMap[$path]) ? $pathMap[$path] : null;
211225
}
@@ -280,7 +294,10 @@ public function testCollectRates()
280294
$rawPostData->setAccessible(true);
281295

282296
self::assertNotEmpty($this->model->collectRates($request)->getAllRates());
283-
self::assertContains('<Weight>8.266</Weight>', $rawPostData->getValue($this->httpClient));
297+
self::assertContains('<Weight>18.223</Weight>', $rawPostData->getValue($this->httpClient));
298+
self::assertContains('<Height>0.630</Height>', $rawPostData->getValue($this->httpClient));
299+
self::assertContains('<Width>0.630</Width>', $rawPostData->getValue($this->httpClient));
300+
self::assertContains('<Depth>0.630</Depth>', $rawPostData->getValue($this->httpClient));
284301
}
285302

286303
public function testCollectRatesErrorMessage()

app/code/Magento/Quote/Model/Quote/Item/CartItemProcessorsPool.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public function getCartItemProcessors()
4747
return $this->cartItemProcessors;
4848
}
4949

50-
$arguments = $this->objectManagerConfig->getArguments(\Magento\Quote\Model\Quote\Item\Repository::class);
50+
$typePreference = $this->objectManagerConfig->getPreference(Repository::class);
51+
$arguments = $this->objectManagerConfig->getArguments($typePreference);
5152
if (isset($arguments['cartItemProcessors'])) {
5253
// Workaround for compiled mode.
5354
$processors = isset($arguments['cartItemProcessors']['_vac_'])

app/code/Magento/SalesSequence/Setup/InstallData.php

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,79 +3,36 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
namespace Magento\SalesSequence\Setup;
87

98
use Magento\Framework\Setup\InstallDataInterface;
109
use Magento\Framework\Setup\ModuleContextInterface;
1110
use Magento\Framework\Setup\ModuleDataSetupInterface;
12-
use Magento\SalesSequence\Model\Builder;
13-
use Magento\SalesSequence\Model\Config as SequenceConfig;
14-
use Magento\SalesSequence\Model\EntityPool;
1511

1612
/**
17-
* Class InstallData
18-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
19-
* @codeCoverageIgnore
20-
* @since 2.0.0
13+
* Recurring data upgrade for SalesSequence module.
2114
*/
2215
class InstallData implements InstallDataInterface
2316
{
2417
/**
25-
* Sales setup factory
26-
*
27-
* @var EntityPool
28-
* @since 2.0.0
29-
*/
30-
private $entityPool;
31-
32-
/**
33-
* @var Builder
34-
* @since 2.0.0
35-
*/
36-
private $sequenceBuilder;
37-
38-
/**
39-
* @var SequenceConfig
40-
* @since 2.0.0
18+
* @var SequenceCreator
4119
*/
42-
private $sequenceConfig;
20+
private $sequenceCreator;
4321

4422
/**
45-
* @param EntityPool $entityPool
46-
* @param Builder $sequenceBuilder
47-
* @param SequenceConfig $sequenceConfig
48-
* @since 2.0.0
23+
* @param SequenceCreator $sequenceCreator
4924
*/
5025
public function __construct(
51-
EntityPool $entityPool,
52-
Builder $sequenceBuilder,
53-
SequenceConfig $sequenceConfig
26+
SequenceCreator $sequenceCreator
5427
) {
55-
$this->entityPool = $entityPool;
56-
$this->sequenceBuilder = $sequenceBuilder;
57-
$this->sequenceConfig = $sequenceConfig;
28+
$this->sequenceCreator = $sequenceCreator;
5829
}
5930

6031
/**
6132
* {@inheritdoc}
62-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
63-
* @since 2.0.0
6433
*/
6534
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
6635
{
67-
$defaultStoreIds = [0, 1];
68-
foreach ($defaultStoreIds as $storeId) {
69-
foreach ($this->entityPool->getEntities() as $entityType) {
70-
$this->sequenceBuilder->setPrefix($this->sequenceConfig->get('prefix'))
71-
->setSuffix($this->sequenceConfig->get('suffix'))
72-
->setStartValue($this->sequenceConfig->get('startValue'))
73-
->setStoreId($storeId)
74-
->setStep($this->sequenceConfig->get('step'))
75-
->setWarningValue($this->sequenceConfig->get('warningValue'))
76-
->setMaxValue($this->sequenceConfig->get('maxValue'))
77-
->setEntityType($entityType)->create();
78-
}
79-
}
36+
$this->sequenceCreator->create();
8037
}
8138
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\SalesSequence\Setup;
7+
8+
use Magento\Framework\Setup\InstallDataInterface;
9+
use Magento\Framework\Setup\ModuleContextInterface;
10+
use Magento\Framework\Setup\ModuleDataSetupInterface;
11+
12+
/**
13+
* Recurring data upgrade for SalesSequence module.
14+
*/
15+
class RecurringData implements InstallDataInterface
16+
{
17+
/**
18+
* @var SequenceCreator
19+
*/
20+
private $sequenceCreator;
21+
22+
/**
23+
* @param SequenceCreator $sequenceCreator
24+
*/
25+
public function __construct(
26+
SequenceCreator $sequenceCreator
27+
) {
28+
$this->sequenceCreator = $sequenceCreator;
29+
}
30+
31+
/**
32+
* {@inheritdoc}
33+
*/
34+
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
35+
{
36+
$this->sequenceCreator->create();
37+
}
38+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\SalesSequence\Setup;
8+
9+
use Magento\SalesSequence\Model\Builder;
10+
use Magento\SalesSequence\Model\Config as SequenceConfig;
11+
use Magento\SalesSequence\Model\EntityPool;
12+
13+
/**
14+
* Initial creating sequences.
15+
*/
16+
class SequenceCreator
17+
{
18+
/**
19+
* Sales setup factory
20+
*
21+
* @var EntityPool
22+
*/
23+
private $entityPool;
24+
25+
/**
26+
* @var Builder
27+
*/
28+
private $sequenceBuilder;
29+
30+
/**
31+
* @var SequenceConfig
32+
*/
33+
private $sequenceConfig;
34+
35+
/**
36+
* @param EntityPool $entityPool
37+
* @param Builder $sequenceBuilder
38+
* @param SequenceConfig $sequenceConfig
39+
*/
40+
public function __construct(
41+
EntityPool $entityPool,
42+
Builder $sequenceBuilder,
43+
SequenceConfig $sequenceConfig
44+
) {
45+
$this->entityPool = $entityPool;
46+
$this->sequenceBuilder = $sequenceBuilder;
47+
$this->sequenceConfig = $sequenceConfig;
48+
}
49+
50+
/**
51+
* Creates sales sequences.
52+
*/
53+
public function create()
54+
{
55+
$defaultStoreIds = [0, 1];
56+
foreach ($defaultStoreIds as $storeId) {
57+
foreach ($this->entityPool->getEntities() as $entityType) {
58+
$this->sequenceBuilder->setPrefix($this->sequenceConfig->get('prefix'))
59+
->setSuffix($this->sequenceConfig->get('suffix'))
60+
->setStartValue($this->sequenceConfig->get('startValue'))
61+
->setStoreId($storeId)
62+
->setStep($this->sequenceConfig->get('step'))
63+
->setWarningValue($this->sequenceConfig->get('warningValue'))
64+
->setMaxValue($this->sequenceConfig->get('maxValue'))
65+
->setEntityType($entityType)->create();
66+
}
67+
}
68+
}
69+
}

app/code/Magento/UrlRewrite/Controller/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class Router implements \Magento\Framework\App\RouterInterface
2020
{
2121
/**
22-
* @var
22+
* @var \Magento\Framework\App\ActionFactory
2323
* @since 2.0.0
2424
*/
2525
protected $actionFactory;

0 commit comments

Comments
 (0)