From 033863653b01430f8a635c61029c624b2d613d9d Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Sun, 26 Feb 2017 22:41:31 +0200 Subject: [PATCH 1/6] [PSR-2 Compliance] Fix #8612: Hundreds of PHPCS-based static tests violations in mainline - enable PHPCS-based tests for the whole codebase - combine three PHPCS-based tests into one - polish up Magento Coding Standard into one ruleset.xml: no new rules added, only those rules removed which are already contained in PSR2 - run static tests under PHP 7 which is ~3 times faster than PHP 5.6 --- .travis.yml | 5 +- .../CodingStandard/Tool/CodeSniffer.php | 7 +- .../static/framework/Magento/ruleset.xml | 10 ++ .../Magento/Test/Php/LiveCodeTest.php | 99 ++----------------- .../Magento/Test/Php/_files/phpcs/ruleset.xml | 34 ------- .../Test/Php/_files/whitelist/common.txt | 15 ++- 6 files changed, 34 insertions(+), 136 deletions(-) delete mode 100644 dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml diff --git a/.travis.yml b/.travis.yml index 74e374412fff4..6c147707b3342 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,12 +26,11 @@ cache: directories: $HOME/.composer/cache matrix: exclude: - - php: 7.0 + - php: 5.6.29 env: TEST_SUITE=static before_install: ./dev/travis/before_install.sh install: composer install --no-interaction --prefer-dist before_script: ./dev/travis/before_script.sh script: - - cd dev/tests/$TEST_SUITE - test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true - - phpunit $TEST_FILTER + - phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER diff --git a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php index eba745bfe2da9..d0b9868796be8 100644 --- a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php +++ b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer.php @@ -40,7 +40,7 @@ class CodeSniffer implements ToolInterface, ExtensionInterface * * @var array */ - private $extensions = ['php']; + private $extensions = ['php', 'phtml']; /** * Constructor @@ -51,8 +51,11 @@ class CodeSniffer implements ToolInterface, ExtensionInterface */ public function __construct($rulesetDir, $reportFile, Wrapper $wrapper) { - $this->reportFile = $reportFile; $this->rulesetDir = $rulesetDir; + if (!file_exists($rulesetDir) && file_exists($fullPath = realpath(__DIR__ . '/../../../../' . $rulesetDir))) { + $this->rulesetDir = $fullPath; + } + $this->reportFile = $reportFile; $this->wrapper = $wrapper; } diff --git a/dev/tests/static/framework/Magento/ruleset.xml b/dev/tests/static/framework/Magento/ruleset.xml index a636b13c7ff99..d877eb17104d4 100644 --- a/dev/tests/static/framework/Magento/ruleset.xml +++ b/dev/tests/static/framework/Magento/ruleset.xml @@ -7,6 +7,9 @@ --> Custom Magento coding standard. + + + @@ -16,4 +19,11 @@ */_files/* + + + + + + + diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index 036805558830f..2dcf36a4087ee 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -189,101 +189,27 @@ function ($file) use ($fileHasAllowedType, $fileIsInAllowedDirectory) { } /** - * Run the PSR2 code sniffs on the code + * Retrieves full list of codebase paths without any files/folders filtered out * - * @TODO: combine with testCodeStyle - * @return void + * @return array */ - public function testCodeStylePsr2() + private function getFullWhitelist() { - $reportFile = self::$reportDir . '/phpcs_psr2_report.txt'; - $wrapper = new Wrapper(); - $codeSniffer = new CodeSniffer('PSR2', $reportFile, $wrapper); - if (!$codeSniffer->canRun()) { - $this->markTestSkipped('PHP Code Sniffer is not installed.'); - } - if (version_compare($wrapper->version(), '1.4.7') === -1) { - $this->markTestSkipped('PHP Code Sniffer Build Too Old.'); - } - - $result = $codeSniffer->run(self::getWhitelist()); - - $output = ""; - if (file_exists($reportFile)) { - $output = file_get_contents($reportFile); - } - $this->assertEquals( - 0, - $result, - "PHP Code Sniffer has found {$result} error(s): " . PHP_EOL . $output - ); + return Files::init()->readLists(__DIR__ . '/_files/whitelist/common.txt'); } - /** - * Run the magento specific coding standards on the code - * - * @return void - */ - public function testCodeStyle() + public function testNoViolationsDetectedByPhpCodeSniffer() { $reportFile = self::$reportDir . '/phpcs_report.txt'; - $wrapper = new Wrapper(); - $codeSniffer = new CodeSniffer(realpath(__DIR__ . '/_files/phpcs'), $reportFile, $wrapper); - if (!$codeSniffer->canRun()) { - $this->markTestSkipped('PHP Code Sniffer is not installed.'); - } - $codeSniffer->setExtensions(['php', 'phtml']); - $result = $codeSniffer->run(self::getWhitelist(['php', 'phtml'])); - - $output = ""; - if (file_exists($reportFile)) { - $output = file_get_contents($reportFile); - } - - $this->assertEquals( - 0, - $result, - "PHP Code Sniffer has found {$result} error(s): " . PHP_EOL . $output - ); - } - - /** - * Run the annotations sniffs on the code - * - * @return void - * @todo Combine with normal code style at some point. - */ - public function testAnnotationStandard() - { - $reportFile = self::$reportDir . '/phpcs_annotations_report.txt'; - $wrapper = new Wrapper(); - $codeSniffer = new CodeSniffer( - realpath(__DIR__ . '/../../../../framework/Magento/ruleset.xml'), - $reportFile, - $wrapper - ); - if (!$codeSniffer->canRun()) { - $this->markTestSkipped('PHP Code Sniffer is not installed.'); - } - - $result = $codeSniffer->run(self::getWhitelist(['php'])); - $output = ""; - if (file_exists($reportFile)) { - $output = file_get_contents($reportFile); - } + $codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper()); $this->assertEquals( 0, - $result, - "PHP Code Sniffer has found {$result} error(s): " . PHP_EOL . $output + $result = $codeSniffer->run($this->getFullWhitelist()), + "PHP Code Sniffer detected {$result} violation(s): " . PHP_EOL . file_get_contents($reportFile) ); } - /** - * Run mess detector on code - * - * @return void - */ - public function testCodeMess() + public function testNoViolationsDetectedByPhpMessDetector() { $reportFile = self::$reportDir . '/phpmd_report.txt'; $codeMessDetector = new CodeMessDetector(realpath(__DIR__ . '/_files/phpmd/ruleset.xml'), $reportFile); @@ -312,12 +238,7 @@ public function testCodeMess() } } - /** - * Run copy paste detector on code - * - * @return void - */ - public function testCopyPaste() + public function testNoViolationsDetectedByPhpCopyPasteDetector() { $reportFile = self::$reportDir . '/phpcpd_report.xml'; $copyPasteDetector = new CopyPasteDetector($reportFile); diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml deleted file mode 100644 index 8a3a701c15feb..0000000000000 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - Magento coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt index e5c31e5afcb0c..8e1e6f16bc351 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt @@ -1,8 +1,7 @@ -module * / -library * / -dev/tools/Magento -dev/tests/api-functional -dev/tests/functional -dev/tests/integration -dev/tests/static -setup \ No newline at end of file +# Format: or simply +* * / +dev +phpserver +pub +setup +*.php From c3e7df5f892b5d54de115033d28f9908bc4ebb95 Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Sun, 26 Feb 2017 22:46:05 +0200 Subject: [PATCH 2/6] [PSR-2 Compliance] Fix #8612: Hundreds of PHPCS-based static tests violations in mainline - apply manual fixes to make PHPCS happy, changes for "Constants are not allowed as the first argument of translation function, use string literal instead" - third-party constants are simply ignored, not sure if this is correct or not --- .../Ui/Component/Report/Listing/Column/PaymentType.php | 2 ++ .../Braintree/Ui/Component/Report/Listing/Column/Status.php | 2 ++ .../Ui/Component/Report/Listing/Column/TransactionType.php | 2 ++ app/code/Magento/Webapi/Controller/Rest/RequestValidator.php | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php index fe62fe2340757..9e2867f43b9f2 100644 --- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php +++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php @@ -43,6 +43,7 @@ public function toOptionArray() */ private function getAvailablePaymentTypes() { + // @codingStandardsIgnoreStart return [ PaymentInstrumentType::PAYPAL_ACCOUNT => __(PaymentInstrumentType::PAYPAL_ACCOUNT), PaymentInstrumentType::COINBASE_ACCOUNT => __(PaymentInstrumentType::COINBASE_ACCOUNT), @@ -51,5 +52,6 @@ private function getAvailablePaymentTypes() PaymentInstrumentType::APPLE_PAY_CARD => __(PaymentInstrumentType::APPLE_PAY_CARD), PaymentInstrumentType::ANDROID_PAY_CARD => __(PaymentInstrumentType::ANDROID_PAY_CARD) ]; + // @codingStandardsIgnoreEnd } } diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php index b58bda418874f..20a427ff86058 100644 --- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php +++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php @@ -43,6 +43,7 @@ public function toOptionArray() */ private function getAvailableStatuses() { + // @codingStandardsIgnoreStart return [ Transaction::AUTHORIZATION_EXPIRED => __(Transaction::AUTHORIZATION_EXPIRED), Transaction::AUTHORIZING => __(Transaction::AUTHORIZING), @@ -59,5 +60,6 @@ private function getAvailableStatuses() Transaction::SETTLEMENT_PENDING => __(Transaction::SETTLEMENT_PENDING), Transaction::SETTLEMENT_CONFIRMED => __(Transaction::SETTLEMENT_CONFIRMED) ]; + // @codingStandardsIgnoreEnd } } diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php index 46c497c8eca4a..64432c079491f 100644 --- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php +++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php @@ -43,9 +43,11 @@ public function toOptionArray() */ private function getAvailableTransactionTypes() { + // @codingStandardsIgnoreStart return [ Transaction::SALE => __(Transaction::SALE), Transaction::CREDIT => __(Transaction::CREDIT) ]; + // @codingStandardsIgnoreEnd } } diff --git a/app/code/Magento/Webapi/Controller/Rest/RequestValidator.php b/app/code/Magento/Webapi/Controller/Rest/RequestValidator.php index 6435d5801277e..47b728370b034 100644 --- a/app/code/Magento/Webapi/Controller/Rest/RequestValidator.php +++ b/app/code/Magento/Webapi/Controller/Rest/RequestValidator.php @@ -86,7 +86,7 @@ private function checkPermissions() if (!$this->authorization->isAllowed($route->getAclResources())) { $params = ['resources' => implode(', ', $route->getAclResources())]; throw new AuthorizationException( - __(AuthorizationException::NOT_AUTHORIZED, $params) + __('Consumer is not authorized to access %resources', $params) ); } } From 8d379e666c7e332450513f96a8919c06223cc751 Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Sun, 26 Feb 2017 22:58:18 +0200 Subject: [PATCH 3/6] [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) --- .../Block/Widget/Grid/Column/Filter/Store.php | 1 + .../Model/View/Layout/Reader/Block.php | 7 ++ .../Customer/PayPal/VaultTokenRenderer.php | 5 ++ .../Gateway/Config/PayPal/Config.php | 6 ++ .../Model/Ui/PayPal/ConfigProvider.php | 7 ++ .../Report/Filters/Type/DateRangeTest.php | 1 + .../templates/paypal/vault_token.phtml | 3 +- .../Model/Layer/Filter/Dynamic/Improved.php | 1 + .../Model/Import/Product/StoreResolver.php | 1 + .../Model/Adapter/Mysql/Field/Resolver.php | 1 + .../Search/FilterMapper/FilterContext.php | 1 + .../frontend/templates/cart/noItems.phtml | 2 +- .../CustomerData/Plugin/SessionChecker.php | 1 + app/code/Magento/Customer/Model/Context.php | 1 + .../Model/Plugin/CustomerNotification.php | 3 +- .../templates/product/grouped/list.phtml | 1 + .../Response/Validator/AVSResponse.php | 8 +- .../Service/Response/Validator/CVV2Match.php | 8 +- .../view/frontend/templates/hss/info.phtml | 4 +- .../Magento/ProductVideo/Helper/Media.php | 1 + .../Quote/Address/CollectTotalsObserver.php | 5 +- .../templates/report/grid/container.phtml | 4 +- .../Sales/Api/Data/OrderAddressInterface.php | 75 ++++++++++++------- .../Sales/Model/ResourceModel/Attribute.php | 1 + .../Shipping/Model/Simplexml/Element.php | 4 +- .../Magento/Store/Model/Config/StoreView.php | 2 + app/code/Magento/Store/Model/PathConfig.php | 2 + .../templates/product/view/renderer.phtml | 1 + .../Config/SearchRobots/ResetButton.php | 1 + .../Controller/Adminhtml/Bookmark/Delete.php | 1 + .../Api/Data/PaymentTokenInterfaceFactory.php | 1 + .../Vault/Block/Customer/PaymentTokens.php | 2 +- .../Webapi/Model/Rest/Swagger/Generator.php | 1 + .../Webapi/Adapter/Rest/CurlClient.php | 1 + .../Test/TestStep/UpdateTermEntityStep.php | 1 + .../Vault/Test/Block/StoredPayments.php | 6 +- .../TestFramework/Annotation/DbIsolation.php | 1 + .../Magento/Tax/Model/TaxCalculationTest.php | 1 + dev/tests/unit/framework/bootstrap.php | 4 +- .../Framework/Cache/Backend/MongoDb.php | 13 +--- .../DB/Test/Unit/Adapter/Pdo/MysqlTest.php | 7 +- .../Framework/HTTP/PhpEnvironment/Request.php | 9 ++- .../Framework/Indexer/GridStructure.php | 1 + .../Framework/Indexer/IndexStructure.php | 2 + .../ScopeResolver/FlatScopeResolver.php | 1 + .../Framework/Indexer/Test/Unit/XsdTest.php | 1 + .../Magento/Framework/Locale/Resolver.php | 1 + .../Adapter/Mysql/Aggregation/Interval.php | 1 + .../Search/Adapter/Mysql/ConditionManager.php | 1 + .../Search/Adapter/Mysql/Field/Field.php | 2 + .../Adapter/Mysql/Query/MatchContainer.php | 1 + .../Adapter/Mysql/Query/QueryContainer.php | 1 + .../Magento/Framework/Simplexml/Element.php | 4 +- .../TestFramework/Unit/Module/Config.php | 2 +- .../View/Template/Html/MinifierInterface.php | 1 + pub/errors/default/503.phtml | 5 +- pub/errors/default/report.phtml | 1 + pub/errors/processor.php | 39 ++++++---- .../Unit/Controller/ExtensionGridTest.php | 6 +- .../Test/Unit/Controller/ModuleGridTest.php | 4 +- setup/view/magento/setup/license.phtml | 1 + 61 files changed, 190 insertions(+), 91 deletions(-) diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Store.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Store.php index f2663290dbeaa..d18a655ba88c2 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Store.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Store.php @@ -12,6 +12,7 @@ class Store extends \Magento\Backend\Block\Widget\Grid\Column\Filter\AbstractFilter { const ALL_STORE_VIEWS = '0'; + /** * @var \Magento\Store\Model\System\Store */ diff --git a/app/code/Magento/Backend/Model/View/Layout/Reader/Block.php b/app/code/Magento/Backend/Model/View/Layout/Reader/Block.php index 150a0c7a82191..2abdb35f93bb0 100644 --- a/app/code/Magento/Backend/Model/View/Layout/Reader/Block.php +++ b/app/code/Magento/Backend/Model/View/Layout/Reader/Block.php @@ -13,6 +13,13 @@ */ class Block extends Layout\Reader\Block { + /** + * @param Layout\ScheduledStructure\Helper $helper + * @param Layout\Argument\Parser $argumentParser + * @param Layout\ReaderPool $readerPool + * @param InterpreterInterface $argumentInterpreter + * @param null $scopeType + */ public function __construct( Layout\ScheduledStructure\Helper $helper, Layout\Argument\Parser $argumentParser, diff --git a/app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.php b/app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.php index 33458b399e795..28629251f2fcc 100644 --- a/app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.php +++ b/app/code/Magento/Braintree/Block/Customer/PayPal/VaultTokenRenderer.php @@ -21,6 +21,11 @@ class VaultTokenRenderer extends AbstractTokenRenderer */ private $config; + /** + * @param Template\Context $context + * @param Config $config + * @param array $data + */ public function __construct( Template\Context $context, Config $config, diff --git a/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php b/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php index 3f34afd0717db..ad6d8361b8b40 100644 --- a/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php +++ b/app/code/Magento/Braintree/Gateway/Config/PayPal/Config.php @@ -35,6 +35,12 @@ class Config extends \Magento\Payment\Gateway\Config\Config */ private $icon = []; + /** + * @param ScopeConfigInterface $scopeConfig + * @param CcConfig $ccConfig + * @param null $methodCode + * @param string $pathPattern + */ public function __construct( ScopeConfigInterface $scopeConfig, CcConfig $ccConfig, diff --git a/app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php b/app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php index 270e0ed6e83c0..061766d6c2ac5 100644 --- a/app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php +++ b/app/code/Magento/Braintree/Model/Ui/PayPal/ConfigProvider.php @@ -28,12 +28,19 @@ class ConfigProvider implements ConfigProviderInterface */ private $resolver; + /** + * @param Config $config + * @param ResolverInterface $resolver + */ public function __construct(Config $config, ResolverInterface $resolver) { $this->config = $config; $this->resolver = $resolver; } + /** + * @return array + */ public function getConfig() { return [ diff --git a/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php index 479651b90de69..56045c8bfe4b7 100644 --- a/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php @@ -81,6 +81,7 @@ protected function setUp() * @param array|null $expectedCondition * @dataProvider getPrepareDataProvider * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function testPrepare($name, $filterData, $expectedCondition) { diff --git a/app/code/Magento/Braintree/view/frontend/templates/paypal/vault_token.phtml b/app/code/Magento/Braintree/view/frontend/templates/paypal/vault_token.phtml index 80844768e2212..85c127361f727 100644 --- a/app/code/Magento/Braintree/view/frontend/templates/paypal/vault_token.phtml +++ b/app/code/Magento/Braintree/view/frontend/templates/paypal/vault_token.phtml @@ -39,7 +39,8 @@ $payerEmail = $block->escapeHtml($block->getPayerEmail()); "modalClass": "my-credit-cards-popup", "toggleEvent": "click", "title": "escapeHtml(__('Delete')); ?>", - "content": "Are you sure you want to delete this PayPal account: ?" + "content": "Are you sure you want to delete this PayPal account: + ?" } }'> escapeHtml(__('Delete')); ?> diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Improved.php b/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Improved.php index 4f700c14270bc..a5ed757635c01 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Improved.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/Improved.php @@ -35,6 +35,7 @@ class Improved implements AlgorithmInterface * @var Render */ private $render; + /** * @var IntervalFactory */ diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/StoreResolver.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/StoreResolver.php index 108ab592dbc7c..a7c5699874819 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/StoreResolver.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/StoreResolver.php @@ -27,6 +27,7 @@ class StoreResolver * @var array */ protected $websiteCodeToStoreIds = []; + /** * All stores code-ID pairs. * diff --git a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Field/Resolver.php b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Field/Resolver.php index 380a2966288f8..2293168ccc430 100644 --- a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Field/Resolver.php +++ b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Field/Resolver.php @@ -16,6 +16,7 @@ class Resolver implements ResolverInterface * @var AttributeCollection */ private $attributeCollection; + /** * @var FieldFactory */ diff --git a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php index d8d3efc65e782..1ebc2e5141ff9 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php +++ b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php @@ -14,6 +14,7 @@ /** * FilterContext represents a Context of the Strategy pattern * Its responsibility is to choose appropriate strategy to apply passed filter to the Select + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class FilterContext implements FilterStrategyInterface { diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml index 26fb8a9bd71bd..e1b0b35cfcfb0 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml @@ -3,7 +3,7 @@ * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - +// @codingStandardsIgnoreFile /** @var $block \Magento\Checkout\Block\Cart */ ?>
diff --git a/app/code/Magento/Customer/CustomerData/Plugin/SessionChecker.php b/app/code/Magento/Customer/CustomerData/Plugin/SessionChecker.php index 6ee04cea5f85b..ab93d432f13b6 100644 --- a/app/code/Magento/Customer/CustomerData/Plugin/SessionChecker.php +++ b/app/code/Magento/Customer/CustomerData/Plugin/SessionChecker.php @@ -37,6 +37,7 @@ public function __construct( * Delete frontend session cookie if customer session is expired * * @param SessionManager $sessionManager + * @return void */ public function beforeStart(SessionManager $sessionManager) { diff --git a/app/code/Magento/Customer/Model/Context.php b/app/code/Magento/Customer/Model/Context.php index 8634993e8866b..526a3bfa092fd 100644 --- a/app/code/Magento/Customer/Model/Context.php +++ b/app/code/Magento/Customer/Model/Context.php @@ -11,6 +11,7 @@ class Context * Customer group cache context */ const CONTEXT_GROUP = 'customer_group'; + /** * Customer authorization cache context */ diff --git a/app/code/Magento/Customer/Model/Plugin/CustomerNotification.php b/app/code/Magento/Customer/Model/Plugin/CustomerNotification.php index c064c07086db0..1e013b21cfe66 100644 --- a/app/code/Magento/Customer/Model/Plugin/CustomerNotification.php +++ b/app/code/Magento/Customer/Model/Plugin/CustomerNotification.php @@ -37,11 +37,10 @@ class CustomerNotification private $state; /** - * CustomerNotification constructor. - * * @param Session $session * @param NotificationStorage $notificationStorage * @param State $state + * @param CustomerRepositoryInterface $customerRepository */ public function __construct( Session $session, diff --git a/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml b/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml index 3367b9a534455..6af487d0338d1 100644 --- a/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml +++ b/app/code/Magento/GroupedProduct/view/adminhtml/templates/product/grouped/list.phtml @@ -3,6 +3,7 @@ * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +// @codingStandardsIgnoreFile /* @var $block \Magento\GroupedProduct\Block\Product\Grouped\AssociatedProducts\ListAssociatedProducts */ ?>