Skip to content

Commit 40ba673

Browse files
committed
[PSR-2 Compliance] The Great @codingStandardsIgnoreFile Massacre
- apply manual fixes to make PHPCS happy, mainly "Line exceeds maximum limit of 120 characters" violations
1 parent d813974 commit 40ba673

File tree

249 files changed

+1621
-746
lines changed

Some content is hidden

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

249 files changed

+1621
-746
lines changed

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ public function __construct(
3737
*/
3838
public function render(\Magento\Framework\DataObject $row)
3939
{
40-
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' . __(
41-
'Read Details'
42-
) . '</a>' : '';
40+
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">'
41+
. __('Read Details') . '</a>' : '';
4342

4443
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
4544
'*/*/markAsRead/',

app/code/Magento/AdminNotification/Model/ResourceModel/Grid/Collection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
*/
1212
namespace Magento\AdminNotification\Model\ResourceModel\Grid;
1313

14+
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
15+
1416
class Collection extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
1517
{
1618
/**
1719
* Add remove filter
1820
*
19-
* @return \Magento\AdminNotification\Model\ResourceModel\Grid\Collection|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
21+
* @return \Magento\AdminNotification\Model\ResourceModel\Grid\Collection|AbstractCollection
2022
*/
2123
protected function _initSelect()
2224
{

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
6767
ValidatorInterface::ERROR_INVALID_TIER_PRICE_TYPE => 'Value for \'tier_price_value_type\' ' .
6868
'attribute contains incorrect value, acceptable values are Fixed, Discount',
6969
ValidatorInterface::ERROR_TIER_DATA_INCOMPLETE => 'Tier Price data is incomplete',
70-
ValidatorInterface::ERROR_INVALID_ATTRIBUTE_DECIMAL => 'Value for \'%s\' attribute contains incorrect value, acceptable values are in decimal format',
70+
ValidatorInterface::ERROR_INVALID_ATTRIBUTE_DECIMAL
71+
=> 'Value for \'%s\' attribute contains incorrect value, acceptable values are in decimal format',
7172
];
7273

7374
/**

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing/Validator/Website.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function isValid($value)
8585
*/
8686
public function getAllWebsitesValue()
8787
{
88-
return AdvancedPricing::VALUE_ALL_WEBSITES . ' [' . $this->websiteModel->getBaseCurrency()->getCurrencyCode() . ']';
88+
return AdvancedPricing::VALUE_ALL_WEBSITES
89+
. ' [' . $this->websiteModel->getBaseCurrency()->getCurrencyCode() . ']';
8990
}
9091
}

app/code/Magento/Authorization/Model/ResourceModel/Rules.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ public function saveRel(\Magento\Authorization\Model\Rules $rule)
9999

100100
// If all was selected save it only and nothing else.
101101
if ($postedResources === [$this->_rootResource->getId()]) {
102-
$insertData = $this->_prepareDataForTable(new \Magento\Framework\DataObject($row), $this->getMainTable());
102+
$insertData = $this->_prepareDataForTable(
103+
new \Magento\Framework\DataObject($row),
104+
$this->getMainTable()
105+
);
103106

104107
$connection->insert($this->getMainTable(), $insertData);
105108
} else {
@@ -111,7 +114,10 @@ public function saveRel(\Magento\Authorization\Model\Rules $rule)
111114
$row['permission'] = in_array($resourceId, $postedResources) ? 'allow' : 'deny';
112115
$row['resource_id'] = $resourceId;
113116

114-
$insertData = $this->_prepareDataForTable(new \Magento\Framework\DataObject($row), $this->getMainTable());
117+
$insertData = $this->_prepareDataForTable(
118+
new \Magento\Framework\DataObject($row),
119+
$this->getMainTable()
120+
);
115121
$connection->insert($this->getMainTable(), $insertData);
116122
}
117123
}

app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace Magento\Backend\Block\Dashboard;
88

