Skip to content

Commit c619404

Browse files
committed
[PSR-2 Compliance] The Great @codingStandardsIgnoreFile Massacre
- apply automatic PHPCBF fixes to make PHPCS happy - Step 0. Install phpcs globally: composer global require squizlabs/php_codesniffer:2.8.0 - Step 1. Execute tool to fix PSR-2 violations in PHP files: ~/.composer/vendor/squizlabs/php_codesniffer/scripts/phpcbf --standard=PSR2 --extensions=php --ignore=generated/*,vendor/*,var/* .
1 parent 4dc56e0 commit c619404

File tree

247 files changed

+1808
-1114
lines changed

Some content is hidden

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

247 files changed

+1808
-1114
lines changed

app/code/Magento/AdminNotification/Test/Unit/Block/ToolbarEntryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public function testGetLatestUnreadNotifications()
5151

5252
// 1. Create mocks
5353
$notificationList = $this->getMockBuilder(
54-
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class)
54+
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class
55+
)
5556
->disableOriginalConstructor()
5657
->getMock();
5758

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ protected function _renderItemCssClass($menuItem, $level)
147147
$isLast = 0 == $level && (bool)$this->getMenuModel()->isLast($menuItem) ? 'last' : '';
148148
$output = ($this->menuItemChecker->isItemActive(
149149
$this->getActiveItemModel(),
150-
$menuItem,
151-
$level
152-
) ? '_current _active' : '') .
150+
$menuItem,
151+
$level
152+
) ? '_current _active' : '') .
153153
' ' .
154154
($menuItem->hasChildren() ? 'parent' : '') .
155155
' ' .

app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ protected function _construct()
5151
public function getRobotsDefaultCustomInstructions()
5252
{
5353
return trim((string)$this->_scopeConfig->getValue(
54-
self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, ScopeConfigInterface::SCOPE_TYPE_DEFAULT
54+
self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS,
55+
ScopeConfigInterface::SCOPE_TYPE_DEFAULT
5556
));
5657
}
5758

app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function _prepareForm()
6464
]
6565
);
6666
$renderer = $this->getLayout()->createBlock(
67-
\Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset\Element::class
67+
\Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset\Element::class
6868
);
6969
$field->setRenderer($renderer);
7070
} else {

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/ColumnSetTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ public function testGetTotals()
322322
);
323323

324324
$this->assertEquals(
325-
new \Magento\Framework\DataObject(['test1' => '3', 'test2' => '2']), $this->_block->getTotals()
325+
new \Magento\Framework\DataObject(['test1' => '3', 'test2' => '2']),
326+
$this->_block->getTotals()
326327
);
327328
}
328329

app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanMediaTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ public function testExecute()
7676

7777
$messageManager->expects($this->once())
7878
->method('addSuccess')
79-
->with('The JavaScript/CSS cache has been cleaned.'
80-
);
79+
->with('The JavaScript/CSS cache has been cleaned.');
8180

8281
$valueMap = [
8382
[\Magento\Framework\View\Asset\MergeService::class, $mergeService],

app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Dashboard/AbstractTestCase.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,31 @@ protected function assertExecute($controllerName, $blockName)
2323
$outPut = "data";
2424
$resultRawMock = $this->getMock(
2525
\Magento\Framework\Controller\Result\Raw::class,
26-
['setContents'], [], '', false);
26+
['setContents'],
27+
[],
28+
'',
29+
false
30+
);
2731
$resultRawFactoryMock = $this->getMock(
2832
\Magento\Framework\Controller\Result\RawFactory::class,
29-
['create'], [], '', false
33+
['create'],
34+
[],
35+
'',
36+
false
3037
);
3138
$layoutFactoryMock = $this->getMock(
3239
\Magento\Framework\View\LayoutFactory::class,
33-
['create'], [], '', false
40+
['create'],
41+
[],
42+
'',
43+
false
3444
);
3545
$layoutMock = $this->getMock(
3646
\Magento\Framework\View\Layout::class,
37-
['createBlock', 'toHtml'], [], '', false
47+
['createBlock', 'toHtml'],
48+
[],
49+
'',
50+
false
3851
);
3952
$layoutFactoryMock->expects($this->once())->method('create')->will($this->returnValue($layoutMock));
4053
$layoutMock->expects($this->once())->method('createBlock')->with($blockName)->will($this->returnSelf());

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ protected function setUp()
8989
\Magento\Framework\Data\Form\FormKey::class,
9090
['getFormKey'],
9191
[],
92-
'', false
92+
'',
93+
false
9394
);
9495
$this->_formKey->expects($this->any())->method('getFormKey')->will($this->returnValue('salt'));
9596

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,7 @@ public function getOptionsByIds($optionIds, $product)
840840
$usedOptions = $product->getData($this->_keyUsedOptions);
841841
$usedOptionsIds = $product->getData($this->_keyUsedOptionsIds);
842842

843-
if (
844-
!$usedOptions
843+
if (!$usedOptions
845844
|| $this->serializer->serialize($usedOptionsIds) != $this->serializer->serialize($optionIds)
846845
) {
847846
$usedOptions = $this->_bundleOption

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public function testSetOption()
6363
$this->product->expects($this->atLeastOnce())
6464
->method('getPreconfiguredValues')
6565
->will($this->returnValue(
66-
new \Magento\Framework\DataObject(['bundle_option' => [15 => 315, 16 => 316]]))
67-
);
66+
new \Magento\Framework\DataObject(['bundle_option' => [15 => 315, 16 => 316]])
67+
));
6868

6969
$option = $this->getMock(\Magento\Bundle\Model\Option::class, [], [], '', false);
7070
$option->expects($this->any())->method('getId')->will($this->returnValue(15));

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

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ protected function setUp()
134134
->disableOriginalConstructor()
135135
->getMock();
136136
$this->selectionCollection = $this->getMockBuilder(
137-
\Magento\Bundle\Model\ResourceModel\Selection\Collection::class)
137+
\Magento\Bundle\Model\ResourceModel\Selection\Collection::class
138+
)
138139
->disableOriginalConstructor()
139140
->getMock();
140141
$this->product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
@@ -149,13 +150,25 @@ protected function setUp()
149150
->disableOriginalConstructor()
150151
->getMock();
151152
$this->bundleSelectionMock = $this->getMock(
152-
\Magento\Bundle\Model\SelectionFactory::class, ['create'], [], '', false
153+
\Magento\Bundle\Model\SelectionFactory::class,
154+
['create'],
155+
[],
156+
'',
157+
false
153158
);
154159
$this->bundleFactoryMock = $this->getMock(
155-
\Magento\Bundle\Model\ResourceModel\BundleFactory::class, ['create'], [], '', false
160+
\Magento\Bundle\Model\ResourceModel\BundleFactory::class,
161+
['create'],
162+
[],
163+
'',
164+
false
156165
);
157166
$this->optionCollectionFactoryMock = $this->getMock(
158-
\Magento\Bundle\Model\ResourceModel\Option\CollectionFactory::class, ['create'], [], '', false
167+
\Magento\Bundle\Model\ResourceModel\Option\CollectionFactory::class,
168+
['create'],
169+
[],
170+
'',
171+
false
159172
);
160173
$this->storeManagerMock = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class, [], [], '', false);
161174
$this->metadataPoolMock = $this->getMockBuilder(\Magento\Framework\EntityManager\MetadataPool::class)
@@ -321,7 +334,11 @@ public function testAddChildNonExistingOption()
321334
->will($this->returnValue(null));
322335

323336
$optionsCollectionMock = $this->getMock(
324-
\Magento\Bundle\Model\ResourceModel\Option\Collection::class, [], [], '', false
337+
\Magento\Bundle\Model\ResourceModel\Option\Collection::class,
338+
[],
339+
[],
340+
'',
341+
false
325342
);
326343
$optionsCollectionMock->expects($this->once())
327344
->method('setIdFilter')
@@ -505,7 +522,11 @@ public function testAddChildCouldNotSave()
505522
$option->expects($this->once())->method('getId')->will($this->returnValue(1));
506523

507524
$optionsCollectionMock = $this->getMock(
508-
\Magento\Bundle\Model\ResourceModel\Option\Collection::class, [], [], '', false
525+
\Magento\Bundle\Model\ResourceModel\Option\Collection::class,
526+
[],
527+
[],
528+
'',
529+
false
509530
);
510531
$optionsCollectionMock->expects($this->once())
511532
->method('setIdFilter')
@@ -576,7 +597,11 @@ public function testAddChild()
576597
$option->expects($this->once())->method('getId')->will($this->returnValue(1));
577598

578599
$optionsCollectionMock = $this->getMock(
579-
\Magento\Bundle\Model\ResourceModel\Option\Collection::class, [], [], '', false
600+
\Magento\Bundle\Model\ResourceModel\Option\Collection::class,
601+
[],
602+
[],
603+
'',
604+
false
580605
);
581606
$optionsCollectionMock->expects($this->once())
582607
->method('setIdFilter')

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ function ($type) {
119119
\Magento\Bundle\Pricing\Adjustment\SelectionPriceListProviderInterface::class
120120
)->getMock();
121121

122-
$this->model = (new ObjectManager($this))->getObject(\Magento\Bundle\Pricing\Adjustment\Calculator::class,
122+
$this->model = (new ObjectManager($this))->getObject(
123+
\Magento\Bundle\Pricing\Adjustment\Calculator::class,
123124
[
124125
'calculator' => $this->baseCalculator,
125126
'amountFactory' => $this->amountFactory,
@@ -586,7 +587,8 @@ public function testGetOptionsAmount($searchMin, $useRegularPrice)
586587

587588
$result = $calculatorMock->getOptionsAmount(
588589
$this->saleableItem,
589-
$exclude, $searchMin,
590+
$exclude,
591+
$searchMin,
590592
$amount,
591593
$useRegularPrice
592594
);

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ public function testCalculateDiscountWithDefaultAmount()
106106
$this->getPriceMock(20),
107107
$this->getPriceMock(40),
108108
]
109-
)
110-
);
109+
));
111110
$this->assertEquals(20, $this->calculator->calculateDiscount($this->productMock));
112111
}
113112

@@ -122,13 +121,12 @@ public function testCalculateDiscountWithCustomAmount()
122121
$this->priceInfoMock->expects($this->once())
123122
->method('getPrices')
124123
->will($this->returnValue(
125-
[
124+
[
126125
$this->getPriceMock(30),
127126
$this->getPriceMock(20),
128127
$this->getPriceMock(40),
129128
]
130-
)
131-
);
129+
));
132130
$this->assertEquals(10, $this->calculator->calculateDiscount($this->productMock, 50));
133131
}
134132
}

app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ protected function _prepareLayout()
8585
$addUrl = $this->getUrl("*/*/add", ['_current' => false, 'id' => null, '_query' => false]);
8686
if ($this->getStore()->getId() == Store::DEFAULT_STORE_ID) {
8787
$this->addChild(
88-
'add_sub_button', \Magento\Backend\Block\Widget\Button::class,
88+
'add_sub_button',
89+
\Magento\Backend\Block\Widget\Button::class,
8990
[
9091
'label' => __('Add Subcategory'),
9192
'onclick' => "addNew('" . $addUrl . "', false)",
@@ -97,7 +98,8 @@ protected function _prepareLayout()
9798

9899
if ($this->canAddRootCategory()) {
99100
$this->addChild(
100-
'add_root_button', \Magento\Backend\Block\Widget\Button::class,
101+
'add_root_button',
102+
\Magento\Backend\Block\Widget\Button::class,
101103
[
102104
'label' => __('Add Root Category'),
103105
'onclick' => "addNew('" . $addUrl . "', true)",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class Alerts extends \Magento\Backend\Block\Widget\Tab
2424
protected function _prepareLayout()
2525
{
2626
$accordion = $this->getLayout()->createBlock(
27-
\Magento\Backend\Block\Widget\Accordion::class)->setId('productAlerts');
27+
\Magento\Backend\Block\Widget\Accordion::class
28+
)->setId('productAlerts');
2829
/* @var $accordion \Magento\Backend\Block\Widget\Accordion */
2930

3031
$alertPriceAllow = $this->_scopeConfig->getValue('catalog/productalert/allow_price', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ public function getOptionValues()
311311
$value['checkboxScopeTitle'] = $this->getCheckboxScopeHtml(
312312
$option->getOptionId(),
313313
'title',
314-
$option->getStoreTitle() === null);
314+
$option->getStoreTitle() === null
315+
);
315316
$value['scopeTitleDisabled'] = $option->getStoreTitle() === null ? 'disabled' : null;
316317
}
317318

@@ -372,7 +373,8 @@ public function getOptionValues()
372373
$value['checkboxScopePrice'] = $this->getCheckboxScopeHtml(
373374
$option->getOptionId(),
374375
'price',
375-
$option->getStorePrice() === null);
376+
$option->getStorePrice() === null
377+
);
376378
$value['scopePriceDisabled'] = $option->getStorePrice() === null ? 'disabled' : null;
377379
}
378380
}

app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ public function getAfterElementHtml()
124124
$newCategoryCaption = __('New Category');
125125

126126
$button = $this->_layout->createBlock(
127-
\Magento\Backend\Block\Widget\Button::class
127+
\Magento\Backend\Block\Widget\Button::class
128128
)->setData(
129-
[
129+
[
130130
'id' => 'add_category_button',
131131
'label' => $newCategoryCaption,
132132
'title' => $newCategoryCaption,
133133
'onclick' => 'jQuery("#new-category").modal("openModal")',
134134
'disabled' => $this->getDisabled(),
135135
]
136-
);
136+
);
137137
$return = <<<HTML
138138
<input id="{$htmlId}-suggest" placeholder="$suggestPlaceholder" />
139139
<script>

app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ protected function _validateProducts()
4949
if (!is_array($productIds)) {
5050
$error = __('Please select products for attributes update.');
5151
} elseif (!$this->_objectManager->create(
52-
\Magento\Catalog\Model\Product::class)->isProductsHasSku($productIds)) {
52+
\Magento\Catalog\Model\Product::class
53+
)->isProductsHasSku($productIds)) {
5354
$error = __('Please make sure to define SKU values for all processed products.');
5455
}
5556

app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Category/AbstractCategoryTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ protected function setUp()
5656
);
5757

