Skip to content

Commit c87c521

Browse files
committed
[PSR-2 Compliance] The Great @codingStandardsIgnoreFile Massacre
- apply manual fixes to make PHPMD happy
1 parent 40ba673 commit c87c521

File tree

31 files changed

+66
-131
lines changed

31 files changed

+66
-131
lines changed

app/code/Magento/Catalog/Observer/Compare/BindCustomerLoginObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(
2828
* @param \Magento\Framework\Event\Observer $observer
2929
* @return $this
3030
*
31-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
31+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3232
*/
3333
public function execute(\Magento\Framework\Event\Observer $observer)
3434
{

app/code/Magento/Catalog/Observer/Compare/BindCustomerLogoutObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(
2828
* @param \Magento\Framework\Event\Observer $observer
2929
* @return $this
3030
*
31-
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
31+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3232
*/
3333
public function execute(\Magento\Framework\Event\Observer $observer)
3434
{

app/code/Magento/Catalog/Test/Unit/Model/System/Config/Backend/Catalog/Url/Rewrite/SuffixTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\Catalog\Test\Unit\Model\System\Config\Backend\Catalog\Url\Rewrite;
77

8+
/**
9+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
10+
*/
811
class SuffixTest extends \PHPUnit_Framework_TestCase
912
{
1013
/**

app/code/Magento/CatalogRule/Model/ResourceModel/ReadHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function __construct(
4141
* @param array $arguments
4242
* @return array
4343
* @throws \Exception
44+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4445
*/
4546
public function execute($entityType, $entityData, $arguments = [])
4647
{

app/code/Magento/CatalogRule/Model/ResourceModel/SaveHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function __construct(
4141
* @param array $arguments
4242
* @return array
4343
* @throws \Exception
44+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4445
*/
4546
public function execute($entityType, $entityData, $arguments = [])
4647
{

app/code/Magento/Cms/Model/ResourceModel/Block/Relation/Store/SaveHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function __construct(
4242
* @param array $arguments
4343
* @return object
4444
* @throws \Exception
45+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4546
*/
4647
public function execute($entity, $arguments = [])
4748
{

app/code/Magento/Cms/Model/ResourceModel/Page/Relation/Store/SaveHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function __construct(
4242
* @param array $arguments
4343
* @return object
4444
* @throws \Exception
45+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4546
*/
4647
public function execute($entity, $arguments = [])
4748
{

app/code/Magento/ConfigurableProduct/Test/Unit/Helper/DataTest.php

Lines changed: 14 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
namespace Magento\ConfigurableProduct\Test\Unit\Helper;
88

9+
use Magento\Catalog\Model\Product;
10+
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
11+
use Magento\Framework\DataObject;
12+
913
class DataTest extends \PHPUnit_Framework_TestCase
1014
{
1115
/**
@@ -19,27 +23,21 @@ class DataTest extends \PHPUnit_Framework_TestCase
1923
protected $_imageHelperMock;
2024

2125
/**
22-
* @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject
26+
* @var Product|\PHPUnit_Framework_MockObject_MockObject
2327
*/
2428
protected $_productMock;
2529

2630
protected function setUp()
2731
{
2832
$this->_imageHelperMock = $this->getMock(\Magento\Catalog\Helper\Image::class, [], [], '', false);
29-
$this->_productMock = $this->getMock(\Magento\Catalog\Model\Product::class, [], [], '', false);
33+
$this->_productMock = $this->getMock(Product::class, [], [], '', false);
3034

3135
$this->_model = new \Magento\ConfigurableProduct\Helper\Data($this->_imageHelperMock);
3236
}
3337

3438
public function testGetAllowAttributes()
3539
{
36-
$typeInstanceMock = $this->getMock(
37-
\Magento\ConfigurableProduct\Model\Product\Type\Configurable::class,
38-
[],
39-
[],
40-
'',
41-
false
42-
);
40+
$typeInstanceMock = $this->getMock(Configurable::class, [], [], '', false);
4341
$typeInstanceMock->expects($this->once())
4442
->method('getConfigurableAttributes')
4543
->with($this->_productMock);
@@ -93,39 +91,14 @@ public function testGetOptions(array $expected, array $data)
9391
*/
9492
public function getOptionsDataProvider()
9593
{
96-
$currentProductMock = $this->getMock(
97-
\Magento\Catalog\Model\Product::class,
98-
['getTypeInstance', '__wakeup'],
99-
[],
100-
'',
101-
false
102-
);
103-
$provider = [];
104-
$provider[] = [
105-
[],
106-
[
107-
'allowed_products' => [],
108-
'current_product_mock' => $currentProductMock,
109-
],
110-
];
94+
$currentProductMock = $this->getMock(Product::class, ['getTypeInstance', '__wakeup'], [], '', false);
95+
$provider = [[[], ['allowed_products' => [], 'current_product_mock' => $currentProductMock]]];
11196

11297
$attributesCount = 3;
11398
$attributes = [];
11499
for ($i = 1; $i < $attributesCount; $i++) {
115-
$attribute = $this->getMock(
116-
\Magento\Framework\DataObject::class,
117-
['getProductAttribute'],
118-
[],
119-
'',
120-
false
121-
);
122-
$productAttribute = $this->getMock(
123-
\Magento\Framework\DataObject::class,
124-
['getId', 'getAttributeCode'],
125-
[],
126-
'',
127-
false
128-
);
100+
$attribute = $this->getMock(DataObject::class, ['getProductAttribute'], [], '', false);
101+
$productAttribute = $this->getMock(DataObject::class, ['getId', 'getAttributeCode'], [], '', false);
129102
$productAttribute->expects($this->any())
130103
->method('getId')
131104
->will($this->returnValue('attribute_id_' . $i));
@@ -137,13 +110,7 @@ public function getOptionsDataProvider()
137110
->will($this->returnValue($productAttribute));
138111
$attributes[] = $attribute;
139112
}
140-
$typeInstanceMock = $this->getMock(
141-
\Magento\ConfigurableProduct\Model\Product\Type\Configurable::class,
142-
[],
143-
[],
144-
'',
145-
false
146-
);
113+
$typeInstanceMock = $this->getMock(Configurable::class, [], [], '', false);
147114
$typeInstanceMock->expects($this->any())
148115
->method('getConfigurableAttributes')
149116
->will($this->returnValue($attributes));
@@ -153,7 +120,7 @@ public function getOptionsDataProvider()
153120
$allowedProducts = [];
154121
for ($i = 1; $i <= 2; $i++) {
155122
$productMock = $this->getMock(
156-
\Magento\Catalog\Model\Product::class,
123+
Product::class,
157124
['getData', 'getImage', 'getId', '__wakeup', 'getMediaGalleryImages'],
158125
[],
159126
'',
@@ -261,7 +228,7 @@ private function getImagesCollection()
261228
->getMock();
262229

263230
$items = [
264-
new \Magento\Framework\DataObject([
231+
new DataObject([
265232
'file' => 'test_file'
266233
]),
267234
];

app/code/Magento/Customer/Controller/Account/CreatePost.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
/**
3232
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
33+
* @SuppressWarnings(PHPMD.TooManyFields)
3334
*/
3435
class CreatePost extends \Magento\Customer\Controller\AbstractAccount
3536
{

app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
/**
1515
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
16+
* @SuppressWarnings(PHPMD.TooManyFields)
1617
*/
1718
class SaveTest extends \PHPUnit_Framework_TestCase
1819
{

0 commit comments

Comments
 (0)