9+
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
10+
911
/**
1012
* Adminhtml dashboard tab abstract
1113
*
@@ -38,7 +40,7 @@ public function __construct(
3840
}
3941

4042
/**
41-
* @return array|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection|\Magento\Eav\Model\Entity\Collection\Abstract
43+
* @return array|AbstractCollection|\Magento\Eav\Model\Entity\Collection\Abstract
4244
*/
4345
public function getCollection()
4446
{

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ protected function _getAnchorLabel($menuItem)
132132
*/
133133
protected function _renderMouseEvent($menuItem)
134134
{
135-
return $menuItem->hasChildren() ? 'onmouseover="Element.addClassName(this,\'over\')" onmouseout="Element.removeClassName(this,\'over\')"' : '';
135+
return $menuItem->hasChildren()
136+
? 'onmouseover="Element.addClassName(this,\'over\')" onmouseout="Element.removeClassName(this,\'over\')"'
137+
: '';
136138
}
137139

138140
/**

app/code/Magento/Backend/Block/Page/Header.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace Magento\Backend\Block\Page;
88

9+
use Magento\Store\Model\ScopeInterface;
10+
911
/**
1012
* Adminhtml header block
1113
*
@@ -78,6 +80,6 @@ public function getLogoutLink()
7880
*/
7981
public function displayNoscriptNotice()
8082
{
81-
return $this->_scopeConfig->getValue('web/browser_capabilities/javascript', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
83+
return $this->_scopeConfig->getValue('web/browser_capabilities/javascript', ScopeInterface::SCOPE_STORE);
8284
}
8385
}

app/code/Magento/Backend/Block/Page/Notices.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*/
1212
namespace Magento\Backend\Block\Page;
1313

14+
use Magento\Store\Model\ScopeInterface;
15+
1416
class Notices extends \Magento\Backend\Block\Template
1517
{
1618
/**
@@ -20,7 +22,7 @@ class Notices extends \Magento\Backend\Block\Template
2022
*/
2123
public function displayNoscriptNotice()
2224
{
23-
return $this->_scopeConfig->getValue('web/browser_capabilities/javascript', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
25+
return $this->_scopeConfig->getValue('web/browser_capabilities/javascript', ScopeInterface::SCOPE_STORE);
2426
}
2527

2628
/**
@@ -30,6 +32,6 @@ public function displayNoscriptNotice()
3032
*/
3133
public function displayDemoNotice()
3234
{
33-
return $this->_scopeConfig->getValue('design/head/demonotice', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
35+
return $this->_scopeConfig->getValue('design/head/demonotice', ScopeInterface::SCOPE_STORE);
3436
}
3537
}

app/code/Magento/Backend/Block/Store/Switcher/Form/Renderer/Fieldset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66

77
namespace Magento\Backend\Block\Store\Switcher\Form\Renderer;
88

9+
use Magento\Framework\Data\Form\Element\Renderer\RendererInterface;
10+
911
/**
1012
* Form fieldset renderer
1113
*/
12-
class Fieldset extends \Magento\Backend\Block\Template implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
14+
class Fieldset extends \Magento\Backend\Block\Template implements RendererInterface
1315
{
1416
/**
1517
* Form element which re-rendering

app/code/Magento/Backend/Block/Widget/Form/Renderer/Element.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
namespace Magento\Backend\Block\Widget\Form\Renderer;
88

99
use Magento\Framework\Data\Form\Element\AbstractElement;
10+
use Magento\Framework\Data\Form\Element\Renderer\RendererInterface;
1011

1112
/**
1213
* Form element default renderer
1314
*
1415
* @author Magento Core Team <[email protected]>
1516
*/
16-
class Element extends \Magento\Backend\Block\Template implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
17+
class Element extends \Magento\Backend\Block\Template implements RendererInterface
1718
{
1819
/**
1920
* @var AbstractElement

app/code/Magento/Backend/Block/Widget/Form/Renderer/Fieldset.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
namespace Magento\Backend\Block\Widget\Form\Renderer;
88

99
use Magento\Framework\Data\Form\Element\AbstractElement;
10+
use Magento\Framework\Data\Form\Element\Renderer\RendererInterface;
1011

1112
/**
1213
* Form fieldset default renderer
1314
*
1415
* @author Magento Core Team <[email protected]>
1516
*/
16-
class Fieldset extends \Magento\Backend\Block\Template implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
17+
class Fieldset extends \Magento\Backend\Block\Template implements RendererInterface
1718
{
1819
/**
1920
* @var AbstractElement

app/code/Magento/Backend/Block/Widget/Form/Renderer/Fieldset/Element.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
namespace Magento\Backend\Block\Widget\Form\Renderer\Fieldset;
88

99
use Magento\Framework\Data\Form\Element\AbstractElement;
10+
use Magento\Framework\Data\Form\Element\Renderer\RendererInterface;
1011

1112
/**
1213
* Fieldset element renderer
1314
*
1415
* @author Magento Core Team <[email protected]>
1516
*/
16-
class Element extends \Magento\Backend\Block\Template implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface
17+
class Element extends \Magento\Backend\Block\Template implements RendererInterface
1718
{
1819
/**
1920
* @var AbstractElement

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ protected function _transformActionData(&$action, &$actionCaption, \Magento\Fram
153153
break;
154154

155155
case 'popup':
156-
$action['onclick'] = 'popWin(this.href,\'_blank\',\'width=800,height=700,resizable=1,scrollbars=1\');return false;';
156+
$action['onclick'] = 'popWin(
157+
this.href,
158+
\'_blank\',
159+
\'width=800,height=700,resizable=1,scrollbars=1\'
160+
);return false;';
157161
break;
158162
}
159163
}

app/code/Magento/Backend/Block/Widget/Grid/Export.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,10 @@ public function _exportIterateCollection($callback, array $args)
282282
* @param \Magento\Framework\Filesystem\File\WriteInterface $stream
283283
* @return void
284284
*/
285-
protected function _exportCsvItem(\Magento\Framework\DataObject $item, \Magento\Framework\Filesystem\File\WriteInterface $stream)
286-
{
285+
protected function _exportCsvItem(
286+
\Magento\Framework\DataObject $item,
287+
\Magento\Framework\Filesystem\File\WriteInterface $stream
288+
) {
287289
$row = [];
288290
foreach ($this->_getColumns() as $column) {
289291
if (!$column->getIsSystem()) {

app/code/Magento/Backend/Model/Menu/Director/Director.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ protected function _getCommand($data, $logger)
4141
* @param \Psr\Log\LoggerInterface $logger
4242
* @return void
4343
*/
44-
public function direct(array $config, \Magento\Backend\Model\Menu\Builder $builder, \Psr\Log\LoggerInterface $logger)
45-
{
44+
public function direct(
45+
array $config,
46+
\Magento\Backend\Model\Menu\Builder $builder,
47+
\Psr\Log\LoggerInterface $logger
48+
) {
4649
foreach ($config as $data) {
4750
$builder->processCommand($this->_getCommand($data, $logger));
4851
}

app/code/Magento/Backend/Model/Widget/Grid/AbstractTotals.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ abstract class AbstractTotals implements \Magento\Backend\Model\Widget\Grid\Tota
4444
* @param \Magento\Framework\DataObject\Factory $factory
4545
* @param \Magento\Backend\Model\Widget\Grid\Parser $parser
4646
*/
47-
public function __construct(\Magento\Framework\DataObject\Factory $factory, \Magento\Backend\Model\Widget\Grid\Parser $parser)
48-
{
47+
public function __construct(
48+
\Magento\Framework\DataObject\Factory $factory,
49+
\Magento\Backend\Model\Widget\Grid\Parser $parser
50+
) {
4951
$this->_factory = $factory;
5052
$this->_parser = $parser;
5153
}

app/code/Magento/Backup/Model/ResourceModel/Helper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ public function getHeader()
174174
$dbConfig = $this->getConnection()->getConfig();
175175

176176
$versionRow = $this->getConnection()->fetchRow('SHOW VARIABLES LIKE \'version\'');
177-
$hostName = !empty($dbConfig['unix_socket']) ? $dbConfig['unix_socket'] : (!empty($dbConfig['host']) ? $dbConfig['host'] : 'localhost');
177+
$hostName = !empty($dbConfig['unix_socket'])
178+
? $dbConfig['unix_socket']
179+
: (!empty($dbConfig['host']) ? $dbConfig['host'] : 'localhost');
178180

179181
$header = "-- Magento DB backup\n" .
180182
"--\n" .

app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function getConfig()
5555
'isAllowShippingAddressOverride' => $this->config->isAllowToEditShippingAddress(),
5656
'merchantName' => $this->config->getMerchantName(),
5757
'locale' => strtolower($this->resolver->getLocale()),
58-
'paymentAcceptanceMarkSrc' => 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
58+
'paymentAcceptanceMarkSrc'
59+
=> 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
5960
'vaultCode' => self::PAYPAL_VAULT_CODE,
6061
'skipOrderReview' => $this->config->isSkipOrderReview(),
6162
'paymentIcon' => $this->config->getPayPalIcon(),

app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/ConfigProviderTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public function getConfigDataProvider()
102102
'isAllowShippingAddressOverride' => true,
103103
'merchantName' => 'Test',
104104
'locale' => 'en_us',
105-
'paymentAcceptanceMarkSrc' => 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
105+
'paymentAcceptanceMarkSrc'
106+
=> 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png',
106107
'vaultCode' => ConfigProvider::PAYPAL_VAULT_CODE,
107108
'skipOrderReview' => false,
108109
'paymentIcon' => [

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ public function getProduct()
220220
public function getSelectionQtyTitlePrice($selection, $includeContainer = true)
221221
{
222222
$this->setFormatProduct($selection);
223-
$priceTitle = '<span class="product-name">' . $selection->getSelectionQty() * 1 . ' x ' . $this->escapeHtml($selection->getName()) . '</span>';
223+
$priceTitle = '<span class="product-name">'
224+
. $selection->getSelectionQty() * 1 . ' x ' . $this->escapeHtml($selection->getName())
225+
. '</span>';
224226

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ protected function setUp()
185185
->disableOriginalConstructor()
186186
->getMock();
187187
$this->model = $helper->getObject(
188-
189188
LinkManagement::class,
190189
[
191190
'productRepository' => $this->productRepository,
@@ -654,7 +653,7 @@ public function testSaveChild()
654653
$productLink->expects($this->any())->method('getQty')->will($this->returnValue($qty));
655654
$productLink->expects($this->any())->method('getPriceType')->will($this->returnValue($priceType));
656655
$productLink->expects($this->any())->method('getPrice')->will($this->returnValue($price));
657-
$productLink->expects($this->any())->method('getCanChangeQuantity')->will($this->returnValue($canChangeQuantity));
656+
$productLink->expects($this->any())->method('getCanChangeQuantity')->willReturn($canChangeQuantity);
658657
$productLink->expects($this->any())->method('getIsDefault')->will($this->returnValue($isDefault));
659658

660659
$this->metadataMock->expects($this->once())->method('getLinkField')->willReturn($this->linkField);

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ public function modifyMeta(array $meta)
134134
'autoRender' => false,
135135
'componentType' => 'insertListing',
136136
'dataScope' => 'bundle_product_listing',
137-
'externalProvider' => 'bundle_product_listing.bundle_product_listing_data_source',
138-
'selectionsProvider' => 'bundle_product_listing.bundle_product_listing.product_columns.ids',
137+
'externalProvider' =>
138+
'bundle_product_listing.bundle_product_listing_data_source',
139+
'selectionsProvider' =>
140+
'bundle_product_listing.bundle_product_listing.product_columns.ids',
139141
'ns' => 'bundle_product_listing',
140142
'render_url' => $this->urlBuilder->getUrl('mui/index/render'),
141143
'realTimeLink' => false,

app/code/Magento/Captcha/Model/Config/Form/AbstractForm.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
*/
1212
namespace Magento\Captcha\Model\Config\Form;
1313

14-
abstract class AbstractForm extends \Magento\Framework\App\Config\Value implements \Magento\Framework\Option\ArrayInterface
14+
use Magento\Framework\Option\ArrayInterface;
15+
16+
abstract class AbstractForm extends \Magento\Framework\App\Config\Value implements ArrayInterface
1517
{
1618
/**
1719
* @var string

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public function getStoreSwitcherHtml()
226226
public function getLoadTreeUrl($expanded = null)
227227
{
228228
$params = ['_current' => true, 'id' => null, 'store' => null];
229-
if ($expanded === null&& $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
229+
if ($expanded === null && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
230230
$params['expand_all'] = true;
231231
}
232232
return $this->getUrl('*/*/categoriesJson', $params);
@@ -310,12 +310,12 @@ public function getBreadcrumbsJavascript($path, $javascriptVarName)
310310
foreach ($categories as $key => $category) {
311311
$categories[$key] = $this->_getNodeJson($category);
312312
}
313-
return '<script>require(["prototype"], function(){' . $javascriptVarName . ' = ' . $this->_jsonEncoder->encode(
314-
$categories
315-
) .
316-
';' .
317-
($this->canAddSubCategory() ? '$("add_subcategory_button").show();' : '$("add_subcategory_button").hide();') .
318-
'});</script>';
313+
return '<script>require(["prototype"], function(){' . $javascriptVarName . ' = '
314+
. $this->_jsonEncoder->encode($categories) . ';'
315+
. ($this->canAddSubCategory()
316+
? '$("add_subcategory_button").show();'
317+
: '$("add_subcategory_button").hide();')
318+
. '});</script>';
319319
}
320320

321321
/**

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ protected function _getAdditionalElementHtml($element)
134134
$checkboxLabel = __('Change');
135135
$html = <<<HTML
136136
<span class="attribute-change-checkbox">
137-
<input type="checkbox" id="$dataCheckboxName" name="$dataCheckboxName" class="checkbox" $nameAttributeHtml onclick="toogleFieldEditMode(this, '{$elementId}')" $dataAttribute />
137+
<input type="checkbox" id="$dataCheckboxName" name="$dataCheckboxName" class="checkbox" $nameAttributeHtml
138+
onclick="toogleFieldEditMode(this, '{$elementId}')" $dataAttribute />
138139
<label class="label" for="$dataCheckboxName">
139140
{$checkboxLabel}
140141
</label>

0 commit comments

Comments
 (0)