Skip to content

Commit 8d379e6

Browse files
committed
[PSR-2 Compliance] Fix #8612: Hundreds of PHPCS-based static tests violations in mainline
- apply manual fixes to make PHPCS and PHPMD happy - some phtml templates marked as ignored for now as PHPCS 1.5.3 version produces false-positives on them (PHPCS 2.8.0 treats them fine)
1 parent c3e7df5 commit 8d379e6

File tree

61 files changed

+190
-91
lines changed

Some content is hidden

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

61 files changed

+190
-91
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Store.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
class Store extends \Magento\Backend\Block\Widget\Grid\Column\Filter\AbstractFilter
1313
{
1414
const ALL_STORE_VIEWS = '0';
15+
1516
/**
1617
* @var \Magento\Store\Model\System\Store
1718
*/

app/code/Magento/Backend/Model/View/Layout/Reader/Block.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
*/
1414
class Block extends Layout\Reader\Block
1515
{
16+
/**
17+
* @param Layout\ScheduledStructure\Helper $helper
18+
* @param Layout\Argument\Parser $argumentParser
19+
* @param Layout\ReaderPool $readerPool
20+
* @param InterpreterInterface $argumentInterpreter
21+
* @param null $scopeType
22+
*/
1623
public function __construct(
1724
Layout\ScheduledStructure\Helper $helper,
1825
Layout\Argument\Parser $argumentParser,

app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ class VaultTokenRenderer extends AbstractTokenRenderer
2121
*/
2222
private $config;
2323

24+
/**
25+
* @param Template\Context $context
26+
* @param Config $config
27+
* @param array $data
28+
*/
2429
public function __construct(
2530
Template\Context $context,
2631
Config $config,

app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ class Config extends \Magento\Payment\Gateway\Config\Config
3535
*/
3636
private $icon = [];
3737

38+
/**
39+
* @param ScopeConfigInterface $scopeConfig
40+
* @param CcConfig $ccConfig
41+
* @param null $methodCode
42+
* @param string $pathPattern
43+
*/
3844
public function __construct(
3945
ScopeConfigInterface $scopeConfig,
4046
CcConfig $ccConfig,

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,19 @@ class ConfigProvider implements ConfigProviderInterface
2828
*/
2929
private $resolver;
3030

31+
/**
32+
* @param Config $config
33+
* @param ResolverInterface $resolver
34+
*/
3135
public function __construct(Config $config, ResolverInterface $resolver)
3236
{
3337
$this->config = $config;
3438
$this->resolver = $resolver;
3539
}
3640

41+
/**
42+
* @return array
43+
*/
3744
public function getConfig()
3845
{
3946
return [

app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ protected function setUp()
8181
* @param array|null $expectedCondition
8282
* @dataProvider getPrepareDataProvider
8383
* @return void
84+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
8485
*/
8586
public function testPrepare($name, $filterData, $expectedCondition)
8687
{

app/code/Magento/Braintree/view/frontend/templates/paypal/vault_token.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ $payerEmail = $block->escapeHtml($block->getPayerEmail());
3939
"modalClass": "my-credit-cards-popup",
4040
"toggleEvent": "click",
4141
"title": "<?php echo $block->escapeHtml(__('Delete')); ?>",
42-
"content": "Are you sure you want to delete this PayPal account: <?php /* @noEscape */ echo $payerEmail; ?>?"
42+
"content": "Are you sure you want to delete this PayPal account:
43+
<?php /* @noEscape */ echo $payerEmail; ?>?"
4344
}
4445
}'>
4546
<span><?php echo $block->escapeHtml(__('Delete')); ?></span>

app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Improved.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class Improved implements AlgorithmInterface
3535
* @var Render
3636
*/
3737
private $render;
38+
3839
/**
3940
* @var IntervalFactory
4041
*/

app/code/Magento/CatalogImportExport/Model/Import/Product/StoreResolver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class StoreResolver
2727
* @var array
2828
*/
2929
protected $websiteCodeToStoreIds = [];
30+
3031
/**
3132
* All stores code-ID pairs.
3233
*

app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Field/Resolver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Resolver implements ResolverInterface
1616
* @var AttributeCollection
1717
*/
1818
private $attributeCollection;
19+
1920
/**
2021
* @var FieldFactory
2122
*/

app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/**
1515
* FilterContext represents a Context of the Strategy pattern
1616
* Its responsibility is to choose appropriate strategy to apply passed filter to the Select
17+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1718
*/
1819
class FilterContext implements FilterStrategyInterface
1920
{

app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
6+
// @codingStandardsIgnoreFile
77
/** @var $block \Magento\Checkout\Block\Cart */
88
?>
99
<div class="cart-empty">

app/code/Magento/Customer/CustomerData/Plugin/SessionChecker.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function __construct(
3737
* Delete frontend session cookie if customer session is expired
3838
*
3939
* @param SessionManager $sessionManager
40+
* @return void
4041
*/
4142
public function beforeStart(SessionManager $sessionManager)
4243
{

app/code/Magento/Customer/Model/Context.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Context
1111
* Customer group cache context
1212
*/
1313
const CONTEXT_GROUP = 'customer_group';
14+
1415
/**
1516
* Customer authorization cache context
1617
*/

app/code/Magento/Customer/Model/Plugin/CustomerNotification.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ class CustomerNotification
3737
private $state;
3838

3939
/**
40-
* CustomerNotification constructor.
41-
*
4240
* @param Session $session
4341
* @param NotificationStorage $notificationStorage
4442
* @param State $state
43+
* @param CustomerRepositoryInterface $customerRepository
4544
*/
4645
public function __construct(
4746
Session $session,

app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
// @codingStandardsIgnoreFile
67
/* @var $block \Magento\GroupedProduct\Block\Product\Grouped\AssociatedProducts\ListAssociatedProducts */
78
?>
89
<script type="text/x-magento-template" id="group-product-template">

app/code/Magento/Paypal/Model/Payflow/Service/Response/Validator/AVSResponse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ class AVSResponse implements ValidatorInterface
3838
*/
3939
const IAVS = 'iavs';
4040

41-
/** Values of the response */
41+
/**#@+ Values of the response */
4242
const RESPONSE_YES = 'y';
4343

4444
const RESPONSE_NO = 'n';
4545

4646
const RESPONSE_NOT_SUPPORTED = 'x';
47-
/** */
47+
/**#@-*/
4848

49-
/** Values of the validation settings payments */
49+
/**#@+ Values of the validation settings payments */
5050
const CONFIG_ON = 1;
5151

5252
const CONFIG_OFF = 0;
53-
/** */
53+
/**#@-*/
5454

5555
/**
5656
* @var array

app/code/Magento/Paypal/Model/Payflow/Service/Response/Validator/CVV2Match.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ class CVV2Match implements ValidatorInterface
3030
*/
3131
const ERROR_MESSAGE = 'Card security code does not match.';
3232

33-
/** Values of the response */
33+
/**#@+ Values of the response */
3434
const RESPONSE_YES = 'y';
3535

3636
const RESPONSE_NO = 'n';
3737

3838
const RESPONSE_NOT_SUPPORTED = 'x';
39-
/** */
39+
/**#@-*/
4040

41-
/** Validation settings payments */
41+
/**#@+ Validation settings payments */
4242
const CONFIG_ON = 1;
4343

4444
const CONFIG_OFF = 0;
4545

4646
const CONFIG_NAME = 'avs_security_code';
47-
/** */
47+
/**#@-*/
4848

4949
/**
5050
* Validate data

app/code/Magento/Paypal/view/frontend/templates/hss/info.phtml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
8-
6+
// @codingStandardsIgnoreFile
97
/**
108
* @var \Magento\Paypal\Block\Payflow\Link\Info $block
119
* @see \Magento\Paypal\Block\Payflow\Link\Info

app/code/Magento/ProductVideo/Helper/Media.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Media extends \Magento\Framework\App\Helper\AbstractHelper
3333
* Configuration path for show related
3434
*/
3535
const XML_PATH_SHOW_RELATED = 'catalog/product_video/show_related';
36+
3637
/**
3738
* Configuration path for video auto restart
3839
*/

app/code/Magento/Quote/Observer/Frontend/Quote/Address/CollectTotalsObserver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ class CollectTotalsObserver implements ObserverInterface
4747
protected $groupManagement;
4848

4949
/**
50-
* Initialize dependencies.
51-
*
5250
* @param \Magento\Customer\Helper\Address $customerAddressHelper
5351
* @param \Magento\Customer\Model\Vat $customerVat
5452
* @param VatValidator $vatValidator
5553
* @param \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerDataFactory
5654
* @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
55+
* @param \Magento\Customer\Api\AddressRepositoryInterface $addressRepository
56+
* @param \Magento\Customer\Model\Session $customerSession
5757
*/
5858
public function __construct(
5959
\Magento\Customer\Helper\Address $customerAddressHelper,
@@ -78,6 +78,7 @@ public function __construct(
7878
*
7979
* @param \Magento\Framework\Event\Observer $observer
8080
* @return void
81+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
8182
*/
8283
public function execute(\Magento\Framework\Event\Observer $observer)
8384
{

app/code/Magento/Reports/view/adminhtml/templates/report/grid/container.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ require([
3333
}
3434

3535
if (jQuery('#filter_form').valid()) {
36-
setLocation('<?php /* @escapeNotVerified */ echo $block->getFilterUrl(); ?>filter/'+Base64.encode(Form.serializeElements(elements))+'/');
36+
setLocation('<?php /* @escapeNotVerified */ echo $block->getFilterUrl();?>filter/'+
37+
Base64.encode(Form.serializeElements(elements))+'/'
38+
);
3739
}
3840
}
3941
//]]>

0 commit comments

Comments
 (0)