Skip to content

Commit 0f5c2ac

Browse files
author
Andrii Kasian
committed
MAGETWO-32429: Prepare pull request
1 parent 1faed8d commit 0f5c2ac

File tree

8 files changed

+55
-7
lines changed

8 files changed

+55
-7
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ public function updateQtyOption($options, \Magento\Framework\Object $option, $va
597597
* @param mixed $qty
598598
* @param \Magento\Catalog\Model\Product $product
599599
* @return int
600+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
600601
*/
601602
public function prepareQuoteItemQty($qty, $product)
602603
{
@@ -1052,6 +1053,7 @@ public function hasOptions($product)
10521053
* @param \Magento\Catalog\Model\Product $product
10531054
* @return boolean true
10541055
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
1056+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
10551057
*/
10561058
public function getForceChildItemQtyChanges($product)
10571059
{
@@ -1162,6 +1164,7 @@ public function getProductsToPurchaseByReqGroups($product)
11621164
* @param \Magento\Catalog\Model\Product $product
11631165
* @param \Magento\Framework\Object $buyRequest
11641166
* @return array
1167+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
11651168
*/
11661169
public function processBuyRequest($product, $buyRequest)
11671170
{
@@ -1194,6 +1197,7 @@ public function canConfigure($product)
11941197
*
11951198
* @param \Magento\Catalog\Model\Product $product
11961199
* @return void
1200+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
11971201
*/
11981202
public function deleteTypeSpecificData(\Magento\Catalog\Model\Product $product)
11991203
{
@@ -1248,11 +1252,8 @@ protected function getBeforeQty($product, $selection)
12481252
{
12491253
$beforeQty = 0;
12501254
$customOption = $product->getCustomOption('product_qty_' . $selection->getId());
1251-
if ($customOption && $customOption->getProduct()
1252-
->getId() == $selection->getId()
1253-
) {
1255+
if ($customOption && $customOption->getProduct()->getId() == $selection->getId()) {
12541256
$beforeQty = (float)$customOption->getValue();
1255-
12561257
return $beforeQty;
12571258
}
12581259

app/code/Magento/Catalog/Model/Resource/Category.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public function deleteChildren(\Magento\Framework\Object $object)
223223
*
224224
* @param \Magento\Framework\Object $object
225225
* @return $this
226+
* @SuppressWarnings(PHPMD.NPathComplexity)
226227
*/
227228
protected function _beforeSave(\Magento\Framework\Object $object)
228229
{

app/code/Magento/Downloadable/Model/LinkRepository.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
use Magento\Framework\Exception\NoSuchEntityException;
1212
use Magento\Framework\Json\EncoderInterface;
1313

14+
/**
15+
* Class LinkRepository
16+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
17+
*/
1418
class LinkRepository implements \Magento\Downloadable\Api\LinkRepositoryInterface
1519
{
1620
/**
@@ -172,6 +176,8 @@ protected function buildSample($resourceData)
172176

173177
/**
174178
* {@inheritdoc}
179+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
180+
* @SuppressWarnings(PHPMD.NPathComplexity)
175181
*/
176182
public function save($productSku, LinkContentInterface $linkContent, $linkId = null, $isGlobalScopeContent = false)
177183
{

dev/tests/unit/testsuite/Magento/Bundle/Model/Product/TypeTest.php

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
use Magento\Catalog\Model\Product\Option\Type\DefaultType;
1111
use Magento\Framework\Model\Exception;
1212

13+
/**
14+
* Class TypeTest
15+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
16+
*/
1317
class TypeTest extends \PHPUnit_Framework_TestCase
1418
{
1519
/**
@@ -114,6 +118,9 @@ protected function setUp()
114118
);
115119
}
116120

121+
/**
122+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
123+
*/
117124
public function testPrepareForCartAdvancedWithoutOptions()
118125
{
119126
/** @var \PHPUnit_Framework_MockObject_MockObject|DefaultType $group */
@@ -219,6 +226,9 @@ function ($key) use ($optionCollection, $selectionCollection) {
219226
$this->assertEquals('Please specify product option(s).', $result);
220227
}
221228

229+
/**
230+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
231+
*/
222232
public function testPrepareForCartAdvancedWithShoppingCart()
223233
{
224234
/** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product\Type\Price $priceModel */
@@ -455,6 +465,9 @@ function ($key) use ($optionCollection, $selectionCollection) {
455465
$this->assertEquals([$product, $productType], $result);
456466
}
457467

468+
/**
469+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
470+
*/
458471
public function testPrepareForCartAdvancedEmptyShoppingCart()
459472
{
460473
/** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product\Type\Price $priceModel */
@@ -670,6 +683,9 @@ function ($key) use ($optionCollection, $selectionCollection) {
670683
$this->assertEquals('We cannot add this item to your shopping cart.', $result);
671684
}
672685

686+
/**
687+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
688+
*/
673689
public function testPrepareForCartAdvancedStringInResult()
674690
{
675691
/** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product\Type\Price $priceModel */
@@ -885,6 +901,9 @@ function ($key) use ($optionCollection, $selectionCollection) {
885901
$this->assertEquals('string', $result);
886902
}
887903

904+
/**
905+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
906+
*/
888907
public function testPrepareForCartAdvancedWithoutSelections()
889908
{
890909
/** @var \PHPUnit_Framework_MockObject_MockObject|DefaultType $group */
@@ -964,7 +983,7 @@ public function testPrepareForCartAdvancedWithoutSelections()
964983
$product->expects($this->any())
965984
->method('getData')
966985
->willReturnCallback(
967-
function ($key) use ($optionCollection, $selectionCollection) {
986+
function ($key) use ($optionCollection) {
968987
$resultValue = null;
969988
switch ($key) {
970989
case '_cache_instance_options_collection':
@@ -991,6 +1010,9 @@ function ($key) use ($optionCollection, $selectionCollection) {
9911010
$this->assertEquals([$product], $result);
9921011
}
9931012

1013+
/**
1014+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
1015+
*/
9941016
public function testPrepareForCartAdvancedSelectionsSelectionIdsExists()
9951017
{
9961018
/** @var \PHPUnit_Framework_MockObject_MockObject|DefaultType $group */
@@ -1115,6 +1137,9 @@ function ($key) use ($optionCollection, $selectionCollection) {
11151137
$this->assertEquals('Please specify product option(s).', $result);
11161138
}
11171139

1140+
/**
1141+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
1142+
*/
11181143
public function testPrepareForCartAdvancedSelectRequiredOptions()
11191144
{
11201145
/** @var \PHPUnit_Framework_MockObject_MockObject|DefaultType $group */
@@ -1255,6 +1280,7 @@ public function testPrepareForCartAdvancedParentClassReturnString()
12551280
$this->assertEquals($exceptedResult, $result);
12561281
}
12571282

1283+
12581284
public function testPrepareForCartAdvancedAllrequiredOption()
12591285
{
12601286
/** @var \PHPUnit_Framework_MockObject_MockObject|DefaultType $group */
@@ -1800,6 +1826,9 @@ public function shakeSelectionsDataProvider()
18001826
];
18011827
}
18021828

1829+
/**
1830+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
1831+
*/
18031832
public function testGetSelectionsByIds()
18041833
{
18051834
$selectionIds = [1, 2, 3];

dev/tests/unit/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ class ConfigurableTest extends \PHPUnit_Framework_TestCase
8181
*/
8282
protected $_objectHelper;
8383

84+
/**
85+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
86+
*/
8487
protected function setUp()
8588
{
8689
$this->_objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
@@ -701,6 +704,9 @@ public function testSetImageFromChildProduct()
701704
$this->_model->setImageFromChildProduct($productMock);
702705
}
703706

707+
/**
708+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
709+
*/
704710
public function testGenerateSimpleProducts()
705711
{
706712
$productsData = [

dev/tests/unit/testsuite/Magento/Downloadable/Controller/Download/LinkTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ class LinkTest extends \PHPUnit_Framework_TestCase
7575
*/
7676
protected $urlInterface;
7777

78+
/**
79+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
80+
*/
7881
protected function setUp()
7982
{
8083
$this->objectManagerHelper = new ObjectManagerHelper($this);

dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeHandler/SampleTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,9 @@ public function deleteDataProvider()
154154
/**
155155
* @param \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject $product
156156
* @param array $modelData
157-
* @param bool $isUnlimited
158157
* @return \Magento\Downloadable\Model\Sample|\PHPUnit_Framework_MockObject_MockObject
159158
*/
160-
private function createSampleModel($product, array $modelData, $isUnlimited)
159+
private function createSampleModel($product, array $modelData)
161160
{
162161
$sample = $this->getMockBuilder('\Magento\Downloadable\Model\Sample')
163162
->disableOriginalConstructor()

dev/tests/unit/testsuite/Magento/Downloadable/Model/Product/TypeTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class TypeTest extends \PHPUnit_Framework_TestCase
2727
*/
2828
private $product;
2929

30+
/**
31+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
32+
*/
3033
protected function setUp()
3134
{
3235
$objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this);

0 commit comments

Comments
 (0)