5858
$this->requestMock = $this->getMockBuilder(
59-
\Magento\Framework\App\RequestInterface::class)
59+
\Magento\Framework\App\RequestInterface::class
60+
)
6061
->disableOriginalConstructor()
6162
->getMock();
6263

@@ -65,12 +66,14 @@ protected function setUp()
6566
->will($this->returnValue($this->requestMock));
6667

6768
$this->urlBuilderMock = $this->getMockBuilder(
68-
\Magento\Framework\UrlInterface::class)
69+
\Magento\Framework\UrlInterface::class
70+
)
6971
->disableOriginalConstructor()
7072
->getMock();
7173

7274
$this->storeManagerMock = $this->getMockBuilder(
73-
\Magento\Store\Model\StoreManagerInterface::class)
75+
\Magento\Store\Model\StoreManagerInterface::class
76+
)
7477
->disableOriginalConstructor()
7578
->getMock();
7679

app/code/Magento/Catalog/Test/Unit/Block/Product/AbstractProductTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ public function testGetProductPriceHtml()
123123
->will($this->returnValue($expectedPriceHtml));
124124

125125
$this->assertEquals($expectedPriceHtml, $this->block->getProductPriceHtml(
126-
$product, 'price_code', 'zone_code'
126+
$product,
127+
'price_code',
128+
'zone_code'
127129
));
128130
}
129131

app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ public function testGetIdentities()
8080
['product', $product],
8181
['current_category', $category],
8282
]
83-
)
84-
);
83+
));
8584
$this->assertEquals(['cat_p_1', 'cat_c_1'], $this->view->getIdentities());
8685
}
8786
}

0 commit comments

Comments
 (0)