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/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php b/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php index 312394787ef82..fce3f6b105dc5 100644 --- a/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php +++ b/app/code/Magento/AdminNotification/Model/System/Message/Baseurl.php @@ -9,7 +9,7 @@ use Magento\Store\Model\Store; /** - * @deprecated + * @deprecated */ class Baseurl implements \Magento\Framework\Notification\MessageInterface { diff --git a/app/code/Magento/AdminNotification/Setup/InstallSchema.php b/app/code/Magento/AdminNotification/Setup/InstallSchema.php index 01c447b9cc2db..d3f9dd2e0c7be 100644 --- a/app/code/Magento/AdminNotification/Setup/InstallSchema.php +++ b/app/code/Magento/AdminNotification/Setup/InstallSchema.php @@ -120,6 +120,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php index 6a0fd28ac7466..edec01a8af4ac 100644 --- a/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php +++ b/app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php @@ -13,7 +13,7 @@ class WebsiteTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Store\Model\WebSite|\PHPUnit_Framework_MockObject_MockObject */ - protected $webSiteModel; + protected $webSiteModel; /** * @var \Magento\CatalogImportExport\Model\Import\Product\StoreResolver|\PHPUnit_Framework_MockObject_MockObject diff --git a/app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Postpone.php b/app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Postpone.php index b87730132e3d4..8c4183150d0f5 100644 --- a/app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Postpone.php +++ b/app/code/Magento/Analytics/Controller/Adminhtml/Subscription/Postpone.php @@ -55,7 +55,6 @@ public function __construct( $this->notificationTime = $notificationTime; $this->logger = $logger; parent::__construct($context); - } /** diff --git a/app/code/Magento/Analytics/Model/FileRecorder.php b/app/code/Magento/Analytics/Model/FileRecorder.php index c1ef8da247147..c087fb1d208b3 100644 --- a/app/code/Magento/Analytics/Model/FileRecorder.php +++ b/app/code/Magento/Analytics/Model/FileRecorder.php @@ -78,7 +78,6 @@ public function recordNewFile(EncodedContext $encodedContext) $this->removeOldFile($fileInfo, $directory); return true; - } /** diff --git a/app/code/Magento/Analytics/Model/ReportWriter.php b/app/code/Magento/Analytics/Model/ReportWriter.php index 80b1210f9677a..39c5fec752585 100644 --- a/app/code/Magento/Analytics/Model/ReportWriter.php +++ b/app/code/Magento/Analytics/Model/ReportWriter.php @@ -80,7 +80,6 @@ public function write(WriteInterface $directory, $path) if (!$headers) { $headers = array_keys($row); $stream->writeCsv($headers); - } $stream->writeCsv($row); } diff --git a/app/code/Magento/Analytics/ReportXml/Config/Mapper.php b/app/code/Magento/Analytics/ReportXml/Config/Mapper.php index cd64867984530..190e84c434182 100644 --- a/app/code/Magento/Analytics/ReportXml/Config/Mapper.php +++ b/app/code/Magento/Analytics/ReportXml/Config/Mapper.php @@ -31,7 +31,6 @@ public function execute($configData) $entityData = array_shift($queryData['source']); $queries[$queryData['name']] = $queryData; $queries[$queryData['name']]['source'] = $entityData; - } return $queries; } diff --git a/app/code/Magento/Analytics/ReportXml/DB/ColumnsResolver.php b/app/code/Magento/Analytics/ReportXml/DB/ColumnsResolver.php index b3d4c42a62df7..66d31737ba4cb 100644 --- a/app/code/Magento/Analytics/ReportXml/DB/ColumnsResolver.php +++ b/app/code/Magento/Analytics/ReportXml/DB/ColumnsResolver.php @@ -63,7 +63,6 @@ public function getColumns(SelectBuilder $selectBuilder, $entityConfig) if (isset($attributeData['group'])) { $group[$columnAlias] = $expression; } - } $selectBuilder->setGroup(array_merge($selectBuilder->getGroup(), $group)); return $columns; diff --git a/app/code/Magento/Analytics/ReportXml/Query.php b/app/code/Magento/Analytics/ReportXml/Query.php index 2bdf2432600dd..5e62235f329e4 100644 --- a/app/code/Magento/Analytics/ReportXml/Query.php +++ b/app/code/Magento/Analytics/ReportXml/Query.php @@ -25,7 +25,7 @@ class Query implements \JsonSerializable private $selectHydrator; /** - * @var string + * @var string */ private $connectionName; diff --git a/app/code/Magento/Analytics/ReportXml/ReportProvider.php b/app/code/Magento/Analytics/ReportXml/ReportProvider.php index 9a8a8ffab0861..7c92db6964865 100644 --- a/app/code/Magento/Analytics/ReportXml/ReportProvider.php +++ b/app/code/Magento/Analytics/ReportXml/ReportProvider.php @@ -74,6 +74,5 @@ public function getReport($name, SearchCriteria $criteria = null) $connection = $this->connectionFactory->getConnection($query->getConnectionName()); $statement = $connection->query($query->getSelect()); return $this->iteratorFactory->create($statement, $this->getIteratorName($query)); - } } diff --git a/app/code/Magento/Analytics/Test/Unit/Model/Config/Backend/CollectionTimeTest.php b/app/code/Magento/Analytics/Test/Unit/Model/Config/Backend/CollectionTimeTest.php index 132aa4aac9529..bcdd5f8ce47b3 100644 --- a/app/code/Magento/Analytics/Test/Unit/Model/Config/Backend/CollectionTimeTest.php +++ b/app/code/Magento/Analytics/Test/Unit/Model/Config/Backend/CollectionTimeTest.php @@ -76,7 +76,6 @@ public function testAfterSave() Value::class, $this->collectionTime->afterSave() ); - } /** diff --git a/app/code/Magento/Analytics/view/adminhtml/templates/dashboard/section.phtml b/app/code/Magento/Analytics/view/adminhtml/templates/dashboard/section.phtml index 45d1d8b77547f..188d9a00b6fb4 100644 --- a/app/code/Magento/Analytics/view/adminhtml/templates/dashboard/section.phtml +++ b/app/code/Magento/Analytics/view/adminhtml/templates/dashboard/section.phtml @@ -3,6 +3,7 @@ * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +// @codingStandardsIgnoreFile ?>
diff --git a/app/code/Magento/Authorizenet/Model/Directpost.php b/app/code/Magento/Authorizenet/Model/Directpost.php index 1dc4e79c0bdad..5782cdd041445 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost.php +++ b/app/code/Magento/Authorizenet/Model/Directpost.php @@ -281,15 +281,14 @@ protected function processCapture($result, $payment) switch ($result->getXResponseCode()) { case self::RESPONSE_CODE_APPROVED: case self::RESPONSE_CODE_HELD: - if ( - in_array( - $result->getXResponseReasonCode(), - [ + if (in_array( + $result->getXResponseReasonCode(), + [ self::RESPONSE_REASON_CODE_APPROVED, self::RESPONSE_REASON_CODE_PENDING_REVIEW, self::RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED ] - ) + ) ) { if (!$payment->getParentTransactionId() || $result->getXTransId() != $payment->getParentTransactionId() @@ -534,8 +533,7 @@ public function validateResponse() { $response = $this->getResponse(); //md5 check - if ( - !$this->getConfigData('trans_md5') + if (!$this->getConfigData('trans_md5') || !$this->getConfigData('login') || !$response->isValidHash($this->getConfigData('trans_md5'), $this->getConfigData('login')) ) { @@ -802,8 +800,7 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = '' { try { $response = $this->getResponse(); - if ( - $voidPayment && $response->getXTransId() && strtoupper($response->getXType()) + if ($voidPayment && $response->getXTransId() && strtoupper($response->getXType()) == self::REQUEST_TYPE_AUTH_ONLY ) { $order->getPayment()->setTransactionId(null)->setParentTransactionId($response->getXTransId())->void(); diff --git a/app/code/Magento/Backend/Block/Dashboard/Sales.php b/app/code/Magento/Backend/Block/Dashboard/Sales.php index e48d49d5112e3..ed121d4d7be6c 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Sales.php +++ b/app/code/Magento/Backend/Block/Dashboard/Sales.php @@ -5,7 +5,6 @@ */ namespace Magento\Backend\Block\Dashboard; - /** * Adminhtml dashboard sales statistics bar * diff --git a/app/code/Magento/Backend/Block/Dashboard/Totals.php b/app/code/Magento/Backend/Block/Dashboard/Totals.php index 0e44a793c3422..d733d1d7d1f89 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Totals.php +++ b/app/code/Magento/Backend/Block/Dashboard/Totals.php @@ -11,7 +11,6 @@ */ namespace Magento\Backend\Block\Dashboard; - class Totals extends \Magento\Backend\Block\Dashboard\Bar { /** diff --git a/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php b/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php index 02f7c5ad58e29..2c8b6922d2b97 100644 --- a/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php +++ b/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php @@ -65,7 +65,7 @@ protected function _prepareForm() 'required' => true ] ); - $renderer = $this->getLayout()->createBlock( + $renderer = $this->getLayout()->createBlock( \Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset\Element::class ); $field->setRenderer($renderer); 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/Block/Widget/Grid/Column/Renderer/Country.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Country.php index 0871d82bf5e68..08152342ffce0 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Country.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Country.php @@ -9,7 +9,6 @@ */ namespace Magento\Backend\Block\Widget\Grid\Column\Renderer; - class Country extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer { /** diff --git a/app/code/Magento/Backend/Model/Config/SessionLifetime/BackendModel.php b/app/code/Magento/Backend/Model/Config/SessionLifetime/BackendModel.php index 2fc8eeac8c994..a4e828dafcc0e 100644 --- a/app/code/Magento/Backend/Model/Config/SessionLifetime/BackendModel.php +++ b/app/code/Magento/Backend/Model/Config/SessionLifetime/BackendModel.php @@ -26,7 +26,7 @@ public function beforeSave() throw new LocalizedException( __('Admin session lifetime must be less than or equal to 31536000 seconds (one year)') ); - } else if ($value < self::MIN_LIFETIME) { + } elseif ($value < self::MIN_LIFETIME) { throw new LocalizedException( __('Admin session lifetime must be greater than or equal to 60 seconds') ); diff --git a/app/code/Magento/Backend/Model/Locale/Manager.php b/app/code/Magento/Backend/Model/Locale/Manager.php index 7f2fa2d5e5a4c..52a5eeb401ec3 100644 --- a/app/code/Magento/Backend/Model/Locale/Manager.php +++ b/app/code/Magento/Backend/Model/Locale/Manager.php @@ -70,7 +70,7 @@ public function switchBackendInterfaceLocale($localeCode) } /** - * Get general interface locale + * Get general interface locale * * @return string */ diff --git a/app/code/Magento/Backend/Model/Menu/Item/Validator.php b/app/code/Magento/Backend/Model/Menu/Item/Validator.php index 720ef840986f3..33e14b4cbc346 100644 --- a/app/code/Magento/Backend/Model/Menu/Item/Validator.php +++ b/app/code/Magento/Backend/Model/Menu/Item/Validator.php @@ -82,8 +82,7 @@ public function validate($data) } foreach ($data as $param => $value) { - if ( - $data[$param] !== null + if ($data[$param] !== null && isset( $this->_validators[$param] ) && !$this->_validators[$param]->isValid( diff --git a/app/code/Magento/Backend/Model/View/Layout/ConditionInterface.php b/app/code/Magento/Backend/Model/View/Layout/ConditionInterface.php index 033ce511d8ec7..a1d59b151d802 100644 --- a/app/code/Magento/Backend/Model/View/Layout/ConditionInterface.php +++ b/app/code/Magento/Backend/Model/View/Layout/ConditionInterface.php @@ -19,7 +19,7 @@ * * * - * + * * Registered condition can be used by ui component declaration in layout * * diff --git a/app/code/Magento/Backend/Model/View/Layout/ConditionPool.php b/app/code/Magento/Backend/Model/View/Layout/ConditionPool.php index ff73b8c519824..8daff46271744 100644 --- a/app/code/Magento/Backend/Model/View/Layout/ConditionPool.php +++ b/app/code/Magento/Backend/Model/View/Layout/ConditionPool.php @@ -10,7 +10,7 @@ /** * Class ConditionPool - * + * * Registry for \Magento\Backend\Model\View\Layout\ConditionInterface * @see usage details in \Magento\Backend\Model\View\Layout\ConditionInterface description * diff --git a/app/code/Magento/Backend/Model/View/Layout/FilterInterface.php b/app/code/Magento/Backend/Model/View/Layout/FilterInterface.php index a1b0a302c0f66..2312cff829264 100644 --- a/app/code/Magento/Backend/Model/View/Layout/FilterInterface.php +++ b/app/code/Magento/Backend/Model/View/Layout/FilterInterface.php @@ -23,7 +23,7 @@ * * * - * + * */ interface FilterInterface { 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/Backend/Service/V1/ModuleService.php b/app/code/Magento/Backend/Service/V1/ModuleService.php index 9abd44752772a..0bd0e76c7907e 100644 --- a/app/code/Magento/Backend/Service/V1/ModuleService.php +++ b/app/code/Magento/Backend/Service/V1/ModuleService.php @@ -15,6 +15,7 @@ class ModuleService implements ModuleServiceInterface * @var \Magento\Framework\Module\ModuleListInterface */ protected $moduleList; + /** * @param \Magento\Framework\Module\ModuleListInterface $moduleList */ diff --git a/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php b/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php index 8f626dba2d024..6010cc78d8b8b 100644 --- a/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php +++ b/app/code/Magento/Backend/Test/Unit/App/Action/Plugin/AuthenticationTest.php @@ -120,7 +120,7 @@ public function testProcessNotLoggedInUser($isIFrameParam, $isAjaxParam, $isForw if ($isIFrameParam) { $getParamCalls = 1; $actionName = 'deniedIframe'; - } else if ($isAjaxParam) { + } elseif ($isAjaxParam) { $getParamCalls = 2; $actionName = 'deniedJson'; } else { diff --git a/app/code/Magento/Backend/Test/Unit/Block/Page/System/Config/Robots/ResetTest.php b/app/code/Magento/Backend/Test/Unit/Block/Page/System/Config/Robots/ResetTest.php index 2eba4779d91e6..59a6b3463f582 100644 --- a/app/code/Magento/Backend/Test/Unit/Block/Page/System/Config/Robots/ResetTest.php +++ b/app/code/Magento/Backend/Test/Unit/Block/Page/System/Config/Robots/ResetTest.php @@ -11,7 +11,7 @@ /** * Class ResetTest - * @deprecated + * @deprecated * @package Magento\Backend\Test\Unit\Block\Page\System\Config\Robots */ class ResetTest extends \PHPUnit_Framework_TestCase diff --git a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanStaticFilesTest.php b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanStaticFilesTest.php index d9ea144372445..175ea2664ded3 100644 --- a/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanStaticFilesTest.php +++ b/app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/Cache/CleanStaticFilesTest.php @@ -48,7 +48,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); $objectHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $context = $objectHelper->getObject( + $context = $objectHelper->getObject( \Magento\Backend\App\Action\Context::class, [ 'objectManager' => $this->objectManagerMock, @@ -58,7 +58,7 @@ protected function setUp() ] ); - $this->controller = $objectHelper->getObject( + $this->controller = $objectHelper->getObject( \Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles::class, ['context' => $context,] ); diff --git a/app/code/Magento/Backup/Model/Config/Backend/Cron.php b/app/code/Magento/Backup/Model/Config/Backend/Cron.php index 564f07b36be6f..5de9cf5627107 100644 --- a/app/code/Magento/Backup/Model/Config/Backend/Cron.php +++ b/app/code/Magento/Backup/Model/Config/Backend/Cron.php @@ -23,11 +23,9 @@ class Cron extends \Magento\Framework\App\Config\Value /** @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; - /** @var string */ protected $_runModelPath = ''; - /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry diff --git a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countries.php b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countries.php index 3483e081cf0c9..3be50ef2f8702 100644 --- a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countries.php +++ b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/Countries.php @@ -47,7 +47,7 @@ protected function _toHtml() /** * Sets name for input element - * + * * @param string $value * @return $this */ diff --git a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CountryCreditCard.php b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CountryCreditCard.php index c5f2ae5c73da5..8974e2d050f1a 100644 --- a/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CountryCreditCard.php +++ b/app/code/Magento/Braintree/Block/Adminhtml/Form/Field/CountryCreditCard.php @@ -25,7 +25,7 @@ class CountryCreditCard extends AbstractFieldArray /** * Returns renderer for country element - * + * * @return Countries */ protected function getCountryRenderer() @@ -42,7 +42,7 @@ protected function getCountryRenderer() /** * Returns renderer for country element - * + * * @return CcTypes */ protected function getCcTypesRenderer() 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/Controller/Adminhtml/Payment/GetNonce.php b/app/code/Magento/Braintree/Controller/Adminhtml/Payment/GetNonce.php index 8117d5c31f12a..4b69944797b03 100644 --- a/app/code/Magento/Braintree/Controller/Adminhtml/Payment/GetNonce.php +++ b/app/code/Magento/Braintree/Controller/Adminhtml/Payment/GetNonce.php @@ -5,7 +5,6 @@ */ namespace Magento\Braintree\Controller\Adminhtml\Payment; - /** * Class GetNonce */ diff --git a/app/code/Magento/Braintree/Controller/Payment/GetNonce.php b/app/code/Magento/Braintree/Controller/Payment/GetNonce.php index 5d771c3189a5e..cd767123c67c9 100644 --- a/app/code/Magento/Braintree/Controller/Payment/GetNonce.php +++ b/app/code/Magento/Braintree/Controller/Payment/GetNonce.php @@ -65,7 +65,6 @@ public function execute() $customerId = $this->session->getCustomerId(); $result = $this->command->execute(['public_hash' => $publicHash, 'customer_id' => $customerId])->get(); $response->setData(['paymentMethodNonce' => $result['paymentMethodNonce']]); - } catch (\Exception $e) { $this->logger->critical($e); return $this->processBadRequest($response); 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/Adminhtml/Source/PaymentAction.php b/app/code/Magento/Braintree/Model/Adminhtml/Source/PaymentAction.php index 7d35b00e5715d..d4b38807537a3 100644 --- a/app/code/Magento/Braintree/Model/Adminhtml/Source/PaymentAction.php +++ b/app/code/Magento/Braintree/Model/Adminhtml/Source/PaymentAction.php @@ -15,7 +15,7 @@ class PaymentAction implements ArrayInterface { /** * Possible actions on order place - * + * * @return array */ public function toOptionArray() diff --git a/app/code/Magento/Braintree/Model/Paypal/Helper/ShippingMethodUpdater.php b/app/code/Magento/Braintree/Model/Paypal/Helper/ShippingMethodUpdater.php index 55f48c95de271..171cb3565044b 100644 --- a/app/code/Magento/Braintree/Model/Paypal/Helper/ShippingMethodUpdater.php +++ b/app/code/Magento/Braintree/Model/Paypal/Helper/ShippingMethodUpdater.php @@ -53,10 +53,8 @@ public function execute($shippingMethod, Quote $quote) } if (!$quote->getIsVirtual()) { - $shippingAddress = $quote->getShippingAddress(); if ($shippingMethod !== $shippingAddress->getShippingMethod()) { - $this->disabledQuoteAddressValidation($quote); $shippingAddress->setShippingMethod($shippingMethod); diff --git a/app/code/Magento/Braintree/Model/Report/ConditionAppliers/MultipleValue.php b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/MultipleValue.php index df4700d4c25aa..17fb8e0190f3b 100644 --- a/app/code/Magento/Braintree/Model/Report/ConditionAppliers/MultipleValue.php +++ b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/MultipleValue.php @@ -24,7 +24,7 @@ public function apply($field, $condition, $value) { $result = false; - switch($condition) { + switch ($condition) { case ApplierInterface::IN: $field->in($value); $result = true; diff --git a/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Range.php b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Range.php index 5937425ee7a7f..bfe1120642003 100644 --- a/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Range.php +++ b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Range.php @@ -24,7 +24,7 @@ public function apply($field, $condition, $value) { $result = false; - switch($condition) { + switch ($condition) { case ApplierInterface::QTEQ: $field->greaterThanOrEqualTo($value); $result = true; diff --git a/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Text.php b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Text.php index fa7272be7f15e..ab27f117d89f1 100644 --- a/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Text.php +++ b/app/code/Magento/Braintree/Model/Report/ConditionAppliers/Text.php @@ -25,7 +25,7 @@ public function apply($field, $condition, $value) $result = false; $value = trim($value, "% \r\n\t"); - switch($condition) { + switch ($condition) { case ApplierInterface::EQ: $field->is($value); $result = true; diff --git a/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php b/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php index bb9c807c530ea..de1c4afc74434 100644 --- a/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php +++ b/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php @@ -119,7 +119,7 @@ public function getCustomAttributes() $output = []; foreach ($this->getMappedValues() as $key => $value) { $attribute = $this->attributeValueFactory->create(); - if(in_array($key, $shouldBeLocalized)) { + if (in_array($key, $shouldBeLocalized)) { $value = __($value); } $output[] = $attribute->setAttributeCode($key)->setValue($value); 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/Gateway/Request/PaymentDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php index 40d62a64790e7..21fbea73a3fb7 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php @@ -15,7 +15,7 @@ /** * Class PaymentDataBuilderTest - * + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class PaymentDataBuilderTest extends \PHPUnit_Framework_TestCase diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php index 7ceaadf40e644..c18b75d8a4986 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php @@ -187,7 +187,7 @@ public function testGetItemsWithNullLimit() /** * Add fields to filter - * + * * @dataProvider addToFilterDataProvider */ public function testAddToFilter($field, $condition, $filterMapperCall, $expectedCondition) @@ -211,7 +211,7 @@ public function testAddToFilter($field, $condition, $filterMapperCall, $expected /** * addToFilter DataProvider - * + * * @return array */ public function addToFilterDataProvider() 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..8be689f7db24e 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 @@ -39,7 +39,6 @@ class DateRangeTest extends \PHPUnit_Framework_TestCase */ private $filterModifierMock; - /** * @var DataProviderInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -81,6 +80,7 @@ protected function setUp() * @param array|null $expectedCondition * @dataProvider getPrepareDataProvider * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function testPrepare($name, $filterData, $expectedCondition) { @@ -181,12 +181,12 @@ public function testPrepare($name, $filterData, $expectedCondition) /** * Gets Filter mock - * + * * @param string $name * @param string $expectedType * @param string $expectedDate * @param int $i - * + * * @return Filter|\PHPUnit_Framework_MockObject_MockObject */ private function getFilterMock($name, $expectedType, $expectedDate, &$i) 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/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/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index 8253d84f07363..aae15b9ded321 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php @@ -115,7 +115,6 @@ public function isDisabledField() && $this->getAttribute()->getAttributeCode() === 'price' ) || $this->getElement()->getReadonly(); - } /** diff --git a/app/code/Magento/Bundle/Model/Link.php b/app/code/Magento/Bundle/Model/Link.php index 49ab21aadeca0..6bc966e64ef5a 100644 --- a/app/code/Magento/Bundle/Model/Link.php +++ b/app/code/Magento/Bundle/Model/Link.php @@ -43,7 +43,6 @@ public function setId($id) return $this->setData(self::KEY_ID, $id); } - /** * {@inheritdoc} */ diff --git a/app/code/Magento/Bundle/Model/Option.php b/app/code/Magento/Bundle/Model/Option.php index 84c5a3433e259..6db77c6515b9d 100644 --- a/app/code/Magento/Bundle/Model/Option.php +++ b/app/code/Magento/Bundle/Model/Option.php @@ -294,5 +294,6 @@ public function setExtensionAttributes(\Magento\Bundle\Api\Data\OptionExtensionI { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/Bundle/Model/OptionRepository.php b/app/code/Magento/Bundle/Model/OptionRepository.php index fa4a363f168c9..b86e41f1a43b0 100644 --- a/app/code/Magento/Bundle/Model/OptionRepository.php +++ b/app/code/Magento/Bundle/Model/OptionRepository.php @@ -276,8 +276,7 @@ private function compareLinks( } foreach ($firstArray as $obj) { foreach ($secondArray as $objToCompare) { - if ( - $obj->getId() != $objToCompare->getId() + if ($obj->getId() != $objToCompare->getId() && $obj instanceof \Magento\Bundle\Api\Data\LinkInterface && $objToCompare instanceof \Magento\Bundle\Api\Data\LinkInterface ) { diff --git a/app/code/Magento/Bundle/Model/Source/Option/Type.php b/app/code/Magento/Bundle/Model/Source/Option/Type.php index 2f5e6fe85e47b..d087b3c7c3861 100644 --- a/app/code/Magento/Bundle/Model/Source/Option/Type.php +++ b/app/code/Magento/Bundle/Model/Source/Option/Type.php @@ -78,6 +78,7 @@ public function toOptionArray() } //@codeCoverageIgnoreStart + /** * {@inheritdoc} */ @@ -136,5 +137,6 @@ public function setExtensionAttributes(\Magento\Bundle\Api\Data\OptionTypeExtens { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/Bundle/Setup/UpgradeSchema.php b/app/code/Magento/Bundle/Setup/UpgradeSchema.php index d80a7d5837a62..f0310c37431d5 100755 --- a/app/code/Magento/Bundle/Setup/UpgradeSchema.php +++ b/app/code/Magento/Bundle/Setup/UpgradeSchema.php @@ -23,7 +23,6 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con $setup->startSetup(); $connection = $setup->getConnection(); if (version_compare($context->getVersion(), '2.0.1', '<')) { - $fields = [ ['table' => 'catalog_product_index_price_bundle_opt_idx', 'column' => 'alt_group_price'], ['table' => 'catalog_product_index_price_bundle_opt_tmp', 'column' => 'alt_group_price'], diff --git a/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/Bundle/OptionTest.php b/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/Bundle/OptionTest.php index 39eb1d9188436..647ed885422bd 100644 --- a/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/Bundle/OptionTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Block/Catalog/Product/View/Type/Bundle/OptionTest.php @@ -51,7 +51,7 @@ protected function setUp() ->will($this->returnValue($this->layout)); $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->block = $objectManagerHelper->getObject( + $this->block = $objectManagerHelper->getObject( \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option::class, ['registry' => $registry, 'context' => $context] ); @@ -74,7 +74,7 @@ public function testSetOption() $otherOption = $this->getMock(\Magento\Bundle\Model\Option::class, [], [], '', false); $otherOption->expects($this->any())->method('getId')->will($this->returnValue(16)); - $selection = $this->getMock( + $selection = $this->getMock( \Magento\Catalog\Model\Product::class, ['getSelectionId', '__wakeup'], [], diff --git a/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php b/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php index ad0d6ee87a07c..efc12e42cc0c8 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/LinkManagementTest.php @@ -135,7 +135,7 @@ protected function setUp() ->setMethods(['appendSelections']) ->disableOriginalConstructor() ->getMock(); - $this->selectionCollection = $this->getMockBuilder( + $this->selectionCollection = $this->getMockBuilder( \Magento\Bundle\Model\ResourceModel\Selection\Collection::class) ->disableOriginalConstructor() ->getMock(); @@ -150,13 +150,13 @@ protected function setUp() ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); - $this->bundleSelectionMock = $this->getMock( + $this->bundleSelectionMock = $this->getMock( \Magento\Bundle\Model\SelectionFactory::class, ['create'], [], '', false ); - $this->bundleFactoryMock = $this->getMock( + $this->bundleFactoryMock = $this->getMock( \Magento\Bundle\Model\ResourceModel\BundleFactory::class, ['create'], [], '', false ); - $this->optionCollectionFactoryMock = $this->getMock( + $this->optionCollectionFactoryMock = $this->getMock( \Magento\Bundle\Model\ResourceModel\Option\CollectionFactory::class, ['create'], [], '', false ); $this->storeManagerMock = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class, [], [], '', false); @@ -173,7 +173,7 @@ protected function setUp() $this->dataObjectHelperMock = $this->getMockBuilder(\Magento\Framework\Api\DataObjectHelper::class) ->disableOriginalConstructor() ->getMock(); - $this->model = $helper->getObject( + $this->model = $helper->getObject( LinkManagement::class, [ @@ -322,7 +322,7 @@ public function testAddChildNonExistingOption() ->method('getId') ->will($this->returnValue(null)); - $optionsCollectionMock = $this->getMock( + $optionsCollectionMock = $this->getMock( \Magento\Bundle\Model\ResourceModel\Option\Collection::class, [], [], '', false ); $optionsCollectionMock->expects($this->once()) @@ -377,7 +377,7 @@ public function testAddChildLinkedProductIsComposite() ->getMock(); $option->expects($this->once())->method('getId')->will($this->returnValue(1)); - $optionsCollectionMock = $this->getMock( + $optionsCollectionMock = $this->getMock( \Magento\Bundle\Model\ResourceModel\Option\Collection::class, [], [], @@ -439,7 +439,7 @@ public function testAddChildProductAlreadyExistsInOption() ->getMock(); $option->expects($this->once())->method('getId')->will($this->returnValue(1)); - $optionsCollectionMock = $this->getMock( + $optionsCollectionMock = $this->getMock( \Magento\Bundle\Model\ResourceModel\Option\Collection::class, [], [], @@ -488,7 +488,6 @@ public function testAddChildCouldNotSave() ->with($this->linkField) ->willReturn($this->linkField); - $linkedProductMock = $this->getMock(\Magento\Catalog\Model\Product::class, [], [], '', false); $linkedProductMock->expects($this->any())->method('getId')->will($this->returnValue(13)); $linkedProductMock->expects($this->once())->method('isComposite')->will($this->returnValue(false)); @@ -507,7 +506,7 @@ public function testAddChildCouldNotSave() ->getMock(); $option->expects($this->once())->method('getId')->will($this->returnValue(1)); - $optionsCollectionMock = $this->getMock( + $optionsCollectionMock = $this->getMock( \Magento\Bundle\Model\ResourceModel\Option\Collection::class, [], [], '', false ); $optionsCollectionMock->expects($this->once()) @@ -578,7 +577,7 @@ public function testAddChild() ->getMock(); $option->expects($this->once())->method('getId')->will($this->returnValue(1)); - $optionsCollectionMock = $this->getMock( + $optionsCollectionMock = $this->getMock( \Magento\Bundle\Model\ResourceModel\Option\Collection::class, [], [], '', false ); $optionsCollectionMock->expects($this->once()) @@ -663,7 +662,7 @@ public function testSaveChild() $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($store)); $store->expects($this->any())->method('getId')->will($this->returnValue(0)); - $selection = $this->getMock( + $selection = $this->getMock( \Magento\Bundle\Model\Selection::class, [ 'save', @@ -737,7 +736,7 @@ public function testSaveChildFailedToSave() $this->storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($store)); $store->expects($this->any())->method('getId')->will($this->returnValue(0)); - $selection = $this->getMock( + $selection = $this->getMock( \Magento\Bundle\Model\Selection::class, [ 'save', @@ -831,7 +830,7 @@ public function testSaveChildWithInvalidId() ->with($linkedProductSku) ->will($this->returnValue($linkedProductMock)); - $selection = $this->getMock( + $selection = $this->getMock( \Magento\Bundle\Model\Selection::class, [ 'getId', diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php index 7d1eee7ea132a..24ff1a14d9f7e 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/Product/TypeTest.php @@ -1834,7 +1834,6 @@ public function testIsVirtual() * @param int $getSelectionsIdsIndex * @return \PHPUnit_Framework_MockObject_MockObject */ - protected function getSelectionsByIdsMock($selectionIds, $productMock, $getSelectionsIndex, $getSelectionsIdsIndex) { $usedSelectionsMock = $this->getMockBuilder(\Magento\Bundle\Model\ResourceModel\Selection\Collection::class) diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/DiscountCalculatorTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/DiscountCalculatorTest.php index 0322f83d35b0f..b89edd5884f9d 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/DiscountCalculatorTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/DiscountCalculatorTest.php @@ -43,29 +43,29 @@ class DiscountCalculatorTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->productMock = $this->getMock( + $this->productMock = $this->getMock( \Magento\Catalog\Model\Product::class, [], [], '', false ); - $this->priceInfoMock = $this->getMock( + $this->priceInfoMock = $this->getMock( \Magento\Framework\Pricing\PriceInfo\Base::class, ['getPrice', 'getPrices'], [], '', false ); - $this->finalPriceMock = $this->getMock( + $this->finalPriceMock = $this->getMock( \Magento\Catalog\Pricing\Price\FinalPrice::class, [], [], '', false ); - $this->priceMock = $this->getMockForAbstractClass( - \Magento\Bundle\Pricing\Price\DiscountProviderInterface::class + $this->priceMock = $this->getMockForAbstractClass( + \Magento\Bundle\Pricing\Price\DiscountProviderInterface::class ); $this->calculator = new \Magento\Bundle\Pricing\Price\DiscountCalculator(); } diff --git a/app/code/Magento/CacheInvalidate/Model/SocketFactory.php b/app/code/Magento/CacheInvalidate/Model/SocketFactory.php index 94747a2f70571..993b645d6df77 100644 --- a/app/code/Magento/CacheInvalidate/Model/SocketFactory.php +++ b/app/code/Magento/CacheInvalidate/Model/SocketFactory.php @@ -7,7 +7,6 @@ class SocketFactory { - /** * @return \Zend\Http\Client\Adapter\Socket */ diff --git a/app/code/Magento/CacheInvalidate/Observer/InvalidateVarnishObserver.php b/app/code/Magento/CacheInvalidate/Observer/InvalidateVarnishObserver.php index d3b6f5451b197..47c54a5a2c893 100644 --- a/app/code/Magento/CacheInvalidate/Observer/InvalidateVarnishObserver.php +++ b/app/code/Magento/CacheInvalidate/Observer/InvalidateVarnishObserver.php @@ -65,7 +65,6 @@ public function execute(\Magento\Framework\Event\Observer $observer) if (!empty($tags)) { $this->purgeCache->sendPurgeRequest(implode('|', array_unique($tags))); } - } } diff --git a/app/code/Magento/CacheInvalidate/Test/Unit/Model/SocketFactoryTest.php b/app/code/Magento/CacheInvalidate/Test/Unit/Model/SocketFactoryTest.php index 45729089f732f..4c3c4811fda77 100644 --- a/app/code/Magento/CacheInvalidate/Test/Unit/Model/SocketFactoryTest.php +++ b/app/code/Magento/CacheInvalidate/Test/Unit/Model/SocketFactoryTest.php @@ -7,7 +7,6 @@ class SocketFactoryTest extends \PHPUnit_Framework_TestCase { - public function testCreate() { $factory = new \Magento\CacheInvalidate\Model\SocketFactory(); diff --git a/app/code/Magento/Captcha/Model/DefaultModel.php b/app/code/Magento/Captcha/Model/DefaultModel.php index a977ad6923611..da72abb862b6f 100644 --- a/app/code/Magento/Captcha/Model/DefaultModel.php +++ b/app/code/Magento/Captcha/Model/DefaultModel.php @@ -117,8 +117,7 @@ public function getBlockName() */ public function isRequired($login = null) { - if ( - $this->isUserAuth() + if ($this->isUserAuth() && !$this->isShownToLoggedInUser() || !$this->isEnabled() || !in_array( @@ -425,8 +424,7 @@ private function isShowAlways() return true; } - if ( - (string)$this->captchaData->getConfig('mode') == \Magento\Captcha\Helper\Data::MODE_AFTER_FAIL + if ((string)$this->captchaData->getConfig('mode') == \Magento\Captcha\Helper\Data::MODE_AFTER_FAIL && $this->getAllowedAttemptsForSameLogin() == 0 ) { return true; diff --git a/app/code/Magento/Captcha/Observer/CheckGuestCheckoutObserver.php b/app/code/Magento/Captcha/Observer/CheckGuestCheckoutObserver.php index 045397988a467..85ee15f7f61d8 100644 --- a/app/code/Magento/Captcha/Observer/CheckGuestCheckoutObserver.php +++ b/app/code/Magento/Captcha/Observer/CheckGuestCheckoutObserver.php @@ -69,8 +69,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) if ($checkoutMethod == \Magento\Checkout\Model\Type\Onepage::METHOD_GUEST) { if ($captchaModel->isRequired()) { $controller = $observer->getControllerAction(); - if ( - !$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId)) + if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId)) ) { $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $result = ['error' => 1, 'message' => __('Incorrect CAPTCHA')]; diff --git a/app/code/Magento/Captcha/Observer/CheckRegisterCheckoutObserver.php b/app/code/Magento/Captcha/Observer/CheckRegisterCheckoutObserver.php index 2c9f698f835a9..fc0dc515a1806 100644 --- a/app/code/Magento/Captcha/Observer/CheckRegisterCheckoutObserver.php +++ b/app/code/Magento/Captcha/Observer/CheckRegisterCheckoutObserver.php @@ -69,8 +69,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) if ($checkoutMethod == \Magento\Checkout\Model\Type\Onepage::METHOD_REGISTER) { if ($captchaModel->isRequired()) { $controller = $observer->getControllerAction(); - if ( - !$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId)) + if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId)) ) { $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); $result = ['error' => 1, 'message' => __('Incorrect CAPTCHA')]; diff --git a/app/code/Magento/Captcha/Observer/CheckUserForgotPasswordBackendObserver.php b/app/code/Magento/Captcha/Observer/CheckUserForgotPasswordBackendObserver.php index f4e20045156d7..a262b0afa09c6 100644 --- a/app/code/Magento/Captcha/Observer/CheckUserForgotPasswordBackendObserver.php +++ b/app/code/Magento/Captcha/Observer/CheckUserForgotPasswordBackendObserver.php @@ -71,8 +71,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) $params = $observer->getControllerAction()->getRequest()->getParams(); if (!empty($email) && !empty($params)) { if ($captchaModel->isRequired()) { - if ( - !$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId)) + if (!$captchaModel->isCorrect($this->captchaStringResolver->resolve($controller->getRequest(), $formId)) ) { $this->_session->setEmail((string)$controller->getRequest()->getPost('email')); $this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true); diff --git a/app/code/Magento/Captcha/Observer/ResetAttemptForBackendObserver.php b/app/code/Magento/Captcha/Observer/ResetAttemptForBackendObserver.php index 9952180ef9316..1ef0c82f5d160 100644 --- a/app/code/Magento/Captcha/Observer/ResetAttemptForBackendObserver.php +++ b/app/code/Magento/Captcha/Observer/ResetAttemptForBackendObserver.php @@ -23,7 +23,6 @@ public function __construct( $this->resLogFactory = $resLogFactory; } - /** * Reset Attempts For Backend * diff --git a/app/code/Magento/Captcha/Setup/InstallSchema.php b/app/code/Magento/Captcha/Setup/InstallSchema.php index 9d2f843da686d..52c2cfc7b41d2 100644 --- a/app/code/Magento/Captcha/Setup/InstallSchema.php +++ b/app/code/Magento/Captcha/Setup/InstallSchema.php @@ -56,6 +56,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/Catalog/Api/Data/ProductAttributeMediaGalleryEntryInterface.php b/app/code/Magento/Catalog/Api/Data/ProductAttributeMediaGalleryEntryInterface.php index 5bd1ca06ea969..76cd5bbfd9e1a 100644 --- a/app/code/Magento/Catalog/Api/Data/ProductAttributeMediaGalleryEntryInterface.php +++ b/app/code/Magento/Catalog/Api/Data/ProductAttributeMediaGalleryEntryInterface.php @@ -139,7 +139,7 @@ public function getContent(); * Set media gallery content * * @param $content \Magento\Framework\Api\Data\ImageContentInterface - * @return $this + * @return $this */ public function setContent($content); diff --git a/app/code/Magento/Catalog/Api/ProductCustomOptionRepositoryInterface.php b/app/code/Magento/Catalog/Api/ProductCustomOptionRepositoryInterface.php index 8c8e3217bee1b..411fd053595ab 100644 --- a/app/code/Magento/Catalog/Api/ProductCustomOptionRepositoryInterface.php +++ b/app/code/Magento/Catalog/Api/ProductCustomOptionRepositoryInterface.php @@ -29,7 +29,6 @@ public function getProductOptions( $requiredOnly = false ); - /** * Get custom option for a specific product * diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php index c76835456bf10..41ae63bc87d9e 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts.php @@ -25,7 +25,7 @@ class Alerts extends \Magento\Backend\Block\Widget\Tab */ protected function _prepareLayout() { - $accordion = $this->getLayout()->createBlock( + $accordion = $this->getLayout()->createBlock( \Magento\Backend\Block\Widget\Accordion::class)->setId('productAlerts'); /* @var $accordion \Magento\Backend\Block\Widget\Accordion */ diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php index 5c1571992db46..b320dbaa931df 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php @@ -4,7 +4,6 @@ * See COPYING.txt for license details. */ - /** * Sign up for an alert when the product price changes grid * diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php index 23492d6d16f93..3ce4cec41816c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php @@ -4,7 +4,6 @@ * See COPYING.txt for license details. */ - /** * Sign up for an alert when the product price changes grid * diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php index cde6e6af44538..a842ec9083932 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php @@ -125,7 +125,7 @@ public function getAfterElementHtml() $selectorOptions = $this->_jsonEncoder->encode($this->_getSelectorOptions()); $newCategoryCaption = __('New Category'); - $button = $this->_layout->createBlock( + $button = $this->_layout->createBlock( \Magento\Backend\Block\Widget\Button::class )->setData( [ diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index 72f1009d115bc..0d87a6a141901 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -104,6 +104,7 @@ public function __construct( $data ); } + // @codingStandardsIgnoreEnd /** diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php index dc77ca29108b1..9cfc1251116f5 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php @@ -5,7 +5,6 @@ */ namespace Magento\Catalog\Block\Product\View\Options\Type; - /** * Product options text type block * diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php index f4f0154e0dedd..1c27a8a7f7d0f 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php @@ -364,7 +364,6 @@ protected function getRedirectParams($isNewCategory, $hasError, $categoryId, $pa } else { $path = 'catalog/*/edit'; $params['id'] = $categoryId; - } return ['path' => $path, 'params' => $params]; } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php index 35733ad629467..8a83601e9a7e9 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Action/Attribute.php @@ -50,7 +50,7 @@ protected function _validateProducts() $productIds = $this->attributeHelper->getProductIds(); if (!is_array($productIds)) { $error = __('Please select products for attributes update.'); - } elseif (!$this->_objectManager->create( + } elseif (!$this->_objectManager->create( \Magento\Catalog\Model\Product::class)->isProductsHasSku($productIds)) { $error = __('Please make sure to define SKU values for all processed products.'); } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AlertsPriceGrid.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AlertsPriceGrid.php index 3b370edc27008..afc62e70db3a6 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AlertsPriceGrid.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AlertsPriceGrid.php @@ -6,7 +6,6 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Product; - class AlertsPriceGrid extends AbstractProductGrid { /** diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Edit.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Edit.php index 0b1df5ec4d1a6..77c0c88678fa2 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Edit.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Edit.php @@ -54,7 +54,7 @@ public function execute() $resultRedirect = $this->resultRedirectFactory->create(); $this->messageManager->addError(__('This product doesn\'t exist.')); return $resultRedirect->setPath('catalog/*/'); - } else if ($productId === 0) { + } elseif ($productId === 0) { /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $this->messageManager->addError(__('Invalid product id. Should be numeric value greater than 0')); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/GridOnly.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/GridOnly.php index 07bda43edd030..1706b23892170 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/GridOnly.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/GridOnly.php @@ -34,6 +34,7 @@ public function __construct( $this->resultRawFactory = $resultRawFactory; $this->layoutFactory = $layoutFactory; } + /** * Get specified tab grid * diff --git a/app/code/Magento/Catalog/Cron/RefreshSpecialPrices.php b/app/code/Magento/Catalog/Cron/RefreshSpecialPrices.php index 5e04b026db3d4..dd1e7d38ec0fb 100644 --- a/app/code/Magento/Catalog/Cron/RefreshSpecialPrices.php +++ b/app/code/Magento/Catalog/Cron/RefreshSpecialPrices.php @@ -169,7 +169,6 @@ protected function _refreshSpecialPriceByStore($storeId, $attrCode, $attrConditi if (!empty($selectData)) { $this->_processor->getIndexer()->reindexList($selectData); } - } /** diff --git a/app/code/Magento/Catalog/Helper/Data.php b/app/code/Magento/Catalog/Helper/Data.php index 15813eebb969f..ec8190c695263 100644 --- a/app/code/Magento/Catalog/Helper/Data.php +++ b/app/code/Magento/Catalog/Helper/Data.php @@ -272,7 +272,6 @@ public function setStoreId($store) public function getBreadcrumbPath() { if (!$this->_categoryPath) { - $path = []; $category = $this->getCategory(); if ($category) { diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index 6fa3ec2adb7cf..fcd6de3c11389 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -432,7 +432,7 @@ public function placeholder($fileName) * * @param null|string $placeholder * @return string - * + * * @deprecated Returns only default placeholder. * Does not take into account custom placeholders set in Configuration. */ @@ -543,7 +543,7 @@ public function getResizedImageInfo() /** * @param null|string $placeholder * @return string - * + * * @deprecated Returns only default placeholder. * Does not take into account custom placeholders set in Configuration. */ diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 0b02e075d432e..9b4ffe188c9e8 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1219,6 +1219,7 @@ public function getChildrenData() { return $this->getData(self::KEY_CHILDREN_DATA); } + //@codeCoverageIgnoreEnd /** @@ -1411,5 +1412,6 @@ public function setExtensionAttributes(\Magento\Catalog\Api\Data\CategoryExtensi { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/Catalog/Model/Category/Attribute.php b/app/code/Magento/Catalog/Model/Category/Attribute.php index 94a108c063f51..9d0c8c256c655 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute.php @@ -324,6 +324,7 @@ public function setIsVisible($isVisible) { return $this->setData(self::IS_VISIBLE, $isVisible); } + //@codeCoverageIgnoreEnd /** diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php index 455a006098932..a061f34e54d85 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php @@ -97,7 +97,7 @@ public function beforeSave($object) if ($imageName = $this->getUploadedImageName($value)) { $object->setData($this->additionalData . $attributeName, $value); $object->setData($attributeName, $imageName); - } else if (!is_string($value)) { + } elseif (!is_string($value)) { $object->setData($attributeName, ''); } diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Sortby.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Sortby.php index d18146ebae85e..fcaaff7502504 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Sortby.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Sortby.php @@ -121,7 +121,6 @@ public function afterLoad($object) } else { $object->setData($attributeCode, $data); } - } } return $this; diff --git a/app/code/Magento/Catalog/Model/Category/DataProvider.php b/app/code/Magento/Catalog/Model/Category/DataProvider.php index 3718ce85e1681..ee0a3f65925e8 100644 --- a/app/code/Magento/Catalog/Model/Category/DataProvider.php +++ b/app/code/Magento/Catalog/Model/Category/DataProvider.php @@ -209,8 +209,7 @@ private function addUseDefaultValueCheckbox(Category $category, array $meta) && $category->getStoreId(); $attributePath = $this->getArrayManager()->findPath($attributeCode, $meta); - if ( - !$attributePath + if (!$attributePath || !$canDisplayUseDefault || in_array($attributeCode, $this->elementsWithUseConfigSetting) ) { diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php index f622e7b6bb32b..25347d5dd7c46 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php @@ -47,7 +47,7 @@ public function execute(array $entityIds = [], $useTempTable = false) /** * Register affected products - * + * * @param array $entityIds * @return void */ 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/Catalog/Model/Layer/FilterList.php b/app/code/Magento/Catalog/Model/Layer/FilterList.php index 19d728b04a545..b79516f71705a 100644 --- a/app/code/Magento/Catalog/Model/Layer/FilterList.php +++ b/app/code/Magento/Catalog/Model/Layer/FilterList.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Model\Layer; - class FilterList { const CATEGORY_FILTER = 'category'; diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index d88f9e0c44307..ab2f666d30f4c 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -541,6 +541,7 @@ public function getName() { return $this->_getData(self::NAME); } + //@codeCoverageIgnoreEnd /** @@ -619,6 +620,7 @@ public function getTypeId() { return $this->_getData(self::TYPE_ID); } + //@codeCoverageIgnoreEnd /** @@ -2520,6 +2522,7 @@ public function setExtensionAttributes(\Magento\Catalog\Api\Data\ProductExtensio { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd /** @@ -2568,7 +2571,6 @@ public function setMediaGalleryEntries(array $mediaGalleryEntries = null) ->convertFrom($entry); } $this->setData('media_gallery', ['images' => $images]); - } return $this; } diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Weight.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Weight.php index 495c62b429365..6be70d3d0bcfd 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Weight.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Weight.php @@ -19,7 +19,6 @@ class Weight extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend */ protected $localeFormat; - /** * @param \Magento\Framework\Locale\FormatInterface $localeFormat */ @@ -27,7 +26,6 @@ public function __construct( \Magento\Framework\Locale\FormatInterface $localeFormat ) { $this->localeFormat = $localeFormat; - } /** diff --git a/app/code/Magento/Catalog/Model/Product/CatalogPrice.php b/app/code/Magento/Catalog/Model/Product/CatalogPrice.php index d589116245d68..64def8ba0415b 100644 --- a/app/code/Magento/Catalog/Model/Product/CatalogPrice.php +++ b/app/code/Magento/Catalog/Model/Product/CatalogPrice.php @@ -5,7 +5,6 @@ */ namespace Magento\Catalog\Model\Product; - /** * Price model for external catalogs */ diff --git a/app/code/Magento/Catalog/Model/Product/Option.php b/app/code/Magento/Catalog/Model/Product/Option.php index 50f7a20ef789e..2b43f25f0a402 100644 --- a/app/code/Magento/Catalog/Model/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Product/Option.php @@ -4,7 +4,6 @@ * See COPYING.txt for license details. */ - namespace Magento\Catalog\Model\Product; use Magento\Catalog\Api\Data\ProductCustomOptionInterface; @@ -912,5 +911,6 @@ private function getMetadataPool() } return $this->metadataPool; } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/Catalog/Model/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Product/Option/Value.php index eaa0e9b386483..512b6869830ae 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Value.php @@ -172,6 +172,7 @@ public function setProduct($product) $this->_product = $product; return $this; } + //@codeCoverageIgnoreEnd /** @@ -366,6 +367,7 @@ public function getOptionTypeId() { return $this->_getData(self::KEY_OPTION_TYPE_ID); } + /** * Set option title * @@ -431,5 +433,6 @@ public function setOptionTypeId($optionTypeId) { return $this->setData(self::KEY_OPTION_TYPE_ID, $optionTypeId); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/Catalog/Model/Product/Price/Validation/TierPriceValidator.php b/app/code/Magento/Catalog/Model/Product/Price/Validation/TierPriceValidator.php index b39423c8894de..054129cd7d00f 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/Validation/TierPriceValidator.php +++ b/app/code/Magento/Catalog/Model/Product/Price/Validation/TierPriceValidator.php @@ -214,8 +214,7 @@ private function checkSku( */ private function checkPrice(\Magento\Catalog\Api\Data\TierPriceInterface $price, $key, Result $validationResult) { - if ( - null === $price->getPrice() + if (null === $price->getPrice() || $price->getPrice() < 0 || ($price->getPriceType() === \Magento\Catalog\Api\Data\TierPriceInterface::PRICE_TYPE_DISCOUNT && $price->getPrice() > 100 @@ -260,14 +259,13 @@ private function checkPriceType( $key, Result $validationResult ) { - if ( - !in_array( - $price->getPriceType(), - [ + if (!in_array( + $price->getPriceType(), + [ \Magento\Catalog\Api\Data\TierPriceInterface::PRICE_TYPE_FIXED, \Magento\Catalog\Api\Data\TierPriceInterface::PRICE_TYPE_DISCOUNT ] - ) + ) || (array_search(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE, $ids) && $price->getPriceType() !== \Magento\Catalog\Api\Data\TierPriceInterface::PRICE_TYPE_DISCOUNT) ) { diff --git a/app/code/Magento/Catalog/Model/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Model/Product/ProductList/Toolbar.php index c3e7d41892e35..151ad97cf9cb6 100644 --- a/app/code/Magento/Catalog/Model/Product/ProductList/Toolbar.php +++ b/app/code/Magento/Catalog/Model/Product/ProductList/Toolbar.php @@ -90,6 +90,7 @@ public function getLimit() { return $this->request->getParam(self::LIMIT_PARAM_NAME); } + /** * Return current page from request * diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php b/app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php index 8d61a8f46abc6..f6666474a7ac4 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php @@ -617,6 +617,7 @@ public function getIsVisible() { return $this->getData(self::IS_VISIBLE); } + //@codeCoverageIgnoreEnd /** diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/ResourceModel/Layer/Filter/Price.php index a8b7bf2960185..0c3d0a3937bfa 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Layer/Filter/Price.php @@ -115,10 +115,10 @@ protected function _getSelect() // remove join with main table $fromPart = $select->getPart(\Magento\Framework\DB\Select::FROM); if (!isset( - $fromPart[\Magento\Catalog\Model\ResourceModel\Product\Collection::INDEX_TABLE_ALIAS] - ) || !isset( - $fromPart[\Magento\Catalog\Model\ResourceModel\Product\Collection::MAIN_TABLE_ALIAS] - ) + $fromPart[\Magento\Catalog\Model\ResourceModel\Product\Collection::INDEX_TABLE_ALIAS] + ) || !isset( + $fromPart[\Magento\Catalog\Model\ResourceModel\Product\Collection::MAIN_TABLE_ALIAS] + ) ) { return $select; } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/CategoryLink.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/CategoryLink.php index 6b481c95583f7..52ecfa064f4f9 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/CategoryLink.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/CategoryLink.php @@ -30,8 +30,7 @@ class CategoryLink * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool * @param ResourceConnection $resourceConnection */ - public function __construct - ( + public function __construct( \Magento\Framework\EntityManager\MetadataPool $metadataPool, ResourceConnection $resourceConnection ) { diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Option.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Option.php index da3227da75087..a9917df4c5c61 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Option.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Option.php @@ -260,7 +260,6 @@ protected function _saveValueTitles(\Magento\Framework\Model\AbstractModel $obje if ($existInCurrentStore) { if ($isDeleteStoreTitle && (int)$storeId != \Magento\Store\Model\Store::DEFAULT_STORE_ID) { $connection->delete($titleTableName, ['option_title_id = ?' => $existInCurrentStore]); - } elseif ($object->getStoreId() == $storeId) { $data = $this->_prepareDataForTable( new \Magento\Framework\DataObject(['title' => $object->getTitle()]), @@ -277,8 +276,7 @@ protected function _saveValueTitles(\Magento\Framework\Model\AbstractModel $obje } } else { // we should insert record into not default store only of if it does not exist in default store - if ( - ($storeId == \Magento\Store\Model\Store::DEFAULT_STORE_ID && !$existInDefaultStore) || + if (($storeId == \Magento\Store\Model\Store::DEFAULT_STORE_ID && !$existInDefaultStore) || ( $storeId != \Magento\Store\Model\Store::DEFAULT_STORE_ID && !$existInCurrentStore && diff --git a/app/code/Magento/Catalog/Setup/InstallSchema.php b/app/code/Magento/Catalog/Setup/InstallSchema.php index 31cb143396dd4..642970de44609 100644 --- a/app/code/Magento/Catalog/Setup/InstallSchema.php +++ b/app/code/Magento/Catalog/Setup/InstallSchema.php @@ -4273,6 +4273,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/Catalog/Setup/UpgradeData.php b/app/code/Magento/Catalog/Setup/UpgradeData.php index 7ffb345202836..32543ec76b233 100644 --- a/app/code/Magento/Catalog/Setup/UpgradeData.php +++ b/app/code/Magento/Catalog/Setup/UpgradeData.php @@ -389,7 +389,6 @@ private function dissallowUsingHtmlForProductName(ModuleDataSetupInterface $setu ['is_html_allowed_on_front' => 0], $setup->getConnection()->quoteInto('attribute_id = ?', $attribute['attribute_id']) ); - } /** @@ -407,7 +406,6 @@ private function changePriceAttributeDefaultScope($categorySetup) 'is_global', \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL ); - } } } diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Category/AbstractCategoryTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Category/AbstractCategoryTest.php index f22f7f50859a2..e7034411548c4 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Category/AbstractCategoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Category/AbstractCategoryTest.php @@ -106,7 +106,6 @@ public function testGetSaveUrl() $saveUrl = 'save URL'; $params = ['_current' => false, '_query' => false, 'store' => $storeId]; - $this->requestMock->expects($this->once())->method('getParam')->with('store')->willReturn($storeId); $this->storeManagerMock->expects($this->once()) ->method('getStore') diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Product/Compare/IndexTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Product/Compare/IndexTest.php index b96de53e2b23e..ea80848f7392a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Product/Compare/IndexTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Product/Compare/IndexTest.php @@ -69,7 +69,7 @@ class IndexTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->contextMock = $this->getMock( + $this->contextMock = $this->getMock( \Magento\Framework\App\Action\Context::class, ['getRequest', 'getResponse', 'getResultRedirectFactory'], [], @@ -78,7 +78,7 @@ protected function setUp() ); $this->request = $this->getMock(\Magento\Framework\App\RequestInterface::class, [], [], '', false); $this->response = $this->getMock(\Magento\Framework\App\ResponseInterface::class, [], [], '', false); - $this->redirectFactoryMock = $this->getMock( + $this->redirectFactoryMock = $this->getMock( \Magento\Framework\Controller\Result\RedirectFactory::class, ['create'], [], @@ -91,14 +91,14 @@ protected function setUp() ->method('getResultRedirectFactory') ->willReturn($this->redirectFactoryMock); - $this->itemFactoryMock = $this->getMock( + $this->itemFactoryMock = $this->getMock( \Magento\Catalog\Model\Product\Compare\ItemFactory::class, ['create'], [], '', false ); - $this->collectionFactoryMock = $this->getMock( + $this->collectionFactoryMock = $this->getMock( \Magento\Catalog\Model\ResourceModel\Product\Compare\Item\CollectionFactory::class, ['create'], [], @@ -107,19 +107,19 @@ protected function setUp() ); $this->sessionMock = $this->getMock(\Magento\Customer\Model\Session::class, [], [], '', false); $this->visitorMock = $this->getMock(\Magento\Customer\Model\Visitor::class, [], [], '', false); - $this->listCompareMock = $this->getMock( - \Magento\Catalog\Model\Product\Compare\ListCompare::class, - [], - [], - '', - false + $this->listCompareMock = $this->getMock( + \Magento\Catalog\Model\Product\Compare\ListCompare::class, + [], + [], + '', + false ); - $this->catalogSession = $this->getMock( - \Magento\Catalog\Model\Session::class, - ['setBeforeCompareUrl'], - [], - '', - false + $this->catalogSession = $this->getMock( + \Magento\Catalog\Model\Session::class, + ['setBeforeCompareUrl'], + [], + '', + false ); $this->storeManagerMock = $this->getMock(\Magento\Store\Model\StoreManagerInterface::class); $this->formKeyValidatorMock = $this->getMockBuilder(\Magento\Framework\Data\Form\FormKey\Validator::class) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/CustomlayoutupdateTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/CustomlayoutupdateTest.php index da29c3d8ca14e..99ccaded0df84 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/CustomlayoutupdateTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/CustomlayoutupdateTest.php @@ -57,7 +57,7 @@ public function validateProvider() protected function setUp() { $helper = new ObjectManager($this); - $this->model = $helper->getObject( + $this->model = $helper->getObject( \Magento\Catalog\Model\Attribute\Backend\Customlayoutupdate::class, [ 'layoutUpdateValidatorFactory' => $this->getMockedLayoutUpdateValidatorFactory() diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/SortbyTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/SortbyTest.php index 62c0fc6d9f535..ed000abef366f 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/SortbyTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/SortbyTest.php @@ -37,11 +37,11 @@ protected function setUp() $this->markTestSkipped('Due to MAGETWO-48956'); $this->_objectHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->_scopeConfig = $this->getMock(\Magento\Framework\App\Config\ScopeConfigInterface::class); - $this->_model = $this->_objectHelper->getObject( + $this->_model = $this->_objectHelper->getObject( \Magento\Catalog\Model\Category\Attribute\Backend\Sortby::class, ['scopeConfig' => $this->_scopeConfig] ); - $this->_attribute = $this->getMock( + $this->_attribute = $this->getMock( \Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class, [ 'getName', @@ -196,7 +196,7 @@ public function testValidateUnique() $this->_attribute->expects($this->at(1))->method('getIsRequired'); $this->_attribute->expects($this->at(2))->method('getIsUnique')->will($this->returnValue(true)); - $entityMock = $this->getMockForAbstractClass( + $entityMock = $this->getMockForAbstractClass( \Magento\Eav\Model\Entity\AbstractEntity::class, [], '', @@ -219,7 +219,7 @@ public function testValidateUniqueException() $this->_attribute->expects($this->at(1))->method('getIsRequired'); $this->_attribute->expects($this->at(2))->method('getIsUnique')->will($this->returnValue(true)); - $entityMock = $this->getMockForAbstractClass( + $entityMock = $this->getMockForAbstractClass( \Magento\Eav\Model\Entity\AbstractEntity::class, [], '', @@ -228,7 +228,7 @@ public function testValidateUniqueException() true, ['checkAttributeUniqueValue'] ); - $frontMock = $this->getMockForAbstractClass( + $frontMock = $this->getMockForAbstractClass( \Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend::class, [], '', diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/TreeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/TreeTest.php index 703c9f3bf5c23..195ad8997ead7 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/TreeTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/TreeTest.php @@ -49,17 +49,17 @@ protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->categoryTreeMock = $this->getMockBuilder( + $this->categoryTreeMock = $this->getMockBuilder( \Magento\Catalog\Model\ResourceModel\Category\Tree::class )->disableOriginalConstructor() ->getMock(); - $this->categoryCollection = $this->getMockBuilder( + $this->categoryCollection = $this->getMockBuilder( \Magento\Catalog\Model\ResourceModel\Category\Collection::class )->disableOriginalConstructor() ->getMock(); - $this->storeManagerMock = $this->getMockBuilder( + $this->storeManagerMock = $this->getMockBuilder( \Magento\Store\Model\StoreManagerInterface::class )->disableOriginalConstructor() ->getMock(); @@ -69,7 +69,7 @@ protected function setUp() $this->getMock(\Magento\Catalog\Api\Data\CategoryTreeInterfaceFactory::class, $methods, [], '', false); $this->tree = $this->objectManager - ->getObject( + ->getObject( \Magento\Catalog\Model\Category\Tree::class, [ 'categoryCollection' => $this->categoryCollection, @@ -82,13 +82,13 @@ protected function setUp() public function testGetNode() { - $category = $this->getMockBuilder( + $category = $this->getMockBuilder( \Magento\Catalog\Model\Category::class )->disableOriginalConstructor() ->getMock(); $category->expects($this->exactly(2))->method('getId')->will($this->returnValue(1)); - $node = $this->getMockBuilder( + $node = $this->getMockBuilder( \Magento\Framework\Data\Tree\Node::class )->disableOriginalConstructor() ->getMock(); @@ -123,7 +123,7 @@ public function testGetRootNode() $this->categoryCollection->expects($this->once())->method('setLoadProductCount')->will($this->returnSelf()); $this->categoryCollection->expects($this->once())->method('setStoreId')->will($this->returnSelf()); - $node = $this->getMockBuilder( + $node = $this->getMockBuilder( \Magento\Catalog\Model\ResourceModel\Category\Tree::class )->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CategoryLinkManagementTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CategoryLinkManagementTest.php index 3b8b3645125c0..4b37c34d69891 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/CategoryLinkManagementTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/CategoryLinkManagementTest.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Test\Unit\Model; - class CategoryLinkManagementTest extends \PHPUnit_Framework_TestCase { /** diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php index 8977a332684e2..fac7bb72a653b 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionProcessorTest.php @@ -104,7 +104,6 @@ protected function setUp() $this->customOptionFactory, $this->serializer ); - } public function testConvertToBuyRequest() diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php index 7ad6e14993854..32b22f7ed168b 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php @@ -70,20 +70,20 @@ protected function setUp() $this->store = $this->getMock(\Magento\Store\Model\Store::class, [], [], '', false); $this->store->expects($this->any())->method('getId')->will($this->returnValue('store_id_1')); $this->storeManager->expects($this->any())->method('getStores')->will($this->returnValue([$this->store])); - $this->productIndexerHelper = $this->getMock( + $this->productIndexerHelper = $this->getMock( \Magento\Catalog\Helper\Product\Flat\Indexer::class, [], [], '', false ); - $this->flatItemEraser = $this->getMock( + $this->flatItemEraser = $this->getMock( \Magento\Catalog\Model\Indexer\Product\Flat\Action\Eraser::class, [], [], '', false ); - $this->flatItemWriter = $this->getMock( + $this->flatItemWriter = $this->getMock( \Magento\Catalog\Model\Indexer\Product\Flat\Action\Indexer::class, [], [], '', false ); - $this->flatTableBuilder = $this->getMock( + $this->flatTableBuilder = $this->getMock( \Magento\Catalog\Model\Indexer\Product\Flat\FlatTableBuilder::class, [], [], '', false ); - $this->model = $objectManager->getObject( + $this->model = $objectManager->getObject( \Magento\Catalog\Model\Indexer\Product\Flat\Action\Row::class, [ 'resource' => $this->resource, 'storeManager' => $this->storeManager, diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowsTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowsTest.php index 5fe871f77fd71..fdb844b1436a0 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowsTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowsTest.php @@ -72,20 +72,20 @@ protected function setUp() $this->_storeManager->expects($this->any())->method('getStores')->will( $this->returnValue([$this->_store]) ); - $this->_productIndexerHelper = $this->getMock( + $this->_productIndexerHelper = $this->getMock( \Magento\Catalog\Helper\Product\Flat\Indexer::class, [], [], '', false ); - $this->_flatItemEraser = $this->getMock( + $this->_flatItemEraser = $this->getMock( \Magento\Catalog\Model\Indexer\Product\Flat\Action\Eraser::class, [], [], '', false ); - $this->_flatItemWriter = $this->getMock( + $this->_flatItemWriter = $this->getMock( \Magento\Catalog\Model\Indexer\Product\Flat\Action\Indexer::class, [], [], '', false ); - $this->_flatTableBuilder = $this->getMock( + $this->_flatTableBuilder = $this->getMock( \Magento\Catalog\Model\Indexer\Product\Flat\FlatTableBuilder::class, [], [], '', false ); - $this->_model = $objectManager->getObject( + $this->_model = $objectManager->getObject( \Magento\Catalog\Model\Indexer\Product\Flat\Action\Rows::class, [ 'resource' => $this->_resource, 'storeManager' => $this->_storeManager, @@ -95,6 +95,7 @@ protected function setUp() 'flatTableBuilder' => $this->_flatTableBuilder ]); } + /** * @expectedException \Magento\Framework\Exception\LocalizedException * @expectedExceptionMessage Bad value was supplied. diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Plugin/CustomerGroupTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Plugin/CustomerGroupTest.php index ce9fd36b2c143..a31bedcbf9ee7 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Plugin/CustomerGroupTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Price/Plugin/CustomerGroupTest.php @@ -34,11 +34,11 @@ protected function setUp() { $this->_objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->_subjectMock = $this->getMock( + $this->_subjectMock = $this->getMock( \Magento\Customer\Api\GroupRepositoryInterface::class, [], [], '', false ); - $indexerMock = $this->getMock( + $indexerMock = $this->getMock( \Magento\Indexer\Model\Indexer::class, ['getId', 'invalidate'], [], @@ -46,19 +46,19 @@ protected function setUp() false ); $indexerMock->expects($this->once())->method('invalidate'); - $this->indexerRegistryMock = $this->getMock( - \Magento\Framework\Indexer\IndexerRegistry::class, - ['get'], - [], - '', - false + $this->indexerRegistryMock = $this->getMock( + \Magento\Framework\Indexer\IndexerRegistry::class, + ['get'], + [], + '', + false ); $this->indexerRegistryMock->expects($this->once()) ->method('get') ->with(\Magento\Catalog\Model\Indexer\Product\Price\Processor::INDEXER_ID) ->will($this->returnValue($indexerMock)); - $this->_model = $this->_objectManager->getObject( + $this->_model = $this->_objectManager->getObject( \Magento\Catalog\Model\Indexer\Product\Price\Plugin\CustomerGroup::class, ['indexerRegistry' => $this->indexerRegistryMock] ); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Category/CollectionFilterTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Category/CollectionFilterTest.php index bc60108094849..e8b4386c5ce25 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Category/CollectionFilterTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Category/CollectionFilterTest.php @@ -29,7 +29,7 @@ class CollectionFilterTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->visibilityMock = $this->getMock( + $this->visibilityMock = $this->getMock( \Magento\Catalog\Model\Product\Visibility::class, [], [], '', false ); $this->catalogConfigMock = $this->getMock(\Magento\Catalog\Model\Config::class, [], [], '', false); @@ -42,7 +42,7 @@ protected function setUp() */ public function testFilter() { - $collectionMock = $this->getMock( + $collectionMock = $this->getMock( \Magento\Catalog\Model\ResourceModel\Product\Collection::class, [], [], '', false ); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Category/FilterableAttributeListTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Category/FilterableAttributeListTest.php index 7a2471dd592a1..5689a3ecc8e75 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Category/FilterableAttributeListTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Category/FilterableAttributeListTest.php @@ -28,11 +28,11 @@ class FilterableAttributeListTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->collectionFactoryMock = $this->getMock( - \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory::class, - ['create'], - [], - '', - false + \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory::class, + ['create'], + [], + '', + false ); $this->storeManagerMock = $this->getMock( diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/PriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/PriceTest.php index bc0d48cb54180..4db388408e021 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/PriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/PriceTest.php @@ -219,6 +219,7 @@ public function applyWithEmptyRequestDataProvider() /** @var \Magento\Eav\Model\Entity\Attribute|MockObject */ private $attribute; + public function testApply() { $priceId = '15-50'; diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layer/FilterListTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layer/FilterListTest.php index 5238dc20232ef..bf35da5d0676a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Layer/FilterListTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Layer/FilterListTest.php @@ -40,10 +40,10 @@ class FilterListTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->objectManagerMock = $this->getMock(\Magento\Framework\ObjectManagerInterface::class); - $this->attributeListMock = $this->getMock( + $this->attributeListMock = $this->getMock( \Magento\Catalog\Model\Layer\Category\FilterableAttributeList::class, [], [], '', false ); - $this->attributeMock = $this->getMock( + $this->attributeMock = $this->getMock( \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class, [], [], '', false ); $filters = [ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Search/FilterableAttributeListTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Search/FilterableAttributeListTest.php index 736f3f7049548..b619fe308871b 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Search/FilterableAttributeListTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Search/FilterableAttributeListTest.php @@ -28,11 +28,11 @@ class FilterableAttributeListTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->collectionFactoryMock = $this->getMock( - \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory::class, - ['create'], - [], - '', - false + \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory::class, + ['create'], + [], + '', + false ); $this->storeManagerMock = $this->getMock( diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layout/DepersonalizePluginTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layout/DepersonalizePluginTest.php index ab9131e210642..9c8d009d8df6d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Layout/DepersonalizePluginTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Layout/DepersonalizePluginTest.php @@ -35,7 +35,7 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->layoutMock = $this->getMock(\Magento\Framework\View\Layout::class, [], [], '', false); - $this->catalogSessionMock = $this->getMock( + $this->catalogSessionMock = $this->getMock( \Magento\Catalog\Model\Session::class, ['clearStorage'], [], @@ -43,7 +43,7 @@ protected function setUp() false ); $this->resultLayout = $this->getMock(\Magento\Framework\View\Layout::class, [], [], '', false); - $this->depersonalizeCheckerMock = $this->getMock( + $this->depersonalizeCheckerMock = $this->getMock( \Magento\PageCache\Model\DepersonalizeChecker::class, [], [], diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/ImageEntryConverterTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/ImageEntryConverterTest.php index fecb0f6b62035..41059022f786c 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/ImageEntryConverterTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/Media/ImageEntryConverterTest.php @@ -207,7 +207,7 @@ public function testConvertFrom() 'name' => '/s/a/sample_3.jpg' ] ], - 'media_type' => null, + 'media_type' => null, ]; $this->assertEquals($expectedResult, $this->modelObject->convertFrom($this->mediaGalleryEntryMock)); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php index dbf83645f1a7f..7384d38bdaf0b 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/RepositoryTest.php @@ -305,7 +305,6 @@ public function testSaveSavesDefaultFrontendLabelIfItIsPresentInPayload() $attributeMock->expects($this->any())->method('getFrontendLabels')->willReturn([$labelMock]); $attributeMock->expects($this->any())->method('getOptions')->willReturn([]); - $existingModelMock = $this->getMock(Attribute::class, [], [], '', false); $existingModelMock->expects($this->any())->method('getAttributeId')->willReturn($attributeId); $existingModelMock->expects($this->any())->method('getAttributeCode')->willReturn($attributeCode); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/TypesListTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/TypesListTest.php index 603cac1dd6bde..1b8df0f22efae 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/TypesListTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/TypesListTest.php @@ -35,14 +35,14 @@ class TypesListTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->inputTypeFactoryMock = $this->getMock( + $this->inputTypeFactoryMock = $this->getMock( \Magento\Catalog\Model\Product\Attribute\Source\InputtypeFactory::class, ['create', '__wakeup'], [], '', false); $this->attributeTypeFactoryMock = - $this->getMock( + $this->getMock( \Magento\Catalog\Api\Data\ProductAttributeTypeInterfaceFactory::class, [ 'create', @@ -63,12 +63,12 @@ protected function setUp() public function testGetItems() { - $inputTypeMock = $this->getMock( - \Magento\Catalog\Model\Product\Attribute\Source\Inputtype::class, - [], - [], - '', - false + $inputTypeMock = $this->getMock( + \Magento\Catalog\Model\Product\Attribute\Source\Inputtype::class, + [], + [], + '', + false ); $this->inputTypeFactoryMock->expects($this->once())->method('create')->willReturn($inputTypeMock); $inputTypeMock->expects($this->once())->method('toOptionArray')->willReturn(['option' => ['value']]); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Link/ResolverTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Link/ResolverTest.php index 9ce3ca804531c..b05424b9e5c44 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Link/ResolverTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Link/ResolverTest.php @@ -35,7 +35,6 @@ public function testGetLinksEmpty() ->with('links', []) ->willReturn($someLinks); $this->assertEquals($someLinks, $this->resolver->getLinks()); - } public function testGetLinksOverridden() @@ -46,6 +45,5 @@ public function testGetLinksOverridden() $this->resolver->override($overriddenLinks); $this->assertEquals($overriddenLinks, $this->resolver->getLinks()); - } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php index 6feadffc8f602..09c63dd566fdc 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/LinkTypeProviderTest.php @@ -37,18 +37,18 @@ class LinkTypeProviderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->linkTypeFactoryMock = $this->getMock( + $this->linkTypeFactoryMock = $this->getMock( \Magento\Catalog\Api\Data\ProductLinkTypeInterfaceFactory::class, ['create'], [], '', false ); - $this->linkAttributeFactoryMock = $this->getMock( + $this->linkAttributeFactoryMock = $this->getMock( \Magento\Catalog\Api\Data\ProductLinkAttributeInterfaceFactory::class, ['create'], [], '', false, false ); - $this->linkFactoryMock = $this->getMock( + $this->linkFactoryMock = $this->getMock( \Magento\Catalog\Model\Product\LinkFactory::class, ['create'], [], '', false, false ); @@ -58,7 +58,7 @@ protected function setUp() 'test_product_link_3' => 'test_code_3', ]; $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->model = $objectManager->getObject( + $this->model = $objectManager->getObject( \Magento\Catalog\Model\Product\LinkTypeProvider::class, [ 'linkTypeFactory' => $this->linkTypeFactoryMock, diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/PriceModifierTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/PriceModifierTest.php index 5c3743b731c48..df09a21b00b24 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/PriceModifierTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/PriceModifierTest.php @@ -33,10 +33,10 @@ class PriceModifierTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->productMock = - $this->getMock( + $this->getMock( \Magento\Catalog\Model\Product::class, ['getData', 'setData', '__wakeup'], [], '', false); - $this->productRepositoryMock = $this->getMock( + $this->productRepositoryMock = $this->getMock( \Magento\Catalog\Model\ProductRepository::class, [], [], diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php index 8ed93f9d32c5a..423c0cb05bd64 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/TierPriceManagementTest.php @@ -424,7 +424,6 @@ public function testAddRethrowsTemporaryStateExceptionIfRecoverableErrorOccurred * @expectedException \Magento\Framework\Exception\InputException * @dataProvider addDataProvider */ - public function testAddWithInvalidData($price, $qty) { $this->service->add('product_sku', 1, $price, $qty); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/TypeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/TypeTest.php index 16605ea6043ea..face451f85a62 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/TypeTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/TypeTest.php @@ -5,7 +5,6 @@ */ namespace Magento\Catalog\Test\Unit\Model\Product; - /** * ProductType Test * diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/TreeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/TreeTest.php index d80090c05351b..849c9668139f7 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/TreeTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Category/TreeTest.php @@ -223,7 +223,6 @@ public function testAddCollectionData() ->with(CategoryInterface::class) ->willReturn($categoryMetadataMock); - $model = $objectHelper->getObject( \Magento\Catalog\Model\ResourceModel\Category\Tree::class, [ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Website/LinkTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Website/LinkTest.php index a01fbc4d2e386..2363559096a9d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Website/LinkTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/Website/LinkTest.php @@ -93,7 +93,7 @@ public function testSaveWebsiteIds() ->method('insertMultiple') ->with('catalog_product_website', [ ['product_id' => $productId, 'website_id' => 3] - ]); + ]); $this->connection->expects($this->once()) ->method('delete') diff --git a/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php b/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php index a935861a263e1..af213a0b9a89f 100644 --- a/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Observer/MenuCategoryDataTest.php @@ -39,7 +39,7 @@ class MenuCategoryDataTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_catalogCategory = $this->getMock( + $this->_catalogCategory = $this->getMock( \Magento\Catalog\Helper\Category::class, ['getStoreCategories', 'getCategoryUrl'], [], diff --git a/app/code/Magento/Catalog/Test/Unit/Plugin/Block/TopmenuTest.php b/app/code/Magento/Catalog/Test/Unit/Plugin/Block/TopmenuTest.php index 3a17233deb2e4..50d076490432a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Plugin/Block/TopmenuTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Plugin/Block/TopmenuTest.php @@ -10,7 +10,7 @@ /** * Class TopmenuTest - * + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class TopmenuTest extends \PHPUnit_Framework_TestCase diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php index 11ff04d0aa0fb..5b521b33144b1 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php @@ -64,12 +64,12 @@ protected function setUp() $this->regularPriceMock = $this->getMock(\Magento\Catalog\Pricing\Price\RegularPrice::class, [], [], '', false); $this->tearPriceMock = $this->getMock(\Magento\Catalog\Pricing\Price\TierPrice::class, [], [], '', false); $this->specialPriceMock = $this->getMock(\Magento\Catalog\Pricing\Price\SpecialPrice::class, [], [], '', false); - $this->calculatorMock = $this->getMock( - \Magento\Framework\Pricing\Adjustment\Calculator::class, - [], - [], - '', - false + $this->calculatorMock = $this->getMock( + \Magento\Framework\Pricing\Adjustment\Calculator::class, + [], + [], + '', + false ); $this->saleableItemMock->expects($this->once()) @@ -82,7 +82,7 @@ protected function setUp() ]; $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->basePrice = $helper->getObject( + $this->basePrice = $helper->getObject( \Magento\Catalog\Pricing\Price\BasePrice::class, [ 'saleableItem' => $this->saleableItemMock, diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php index f568c0909b7dc..c882d76263658 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php @@ -106,8 +106,7 @@ private function _getNextAttributeSortOrder(array $meta, $attributeCodes, $defau $defaultSortOrder, $iteration ); - } elseif ( - in_array($attributeCode, $attributeCodes) + } elseif (in_array($attributeCode, $attributeCodes) && isset($attributeMeta['arguments']['data']['config']['sortOrder']) ) { $defaultSortOrder = $attributeMeta['arguments']['data']['config']['sortOrder'] + $iteration; @@ -161,8 +160,7 @@ protected function getFirstPanelCode(array $meta) $name = null; foreach ($meta as $fieldSetName => $fieldSetMeta) { - if ( - isset($fieldSetMeta['arguments']['data']['config']['sortOrder']) + if (isset($fieldSetMeta['arguments']['data']['config']['sortOrder']) && (null === $min || $fieldSetMeta['arguments']['data']['config']['sortOrder'] <= $min) ) { $min = $fieldSetMeta['arguments']['data']['config']['sortOrder']; @@ -183,8 +181,7 @@ protected function getFirstPanelCode(array $meta) protected function getGroupCodeByField(array $meta, $field) { foreach ($meta as $groupCode => $groupData) { - if ( - isset($groupData['children'][$field]) + if (isset($groupData['children'][$field]) || isset($groupData['children'][static::CONTAINER_PREFIX . $field]) ) { return $groupCode; diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index 687f6349146c2..cf8112d83d843 100755 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -798,8 +798,7 @@ private function getValue(ProductAttributeInterface $attribute) */ private function getScopeLabel(ProductAttributeInterface $attribute) { - if ( - $this->storeManager->isSingleStoreMode() + if ($this->storeManager->isSingleStoreMode() || $attribute->getFrontendInput() === AttributeInterface::FRONTEND_INPUT ) { return ''; diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Images.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Images.php index e7b3e86083a8e..e47a62868c2b5 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Images.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Images.php @@ -54,8 +54,7 @@ public function modifyData(array $data) /** @var \Magento\Catalog\Api\Data\ProductInterface $product */ $product = $this->locator->getProduct(); $modelId = $product->getId(); - if ( - isset($data[$modelId][self::DATA_SOURCE_DEFAULT]['media_gallery']) + if (isset($data[$modelId][self::DATA_SOURCE_DEFAULT]['media_gallery']) && !empty($data[$modelId][self::DATA_SOURCE_DEFAULT]['media_gallery']) && !empty($data[$modelId][self::DATA_SOURCE_DEFAULT]['media_gallery']['images']) ) { diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/ScheduleDesignUpdate.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/ScheduleDesignUpdate.php index f9421b5154bed..40bb0dfc9cd39 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/ScheduleDesignUpdate.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/ScheduleDesignUpdate.php @@ -57,8 +57,7 @@ public function modifyData(array $data) */ protected function customizeDateRangeField(array $meta) { - if ( - $this->getGroupCodeByField($meta, self::CODE_CUSTOM_DESIGN_FROM) + if ($this->getGroupCodeByField($meta, self::CODE_CUSTOM_DESIGN_FROM) !== $this->getGroupCodeByField($meta, self::CODE_CUSTOM_DESIGN_TO) ) { return $meta; diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/CategoryProcessor.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/CategoryProcessor.php index 42fde247a39fc..f327aca49b781 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/CategoryProcessor.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/CategoryProcessor.php @@ -114,7 +114,6 @@ protected function createCategory($name, $parentId) return $category->getId(); } - /** * Returns ID of category by string path creating nonexistent ones. * 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/CatalogImportExport/Model/Import/Product/Validator.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator.php index 0416a5640337b..621acac6cc5e7 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator.php @@ -229,7 +229,6 @@ public function isAttributeValid($attrCode, array $attrParams, array $rowData) } return (bool)$valid; - } /** diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/SuperProductsSku.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/SuperProductsSku.php index 54275e861366e..249e52a5109ad 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/SuperProductsSku.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/SuperProductsSku.php @@ -40,14 +40,13 @@ public function isValid($value) $this->_clearMessages(); $oldSku = $this->skuProcessor->getOldSkus(); if (!empty($value['_super_products_sku']) && (!isset( - $oldSku[$value['_super_products_sku']] - ) && $this->skuProcessor->getNewSku($value['_super_products_sku']) === null + $oldSku[$value['_super_products_sku']] + ) && $this->skuProcessor->getNewSku($value['_super_products_sku']) === null ) ) { $this->_addMessages([self::ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND]); return false; } return true; - } } diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/TierPrice.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/TierPrice.php index cd360f1f873f9..dac82838580c5 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/TierPrice.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/Validator/TierPrice.php @@ -44,40 +44,40 @@ public function isValid($value) { $this->_clearMessages(); if (isset( + $value['_tier_price_website'] + ) && strlen( + $value['_tier_price_website'] + ) || isset( + $value['_tier_price_customer_group'] + ) && strlen( + $value['_tier_price_customer_group'] + ) || isset( + $value['_tier_price_qty'] + ) && strlen( + $value['_tier_price_qty'] + ) || isset( + $value['_tier_price_price'] + ) && strlen( + $value['_tier_price_price'] + ) + ) { + if (!isset( $value['_tier_price_website'] - ) && strlen( - $value['_tier_price_website'] - ) || isset( + ) || !isset( $value['_tier_price_customer_group'] - ) && strlen( - $value['_tier_price_customer_group'] - ) || isset( - $value['_tier_price_qty'] - ) && strlen( + ) || !isset( $value['_tier_price_qty'] - ) || isset( + ) || !isset( $value['_tier_price_price'] - ) && strlen( + ) || !strlen( + $value['_tier_price_website'] + ) || !strlen( + $value['_tier_price_customer_group'] + ) || !strlen( + $value['_tier_price_qty'] + ) || !strlen( $value['_tier_price_price'] ) - ) { - if (!isset( - $value['_tier_price_website'] - ) || !isset( - $value['_tier_price_customer_group'] - ) || !isset( - $value['_tier_price_qty'] - ) || !isset( - $value['_tier_price_price'] - ) || !strlen( - $value['_tier_price_website'] - ) || !strlen( - $value['_tier_price_customer_group'] - ) || !strlen( - $value['_tier_price_qty'] - ) || !strlen( - $value['_tier_price_price'] - ) ) { $this->_addMessages([self::ERROR_TIER_DATA_INCOMPLETE]); return false; @@ -87,8 +87,8 @@ public function isValid($value) $this->_addMessages([self::ERROR_INVALID_TIER_PRICE_SITE]); return false; } elseif ($value['_tier_price_customer_group'] != self::VALUE_ALL && !isset( - $this->customerGroups[$value['_tier_price_customer_group']] - ) + $this->customerGroups[$value['_tier_price_customer_group']] + ) ) { $this->_addMessages([self::ERROR_INVALID_TIER_PRICE_GROUP]); return false; diff --git a/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php b/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php index 3594013ff3c18..4017756830967 100644 --- a/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php +++ b/app/code/Magento/CatalogInventory/Api/Data/StockStatusCollectionInterface.php @@ -20,7 +20,6 @@ interface StockStatusCollectionInterface extends SearchResultsInterface */ public function getItems(); - /** * Sets items * diff --git a/app/code/Magento/CatalogInventory/Model/Plugin/FilterCustomAttribute.php b/app/code/Magento/CatalogInventory/Model/Plugin/FilterCustomAttribute.php index 05240781211e1..880d62225bc0c 100644 --- a/app/code/Magento/CatalogInventory/Model/Plugin/FilterCustomAttribute.php +++ b/app/code/Magento/CatalogInventory/Model/Plugin/FilterCustomAttribute.php @@ -30,7 +30,7 @@ public function __construct(array $blackList = []) * @param Repository $repository * @param array $attributes * @return \Magento\Eav\Model\AttributeRepository - * + * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetCustomAttributesMetadata(Repository $repository, array $attributes) diff --git a/app/code/Magento/CatalogInventory/Model/Stock.php b/app/code/Magento/CatalogInventory/Model/Stock.php index 5961c6681e99e..963e0be894e38 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Stock.php @@ -145,5 +145,6 @@ public function setExtensionAttributes( ) { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/CatalogInventory/Model/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Stock/Item.php index 3203c8b681b49..249a88e5bb616 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/Item.php @@ -833,5 +833,6 @@ public function setExtensionAttributes( ) { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/CatalogInventory/Model/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Stock/Status.php index 0c5f571a05b89..758344eec6b0c 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/Status.php @@ -118,6 +118,7 @@ public function getStockStatus() { return $this->getData(self::KEY_STOCK_STATUS); } + //@codeCoverageIgnoreEnd /** @@ -196,5 +197,6 @@ public function setExtensionAttributes( ) { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/CatalogInventory/Model/StockIndex.php b/app/code/Magento/CatalogInventory/Model/StockIndex.php index 610f67e16fb57..e053383fd1e07 100644 --- a/app/code/Magento/CatalogInventory/Model/StockIndex.php +++ b/app/code/Magento/CatalogInventory/Model/StockIndex.php @@ -268,7 +268,7 @@ protected function getProductTypeInstances() protected function getStockStatusResource() { if (empty($this->stockStatusResource)) { - $this->stockStatusResource = \Magento\Framework\App\ObjectManager::getInstance()->get( + $this->stockStatusResource = \Magento\Framework\App\ObjectManager::getInstance()->get( \Magento\CatalogInventory\Model\ResourceModel\Stock\Status::class ); } diff --git a/app/code/Magento/CatalogInventory/Setup/InstallSchema.php b/app/code/Magento/CatalogInventory/Setup/InstallSchema.php index 3a343e9029cb3..1af1980bf8985 100644 --- a/app/code/Magento/CatalogInventory/Setup/InstallSchema.php +++ b/app/code/Magento/CatalogInventory/Setup/InstallSchema.php @@ -457,6 +457,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/AfterProductLoadTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/AfterProductLoadTest.php index cf6ca57487acf..4984903c1809c 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/AfterProductLoadTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Plugin/AfterProductLoadTest.php @@ -34,7 +34,7 @@ class AfterProductLoadTest extends \PHPUnit_Framework_TestCase protected function setUp() { $stockRegistryMock = $this->getMock(\Magento\CatalogInventory\Api\StockRegistryInterface::class); - $this->productExtensionFactoryMock = $this->getMockBuilder( + $this->productExtensionFactoryMock = $this->getMockBuilder( \Magento\Catalog\Api\Data\ProductExtensionFactory::class) ->setMethods(['create']) ->disableOriginalConstructor() diff --git a/app/code/Magento/CatalogInventory/Ui/Component/Product/Form/Element/UseConfigSettings.php b/app/code/Magento/CatalogInventory/Ui/Component/Product/Form/Element/UseConfigSettings.php index 9e510ff1e7bad..a662486211def 100644 --- a/app/code/Magento/CatalogInventory/Ui/Component/Product/Form/Element/UseConfigSettings.php +++ b/app/code/Magento/CatalogInventory/Ui/Component/Product/Form/Element/UseConfigSettings.php @@ -21,8 +21,7 @@ class UseConfigSettings extends Checkbox public function prepare() { $config = $this->getData('config'); - if ( - isset($config['keyInConfiguration']) + if (isset($config['keyInConfiguration']) && isset($config['valueFromConfig']) && $config['valueFromConfig'] instanceof ValueSourceInterface ) { diff --git a/app/code/Magento/CatalogRule/Model/CatalogRuleRepository.php b/app/code/Magento/CatalogRule/Model/CatalogRuleRepository.php index 70bab6f0dee7a..82c1c29c63ad0 100644 --- a/app/code/Magento/CatalogRule/Model/CatalogRuleRepository.php +++ b/app/code/Magento/CatalogRule/Model/CatalogRuleRepository.php @@ -54,8 +54,7 @@ public function save(Data\RuleInterface $rule) unset($this->rules[$rule->getId()]); } catch (ValidatorException $e) { throw new CouldNotSaveException(__($e->getMessage())); - } - catch (\Exception $e) { + } catch (\Exception $e) { throw new CouldNotSaveException(__('Unable to save rule %1', $rule->getRuleId())); } return $rule; diff --git a/app/code/Magento/CatalogRule/Model/Rule.php b/app/code/Magento/CatalogRule/Model/Rule.php index 11fd946344ae4..a6a4fb0282dad 100644 --- a/app/code/Magento/CatalogRule/Model/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Rule.php @@ -787,6 +787,7 @@ private function getRuleConditionConverter() } return $this->ruleConditionConverter; } + //@codeCoverageIgnoreEnd /** diff --git a/app/code/Magento/CatalogRule/Setup/InstallData.php b/app/code/Magento/CatalogRule/Setup/InstallData.php index e679d324de66f..86ebebcd8d51c 100644 --- a/app/code/Magento/CatalogRule/Setup/InstallData.php +++ b/app/code/Magento/CatalogRule/Setup/InstallData.php @@ -41,6 +41,5 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $installer->doUpdateClassAliases(); $setup->endSetup(); - } } diff --git a/app/code/Magento/CatalogRule/Setup/InstallSchema.php b/app/code/Magento/CatalogRule/Setup/InstallSchema.php index d8e3d8295ff3b..3a9d90f0a4b81 100644 --- a/app/code/Magento/CatalogRule/Setup/InstallSchema.php +++ b/app/code/Magento/CatalogRule/Setup/InstallSchema.php @@ -513,6 +513,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } 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/Adapter/Mysql/Filter/AliasResolver.php b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/AliasResolver.php index 8f5a231b1ddc6..433d47e0826ab 100644 --- a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/AliasResolver.php +++ b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/AliasResolver.php @@ -6,7 +6,6 @@ namespace Magento\CatalogSearch\Model\Adapter\Mysql\Filter; - use Magento\CatalogSearch\Model\Search\RequestGenerator; /** diff --git a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php index 4873bf22e1b1e..4d9eeb6a221c8 100644 --- a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php +++ b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php @@ -146,13 +146,11 @@ private function processQueryWithField(FilterInterface $filter, $isNegation, $qu $this->connection->quoteIdentifier($alias . '.' . $attribute->getAttributeCode()), $query ); - } elseif ( - $filter->getType() === FilterInterface::TYPE_TERM && + } elseif ($filter->getType() === FilterInterface::TYPE_TERM && in_array($attribute->getFrontendInput(), ['select', 'multiselect'], true) ) { $resultQuery = $this->processTermSelect($filter, $isNegation); - } elseif ( - $filter->getType() === FilterInterface::TYPE_RANGE && + } elseif ($filter->getType() === FilterInterface::TYPE_RANGE && in_array($attribute->getBackendType(), ['decimal', 'int'], true) ) { $resultQuery = $this->processRangeNumeric($filter, $query, $attribute); diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php index 7decbdf62cd0c..f4e0f94eda13a 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php @@ -422,7 +422,6 @@ public function prepareProductIndex($indexData, $productData, $storeId) $attributeCode = $attribute->getAttributeCode(); if (isset($productData[$attributeCode])) { - if ('store_id' === $attributeCode) { continue; } diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php index ef223a774cb97..532c0fce86ee9 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/IndexIterator.php @@ -130,7 +130,6 @@ public function __construct( $this->statusIds = $statusIds; } - /** * {@inheritDoc} */ diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/IndexTableNotExistException.php b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/IndexTableNotExistException.php index cf13dd28fdf84..864999380c213 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/IndexTableNotExistException.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/IndexTableNotExistException.php @@ -6,7 +6,6 @@ namespace Magento\CatalogSearch\Model\Indexer\Scope; - use Magento\Framework\Exception\LocalizedException; /** diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/ScopeProxy.php b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/ScopeProxy.php index fdc7284ecdf5d..85428023fc5eb 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/ScopeProxy.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/ScopeProxy.php @@ -6,7 +6,6 @@ namespace Magento\CatalogSearch\Model\Indexer\Scope; - use Magento\Framework\Search\Request\Dimension; /** diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/State.php b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/State.php index 5d11fa18cba9c..0eba30dd0588f 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/State.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/State.php @@ -6,7 +6,6 @@ namespace Magento\CatalogSearch\Model\Indexer\Scope; - use Magento\Framework\App\ResourceConnection; use Magento\Framework\App\ScopeResolverInterface; use Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver; diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/TemporaryResolver.php b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/TemporaryResolver.php index 9cea4647a6eba..81c55183fe24d 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/TemporaryResolver.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/TemporaryResolver.php @@ -6,7 +6,6 @@ namespace Magento\CatalogSearch\Model\Indexer\Scope; - use Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver; use Magento\Framework\Search\Request\Dimension; diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/UnknownStateException.php b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/UnknownStateException.php index 3b1316ade7994..a0b3ea325ae29 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Scope/UnknownStateException.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Scope/UnknownStateException.php @@ -6,7 +6,6 @@ namespace Magento\CatalogSearch\Model\Indexer\Scope; - use Magento\Framework\Exception\LocalizedException; /** diff --git a/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php b/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php index d4a35920b8230..557ccef621104 100644 --- a/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php +++ b/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php @@ -105,8 +105,7 @@ protected function _getItemsData() ? (int)$optionsFacetedData[$value]['count'] : 0; // Check filter type - if ( - $this->getAttributeIsFilterable($attribute) === static::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS + if ($this->getAttributeIsFilterable($attribute) === static::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS && (!$this->isOptionReducesResults($count, $productSize) || $count === 0) ) { continue; diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/EngineInterface.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/EngineInterface.php index 5cff916672f99..86b34f7227672 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/EngineInterface.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/EngineInterface.php @@ -39,7 +39,6 @@ public function allowAdvancedIndex(); */ public function processAttributeValue($attribute, $value); - /** * Prepare index array as a string glued by separator * diff --git a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php index d8d3efc65e782..e98b73f86246b 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php +++ b/app/code/Magento/CatalogSearch/Model/Search/FilterMapper/FilterContext.php @@ -6,7 +6,6 @@ namespace Magento\CatalogSearch\Model\Search\FilterMapper; - use Magento\CatalogSearch\Model\Adapter\Mysql\Filter\AliasResolver; use Magento\Eav\Model\Config as EavConfig; use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; @@ -14,6 +13,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/CatalogSearch/Model/Search/RequestGenerator/Decimal.php b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/Decimal.php index b4a7be092e6fd..f8b6f2e509de7 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/Decimal.php +++ b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/Decimal.php @@ -6,14 +6,12 @@ namespace Magento\CatalogSearch\Model\Search\RequestGenerator; - use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Framework\Search\Request\BucketInterface; use Magento\Framework\Search\Request\FilterInterface; class Decimal implements GeneratorInterface { - /** * {@inheritdoc} */ diff --git a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/General.php b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/General.php index e35691cd52522..4edaca0960ca1 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/General.php +++ b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/General.php @@ -6,14 +6,12 @@ namespace Magento\CatalogSearch\Model\Search\RequestGenerator; - use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Framework\Search\Request\BucketInterface; use Magento\Framework\Search\Request\FilterInterface; class General implements GeneratorInterface { - /** * {@inheritdoc} */ diff --git a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/GeneratorInterface.php b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/GeneratorInterface.php index 7f60554d41cfd..9e5444a612e3d 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/GeneratorInterface.php +++ b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/GeneratorInterface.php @@ -6,7 +6,6 @@ namespace Magento\CatalogSearch\Model\Search\RequestGenerator; - use Magento\Catalog\Model\ResourceModel\Eav\Attribute; interface GeneratorInterface diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php index 5af9fe078e4f7..210960c444aa8 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php @@ -115,7 +115,7 @@ public function testAfterDelete() /** * Prepare expectations for indexer - * + * * @param int $invalidateCounter * @return void */ diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Filter/PriceTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Filter/PriceTest.php index 190515f550e95..b1d079b770f07 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Filter/PriceTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Filter/PriceTest.php @@ -202,6 +202,7 @@ public function applyWithEmptyRequestDataProvider() /** @var \Magento\Eav\Model\Entity\Attribute|MockObject */ private $attribute; + public function testApply() { $priceId = '15-50'; diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGenerator/GeneratorResolverTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGenerator/GeneratorResolverTest.php index 93c6e81aece4f..f87b4b81627d8 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGenerator/GeneratorResolverTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Search/RequestGenerator/GeneratorResolverTest.php @@ -6,7 +6,6 @@ namespace Magento\CatalogSearch\Test\Unit\Model\Search\RequestGenerator; - use Magento\CatalogSearch\Model\Search\RequestGenerator\GeneratorResolver; use Magento\CatalogSearch\Model\Search\RequestGenerator\GeneratorInterface; diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteSavingObserver.php b/app/code/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteSavingObserver.php index dd0250049a426..528f678cae848 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteSavingObserver.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/CategoryProcessUrlRewriteSavingObserver.php @@ -93,6 +93,5 @@ private function resetUrlRewritesDataMaps($category) foreach ($this->dataUrlRewriteClassNames as $className) { $this->databaseMapPool->resetMap($className, $category->getEntityId()); } - } } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/CanonicalUrlRewriteGeneratorTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/CanonicalUrlRewriteGeneratorTest.php index 483f0ecbd1104..06006c27f0868 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/CanonicalUrlRewriteGeneratorTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/CanonicalUrlRewriteGeneratorTest.php @@ -35,10 +35,10 @@ protected function setUp() ->disableOriginalConstructor()->getMock(); $this->category = $this->getMockBuilder(\Magento\Catalog\Model\Category::class) ->disableOriginalConstructor()->getMock(); - $this->categoryUrlPathGenerator = $this->getMockBuilder( + $this->categoryUrlPathGenerator = $this->getMockBuilder( \Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator::class )->disableOriginalConstructor()->getMock(); - $this->canonicalUrlRewriteGenerator = (new ObjectManager($this))->getObject( + $this->canonicalUrlRewriteGenerator = (new ObjectManager($this))->getObject( \Magento\CatalogUrlRewrite\Model\Category\CanonicalUrlRewriteGenerator::class, [ 'categoryUrlPathGenerator' => $this->categoryUrlPathGenerator, diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Map/HashMapPoolTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Map/HashMapPoolTest.php index b9efdb01f2e1d..f7a99541a9025 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Map/HashMapPoolTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Map/HashMapPoolTest.php @@ -63,7 +63,7 @@ public function testGetDataMap() ['category' => 2], $dataProductMapMockOtherCategory ] - ] + ] ); $this->assertSame($dataCategoryMapMock, $this->model->getDataMap(DataCategoryHashMap::class, 1)); $this->assertSame($dataProductMapMock, $this->model->getDataMap(DataProductHashMap::class, 1)); diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index d9ea8196ab975..589a5d312d5a3 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -132,7 +132,7 @@ protected function _construct() $this->addData([ 'cache_lifetime' => 86400, 'cache_tags' => [\Magento\Catalog\Model\Product::CACHE_TAG, - ], ]); + ], ]); } /** @@ -369,6 +369,5 @@ private function getPriceCurrency() ->get(PriceCurrencyInterface::class); } return $this->priceCurrency; - } } diff --git a/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php b/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php index 9386d85385c1f..6900da62056fd 100644 --- a/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php +++ b/app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php @@ -4,7 +4,6 @@ * See COPYING.txt for license details. */ - /** * CatalogWidget Rule Product Condition data model */ diff --git a/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php b/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php index 4d9aaa7f9177b..d257a5206ff93 100644 --- a/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php +++ b/app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php @@ -385,7 +385,6 @@ protected function orderCountryOptions(array $countryOptions) } else { array_push($tailOptions, $countryOption); } - } return array_merge($headOptions, $tailOptions); } diff --git a/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php b/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php index 19d35060b37a4..6ec3b1add408d 100644 --- a/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php +++ b/app/code/Magento/Checkout/Block/Checkout/LayoutProcessor.php @@ -151,8 +151,7 @@ public function process($jsLayout) $elements = $this->convertElementsToSelect($elements, $attributesToConvert); // The following code is a workaround for custom address attributes if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children'] - ['payment']['children'] - )) { + ['payment']['children'])) { $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children'] ['payment']['children'] = $this->processPaymentChildrenComponents( $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children'] @@ -161,8 +160,7 @@ public function process($jsLayout) ); } if (isset($jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children'] - ['step-config']['children']['shipping-rates-validation']['children'] - )) { + ['step-config']['children']['shipping-rates-validation']['children'])) { $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children'] ['step-config']['children']['shipping-rates-validation']['children'] = $this->processShippingChildrenComponents( @@ -172,8 +170,7 @@ public function process($jsLayout) } if (isset($jsLayout['components']['checkout']['children']['steps']['children']['shipping-step'] - ['children']['shippingAddress']['children']['shipping-address-fieldset']['children'] - )) { + ['children']['shippingAddress']['children']['shipping-address-fieldset']['children'])) { $fields = $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step'] ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']; $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step'] diff --git a/app/code/Magento/Checkout/Block/Registration.php b/app/code/Magento/Checkout/Block/Registration.php index 0efd58dcc3273..1249932e368a7 100644 --- a/app/code/Magento/Checkout/Block/Registration.php +++ b/app/code/Magento/Checkout/Block/Registration.php @@ -96,8 +96,7 @@ public function getCreateAccountUrl() */ public function toHtml() { - if ( - $this->customerSession->isLoggedIn() + if ($this->customerSession->isLoggedIn() || !$this->registration->isAllowed() || !$this->accountManagement->isEmailAvailable($this->getEmailAddress()) || !$this->validateAddresses() diff --git a/app/code/Magento/Checkout/Controller/Cart/Add.php b/app/code/Magento/Checkout/Controller/Cart/Add.php index a1ec6ca1b01f4..ecfa5d948fe0e 100644 --- a/app/code/Magento/Checkout/Controller/Cart/Add.php +++ b/app/code/Magento/Checkout/Controller/Cart/Add.php @@ -152,7 +152,6 @@ public function execute() } return $this->goBack($url); - } catch (\Exception $e) { $this->messageManager->addException($e, __('We can\'t add this item to your shopping cart right now.')); $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); diff --git a/app/code/Magento/Checkout/Controller/Sidebar/RemoveItem.php b/app/code/Magento/Checkout/Controller/Sidebar/RemoveItem.php index f73412e04ed1f..d648d1af3c036 100644 --- a/app/code/Magento/Checkout/Controller/Sidebar/RemoveItem.php +++ b/app/code/Magento/Checkout/Controller/Sidebar/RemoveItem.php @@ -5,7 +5,6 @@ */ namespace Magento\Checkout\Controller\Sidebar; - class RemoveItem extends \Magento\Framework\App\Action\Action { /** diff --git a/app/code/Magento/Checkout/CustomerData/DirectoryData.php b/app/code/Magento/Checkout/CustomerData/DirectoryData.php index 909fa0fee7437..f9cb731f080c1 100644 --- a/app/code/Magento/Checkout/CustomerData/DirectoryData.php +++ b/app/code/Magento/Checkout/CustomerData/DirectoryData.php @@ -46,7 +46,6 @@ public function getSectionData() $output[$code]['regions'][$key]['name'] = $region['name']; } } - } return $output; } diff --git a/app/code/Magento/Checkout/Model/Adminhtml/BillingAddressDisplayOptions.php b/app/code/Magento/Checkout/Model/Adminhtml/BillingAddressDisplayOptions.php index afaff4013b49f..39e07a64b7418 100644 --- a/app/code/Magento/Checkout/Model/Adminhtml/BillingAddressDisplayOptions.php +++ b/app/code/Magento/Checkout/Model/Adminhtml/BillingAddressDisplayOptions.php @@ -13,7 +13,6 @@ */ class BillingAddressDisplayOptions implements ArrayInterface { - /** * Return array of options for billing address displaying on checkout payment step * diff --git a/app/code/Magento/Checkout/Model/Cart.php b/app/code/Magento/Checkout/Model/Cart.php index 5d7cd9e51a862..06d6024a4b08d 100644 --- a/app/code/Magento/Checkout/Model/Cart.php +++ b/app/code/Magento/Checkout/Model/Cart.php @@ -14,7 +14,7 @@ /** * Shopping cart model * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @deprecated + * @deprecated */ class Cart extends DataObject implements CartInterface { diff --git a/app/code/Magento/Checkout/Model/ConfigProviderInterface.php b/app/code/Magento/Checkout/Model/ConfigProviderInterface.php index f49df5c827730..7e28c0a7d4e6b 100644 --- a/app/code/Magento/Checkout/Model/ConfigProviderInterface.php +++ b/app/code/Magento/Checkout/Model/ConfigProviderInterface.php @@ -11,7 +11,6 @@ */ interface ConfigProviderInterface { - /** * Retrieve assoc array of checkout configuration * diff --git a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php index b70348aa15225..5e16f093dd5c8 100644 --- a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php +++ b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php @@ -368,7 +368,6 @@ private function getQuoteData() 'quote_id' )->getMaskedId(); } - } return $quoteData; } diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php index 235cc1b5893bc..e0b9d9443ec70 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php @@ -38,18 +38,18 @@ public function testProcess() 'sub-total' => [], 'grand-total' => [], 'non-existant-total' => null - ]; - $expectedResult['components']['checkout']['children']['sidebar']['children']['summary'] + ]; + $expectedResult['components']['checkout']['children']['sidebar']['children']['summary'] ['children']['totals']['children'] = [ 'sub-total' => ['sortOrder' => 10], 'grand-total' => ['sortOrder' => 20], 'non-existant-total' => null - ]; - $configData = ['sub_total' => 10, 'grand_total' => 20]; + ]; + $configData = ['sub_total' => 10, 'grand_total' => 20]; - $this->scopeConfigMock->expects($this->once())->method('getValue')->with('sales/totals_sort') + $this->scopeConfigMock->expects($this->once())->method('getValue')->with('sales/totals_sort') ->willReturn($configData); - $this->assertEquals($expectedResult, $this->model->process($jsLayout)); + $this->assertEquals($expectedResult, $this->model->process($jsLayout)); } } diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Shipping/PriceTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Shipping/PriceTest.php index bb2ca8a476875..782a11396c284 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Shipping/PriceTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Shipping/PriceTest.php @@ -5,7 +5,6 @@ */ namespace Magento\Checkout\Test\Unit\Block\Shipping; - class PriceTest extends \PHPUnit_Framework_TestCase { const SUBTOTAL = 10; diff --git a/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php b/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php index 354fdcd3458da..1532504ead973 100644 --- a/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php +++ b/app/code/Magento/Checkout/Test/Unit/CustomerData/DefaultItemTest.php @@ -90,4 +90,3 @@ public function testGetItemData() $this->assertArrayHasKey('canApplyMsrp', $itemData); } } - diff --git a/app/code/Magento/Checkout/Test/Unit/Helper/CartTest.php b/app/code/Magento/Checkout/Test/Unit/Helper/CartTest.php index 72b5e0be3bd2c..90b08d80279c5 100644 --- a/app/code/Magento/Checkout/Test/Unit/Helper/CartTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Helper/CartTest.php @@ -57,7 +57,7 @@ protected function setUp() ->disableOriginalConstructor()->getMock(); $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); /** @var \Magento\Framework\App\Helper\Context $context */ - $context = $objectManagerHelper->getObject( + $context = $objectManagerHelper->getObject( \Magento\Framework\App\Helper\Context::class, [ 'httpRequest' => $this->requestMock, @@ -156,7 +156,7 @@ public function testGetAddUrl() $productEntityId = 1; $storeId = 1; $isRequestSecure = false; - $productMock = $this->getMock( + $productMock = $this->getMock( \Magento\Catalog\Model\Product::class, ['getEntityId', 'hasUrlDataObject', 'getUrlDataObject', '__wakeup'], [], '', false); $productMock->expects($this->any())->method('getEntityId')->will($this->returnValue($productEntityId)); diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php index 3b6d3922fd4ef..989f5774e83f9 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php @@ -39,14 +39,14 @@ class DepersonalizePluginTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->layoutMock = $this->getMock(\Magento\Framework\View\Layout::class, [], [], '', false); - $this->checkoutSessionMock = $this->getMock( + $this->checkoutSessionMock = $this->getMock( \Magento\Framework\Session\Generic::class, ['clearStorage', 'setData', 'getData'], [], '', false ); - $this->checkoutSessionMock = $this->getMock( + $this->checkoutSessionMock = $this->getMock( \Magento\Checkout\Model\Session::class, ['clearStorage'], [], @@ -56,7 +56,7 @@ protected function setUp() $this->requestMock = $this->getMock(\Magento\Framework\App\Request\Http::class, [], [], '', false); $this->moduleManagerMock = $this->getMock(\Magento\Framework\Module\Manager::class, [], [], '', false); $this->cacheConfigMock = $this->getMock(\Magento\PageCache\Model\Config::class, [], [], '', false); - $this->depersonalizeCheckerMock = $this->getMock( + $this->depersonalizeCheckerMock = $this->getMock( \Magento\PageCache\Model\DepersonalizeChecker::class, [], [], 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/CheckoutAgreements/Model/Agreement.php b/app/code/Magento/CheckoutAgreements/Model/Agreement.php index fd1de44e9879e..9e96d74cfc0e4 100644 --- a/app/code/Magento/CheckoutAgreements/Model/Agreement.php +++ b/app/code/Magento/CheckoutAgreements/Model/Agreement.php @@ -215,5 +215,6 @@ public function setExtensionAttributes( ) { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/CheckoutAgreements/Setup/InstallSchema.php b/app/code/Magento/CheckoutAgreements/Setup/InstallSchema.php index a2e070a787e02..c555811e6fb08 100644 --- a/app/code/Magento/CheckoutAgreements/Setup/InstallSchema.php +++ b/app/code/Magento/CheckoutAgreements/Setup/InstallSchema.php @@ -110,6 +110,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/DeleteButton.php b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/DeleteButton.php index 005cbddfcd99f..b6f842f013aa0 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/DeleteButton.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/DeleteButton.php @@ -12,7 +12,6 @@ */ class DeleteButton extends GenericButton implements ButtonProviderInterface { - /** * @return array */ diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/SaveAndContinueButton.php b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/SaveAndContinueButton.php index ef84753109026..7c47e06a37866 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/SaveAndContinueButton.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/SaveAndContinueButton.php @@ -12,7 +12,6 @@ */ class SaveAndContinueButton extends GenericButton implements ButtonProviderInterface { - /** * @return array */ diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/DeleteButton.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/DeleteButton.php index eea050666cb3e..9b29d663f1020 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/DeleteButton.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/DeleteButton.php @@ -12,7 +12,6 @@ */ class DeleteButton extends GenericButton implements ButtonProviderInterface { - /** * @return array */ diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/SaveAndContinueButton.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/SaveAndContinueButton.php index 182255761afcf..2da7c0d357984 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/SaveAndContinueButton.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/SaveAndContinueButton.php @@ -12,7 +12,6 @@ */ class SaveAndContinueButton extends GenericButton implements ButtonProviderInterface { - /** * @return array */ diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php index dbba38efb4f1d..3e324fab07cfa 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php @@ -5,7 +5,6 @@ */ namespace Magento\Cms\Block\Adminhtml\Wysiwyg\Images; - /** * Wysiwyg Images content block */ diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index de209e88782e5..e83ca108bc8c5 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -245,7 +245,6 @@ protected function removeItemFromCollection($collection, $conditions) if (array_key_exists($rootChildParts[1], $conditions['plain']) || ($regExp && preg_match($regExp, $value->getFilename()))) { - $collection->removeItemByKey($key); } } diff --git a/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/DataProviderTest.php b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/DataProviderTest.php index d8cd17aa16092..78a64e154320b 100644 --- a/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/DataProviderTest.php +++ b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/DataProviderTest.php @@ -5,7 +5,6 @@ */ namespace Magento\Cms\Test\Unit\Ui\Component\Listing; - use Magento\Cms\Ui\Component\DataProvider; use Magento\Framework\App\ObjectManager; use Magento\Framework\Authorization; @@ -130,6 +129,5 @@ public function testPrepareMetadata() $metadata, $this->dataProvider->prepareMetadata() ); - } } diff --git a/app/code/Magento/CmsUrlRewrite/Test/Unit/Model/CmsPageUrlRewriteGeneratorTest.php b/app/code/Magento/CmsUrlRewrite/Test/Unit/Model/CmsPageUrlRewriteGeneratorTest.php index 9e0d3be93fd34..6a4845632b0e1 100644 --- a/app/code/Magento/CmsUrlRewrite/Test/Unit/Model/CmsPageUrlRewriteGeneratorTest.php +++ b/app/code/Magento/CmsUrlRewrite/Test/Unit/Model/CmsPageUrlRewriteGeneratorTest.php @@ -5,7 +5,6 @@ */ namespace Magento\CmsUrlRewrite\Test\Unit\Model; - class CmsPageUrlRewriteGeneratorTest extends \PHPUnit_Framework_TestCase { /** diff --git a/app/code/Magento/Config/App/Config/Source/DumpConfigSourceAggregated.php b/app/code/Magento/Config/App/Config/Source/DumpConfigSourceAggregated.php index e19a832efc2de..b8e95f77b734f 100644 --- a/app/code/Magento/Config/App/Config/Source/DumpConfigSourceAggregated.php +++ b/app/code/Magento/Config/App/Config/Source/DumpConfigSourceAggregated.php @@ -86,8 +86,7 @@ private function filterChain($path, &$data) $newPath = $path ? $path . '/' . $subKey : $subKey; $filteredPath = $this->filterPath($newPath); - if ( - $filteredPath + if ($filteredPath && !is_array($data[$subKey]) && $this->excludeList->isPresent($filteredPath) ) { diff --git a/app/code/Magento/Config/Block/System/Config/Form.php b/app/code/Magento/Config/Block/System/Config/Form.php index e677ce42278e0..ba06f941d0f2c 100644 --- a/app/code/Magento/Config/Block/System/Config/Form.php +++ b/app/code/Magento/Config/Block/System/Config/Form.php @@ -436,7 +436,6 @@ private function getFieldData(\Magento\Config\Model\Config\Structure\Element\Fie ->afterLoad(); $data = $backendModel->getValue(); } - } elseif ($field->getConfigPath() !== null) { $data = $this->getConfigValue($field->getConfigPath()); } else { diff --git a/app/code/Magento/Config/Block/System/Config/Form/Fieldset.php b/app/code/Magento/Config/Block/System/Config/Form/Fieldset.php index 2e867d49c7df4..ddb7d6f4a20d1 100644 --- a/app/code/Magento/Config/Block/System/Config/Form/Fieldset.php +++ b/app/code/Magento/Config/Block/System/Config/Form/Fieldset.php @@ -239,8 +239,7 @@ protected function _getExtraJs($element) */ protected function _isCollapseState($element) { - if ( - $element->getExpanded() || + if ($element->getExpanded() || ($element->getForm() && $element->getForm()->getElements()->count() === 1) ) { return true; diff --git a/app/code/Magento/Config/Model/Config.php b/app/code/Magento/Config/Model/Config.php index bc4fefeab4167..8f0b5b1091e2d 100644 --- a/app/code/Magento/Config/Model/Config.php +++ b/app/code/Magento/Config/Model/Config.php @@ -203,7 +203,6 @@ protected function _processGroup( /** @var $group \Magento\Config\Model\Config\Structure\Element\Group */ $group = $this->_configStructure->getElement($groupPath); - // set value for group field entry by fieldname // use extra memory $fieldsetData = []; @@ -397,7 +396,6 @@ private function initScope() $this->setStore(''); } - if ($this->getStore()) { $scope = 'stores'; $store = $this->_storeManager->getStore($this->getStore()); diff --git a/app/code/Magento/Config/Model/Config/Backend/Admin/Custom.php b/app/code/Magento/Config/Model/Config/Backend/Admin/Custom.php index bcbc0011ff1df..c0d43f46d87f0 100644 --- a/app/code/Magento/Config/Model/Config/Backend/Admin/Custom.php +++ b/app/code/Magento/Config/Model/Config/Backend/Admin/Custom.php @@ -53,7 +53,6 @@ class Custom extends \Magento\Framework\App\Config\Value /* @var \Magento\Framework\App\Config\Storage\WriterInterface */ protected $_configWriter; - /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry diff --git a/app/code/Magento/Config/Model/Config/Backend/Currency/Cron.php b/app/code/Magento/Config/Model/Config/Backend/Currency/Cron.php index e95ed4d049908..1832657ed9d39 100644 --- a/app/code/Magento/Config/Model/Config/Backend/Currency/Cron.php +++ b/app/code/Magento/Config/Model/Config/Backend/Currency/Cron.php @@ -16,7 +16,6 @@ class Cron extends \Magento\Framework\App\Config\Value /** @var \Magento\Framework\App\Config\ValueFactory */ protected $_configValueFactory; - /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry diff --git a/app/code/Magento/Config/Model/Config/Backend/Encrypted.php b/app/code/Magento/Config/Model/Config/Backend/Encrypted.php index 86039fd2834ab..72853c7917993 100644 --- a/app/code/Magento/Config/Model/Config/Backend/Encrypted.php +++ b/app/code/Magento/Config/Model/Config/Backend/Encrypted.php @@ -61,7 +61,7 @@ public function __sleep() public function __wakeup() { parent::__wakeup(); - $this->_encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get( + $this->_encryptor = \Magento\Framework\App\ObjectManager::getInstance()->get( \Magento\Framework\Encryption\EncryptorInterface::class ); } diff --git a/app/code/Magento/Config/Model/Config/Backend/File.php b/app/code/Magento/Config/Model/Config/Backend/File.php index 7dcf1e1dd012c..404a3db902a3f 100644 --- a/app/code/Magento/Config/Model/Config/Backend/File.php +++ b/app/code/Magento/Config/Model/Config/Backend/File.php @@ -188,8 +188,7 @@ protected function _getUploadDir() if (is_array($fieldConfig['upload_dir'])) { $uploadDir = $fieldConfig['upload_dir']['value']; - if ( - array_key_exists('scope_info', $fieldConfig['upload_dir']) + if (array_key_exists('scope_info', $fieldConfig['upload_dir']) && $fieldConfig['upload_dir']['scope_info'] ) { $uploadDir = $this->_appendScopeInfo($uploadDir); diff --git a/app/code/Magento/Config/Model/Config/Backend/Secure.php b/app/code/Magento/Config/Model/Config/Backend/Secure.php index 163babae2648d..626796a8c4574 100644 --- a/app/code/Magento/Config/Model/Config/Backend/Secure.php +++ b/app/code/Magento/Config/Model/Config/Backend/Secure.php @@ -10,7 +10,6 @@ class Secure extends \Magento\Framework\App\Config\Value /** @var \Magento\Framework\View\Asset\MergeService */ protected $_mergeService; - /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry diff --git a/app/code/Magento/Config/Setup/InstallData.php b/app/code/Magento/Config/Setup/InstallData.php index 0b11d3be66103..811826c82bd27 100644 --- a/app/code/Magento/Config/Setup/InstallData.php +++ b/app/code/Magento/Config/Setup/InstallData.php @@ -34,6 +34,5 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $installer->doUpdateClassAliases(); $setup->endSetup(); - } } diff --git a/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php b/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php index f68e5871af956..de68a2c8d9ab6 100644 --- a/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php +++ b/app/code/Magento/Config/Test/Unit/Block/System/Config/FormTest.php @@ -269,7 +269,6 @@ public function testInitForm($sectionIsVisible) ->method('_initGroup'); } - $object->initForm(); $this->assertEquals($this->_formMock, $object->getForm()); } diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Source/Email/TemplateTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Source/Email/TemplateTest.php index add77ba058412..e286a52deb2e1 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/Source/Email/TemplateTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/Source/Email/TemplateTest.php @@ -34,7 +34,7 @@ protected function setUp() { $this->_coreRegistry = $this->getMock(\Magento\Framework\Registry::class, [], [], '', false, false); $this->_emailConfig = $this->getMock(\Magento\Email\Model\Template\Config::class, [], [], '', false); - $this->_templatesFactory = $this->getMock( + $this->_templatesFactory = $this->getMock( \Magento\Email\Model\ResourceModel\Template\CollectionFactory::class, [], [], diff --git a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php index e94e5bd881240..c0c4e6015ede9 100644 --- a/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php +++ b/app/code/Magento/Config/Test/Unit/Model/_files/converted_config.php @@ -165,7 +165,7 @@ 'type' => 'text', 'label' => '', '_elementType' => 'field', - ], + ], ], '_elementType' => 'group', ], diff --git a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Associated/Grid.php b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Associated/Grid.php index 772e2ba3de976..c29ce90c64eb4 100644 --- a/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Associated/Grid.php +++ b/app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Associated/Grid.php @@ -28,6 +28,7 @@ public function __construct( parent::__construct($context); $this->resultPageFactory = $resultPageFactory; } + /** * Index action * diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Attribute.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Attribute.php index e877d6e32f9e1..70cbc77df3324 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Attribute.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Attribute.php @@ -266,6 +266,7 @@ public function setProductId($value) { return $this->setData(self::KEY_PRODUCT_ID, $value); } + //@codeCoverageIgnoreEnd /** diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/OptionValue.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/OptionValue.php index 036c912da8a5b..a010c9a443dc8 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/OptionValue.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/OptionValue.php @@ -60,5 +60,6 @@ public function setExtensionAttributes( ) { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/ConfigurableProduct/Model/Quote/Item/ConfigurableItemOptionValue.php b/app/code/Magento/ConfigurableProduct/Model/Quote/Item/ConfigurableItemOptionValue.php index a8c7d8f23431e..57fbd930550b0 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Quote/Item/ConfigurableItemOptionValue.php +++ b/app/code/Magento/ConfigurableProduct/Model/Quote/Item/ConfigurableItemOptionValue.php @@ -14,6 +14,7 @@ class ConfigurableItemOptionValue extends AbstractExtensibleModel implements ConfigurableItemOptionValueInterface { //@codeCoverageIgnoreStart + /** * {@inheritdoc} */ diff --git a/app/code/Magento/ConfigurableProduct/Model/SuggestedAttributeList.php b/app/code/Magento/ConfigurableProduct/Model/SuggestedAttributeList.php index f902dd42259ad..b9632184a9035 100644 --- a/app/code/Magento/ConfigurableProduct/Model/SuggestedAttributeList.php +++ b/app/code/Magento/ConfigurableProduct/Model/SuggestedAttributeList.php @@ -20,6 +20,7 @@ class SuggestedAttributeList * @var \Magento\Catalog\Model\ResourceModel\Helper */ protected $_resourceHelper; + /** * @param ConfigurableAttributeHandler $configurableAttributeHandler * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper @@ -31,6 +32,7 @@ public function __construct( $this->configurableAttributeHandler = $configurableAttributeHandler; $this->_resourceHelper = $resourceHelper; } + /** * Retrieve list of attributes with admin store label containing $labelPart * diff --git a/app/code/Magento/ConfigurableProduct/Pricing/Price/ConfigurableRegularPrice.php b/app/code/Magento/ConfigurableProduct/Pricing/Price/ConfigurableRegularPrice.php index e593cfda9ce43..a7940bcc4f4b9 100644 --- a/app/code/Magento/ConfigurableProduct/Pricing/Price/ConfigurableRegularPrice.php +++ b/app/code/Magento/ConfigurableProduct/Pricing/Price/ConfigurableRegularPrice.php @@ -100,7 +100,6 @@ public function getMaxRegularAmount() $this->maxRegularAmount = $this->doGetMaxRegularAmount() ?: false; } return $this->maxRegularAmount; - } /** diff --git a/app/code/Magento/ConfigurableProduct/Setup/InstallSchema.php b/app/code/Magento/ConfigurableProduct/Setup/InstallSchema.php index fb2b3c80e8e09..f35d33c4c6a62 100644 --- a/app/code/Magento/ConfigurableProduct/Setup/InstallSchema.php +++ b/app/code/Magento/ConfigurableProduct/Setup/InstallSchema.php @@ -221,6 +221,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/PluginTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/PluginTest.php index 1b3db9b8e476e..4b814b85b8ced 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/PluginTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Type/PluginTest.php @@ -20,7 +20,7 @@ class PluginTest extends \PHPUnit_Framework_TestCase */ public function testAfterGetOptionArray(array $expected, array $data) { - $moduleManagerMock = $this->getMock( + $moduleManagerMock = $this->getMock( \Magento\Framework\Module\Manager::class, ['isOutputEnabled'], [], '', false ); $moduleManagerMock->expects($this->once()) diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/ProductVariationsBuilderTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/ProductVariationsBuilderTest.php index 346587f52454f..918c093bc2046 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/ProductVariationsBuilderTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/ProductVariationsBuilderTest.php @@ -6,7 +6,6 @@ namespace Magento\ConfigurableProduct\Test\Unit\Model; - class ProductVariationsBuilderTest extends \PHPUnit_Framework_TestCase { /** diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/SuggestedAttributeListTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/SuggestedAttributeListTest.php index 3cd94bd3568d7..87e472c135f43 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/SuggestedAttributeListTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/SuggestedAttributeListTest.php @@ -42,21 +42,21 @@ class SuggestedAttributeListTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->configurableAttributeHandler = $this->getMock( + $this->configurableAttributeHandler = $this->getMock( \Magento\ConfigurableProduct\Model\ConfigurableAttributeHandler::class, [], [], '', false ); - $this->resourceHelperMock = $this->getMock( + $this->resourceHelperMock = $this->getMock( \Magento\Catalog\Model\ResourceModel\Helper::class, [], [], '', false ); - $this->collectionMock = $this->getMock( + $this->collectionMock = $this->getMock( \Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection::class, [], [], @@ -91,7 +91,7 @@ protected function setUp() $this->returnValueMap($valueMap) ); $methods = ['getId', 'getFrontendLabel', 'getAttributeCode', 'getSource']; - $this->attributeMock = $this->getMock( + $this->attributeMock = $this->getMock( \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class, $methods, [], @@ -113,7 +113,7 @@ protected function setUp() public function testGetSuggestedAttributesIfTheyApplicable() { - $source = $this->getMock( + $source = $this->getMock( \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource::class, [], [], diff --git a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php index 9529172cbdcc2..bee100541f352 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php +++ b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php @@ -359,7 +359,6 @@ protected function getVariationKey(array $options = []) asort($result); return implode('-', $result); - } /** diff --git a/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/LifetimeTest.php b/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/LifetimeTest.php index a6d51f7edf090..781a6dab99c34 100644 --- a/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/LifetimeTest.php +++ b/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/LifetimeTest.php @@ -26,7 +26,7 @@ class LifetimeTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->validatorMock = $this->getMockBuilder( + $this->validatorMock = $this->getMockBuilder( \Magento\Framework\Session\Config\Validator\CookieLifetimeValidator::class )->disableOriginalConstructor() ->getMock(); @@ -35,7 +35,7 @@ protected function setUp() ->getMock(); $objectManager = new ObjectManager($this); - $this->model = $objectManager->getObject( + $this->model = $objectManager->getObject( \Magento\Cookie\Model\Config\Backend\Lifetime::class, [ 'configValidator' => $this->validatorMock, diff --git a/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/PathTest.php b/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/PathTest.php index 4706a7cc0d45b..f879d6f0c6832 100644 --- a/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/PathTest.php +++ b/app/code/Magento/Cookie/Test/Unit/Model/Config/Backend/PathTest.php @@ -26,7 +26,7 @@ class PathTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->validatorMock = $this->getMockBuilder( + $this->validatorMock = $this->getMockBuilder( \Magento\Framework\Session\Config\Validator\CookiePathValidator::class) ->disableOriginalConstructor() ->getMock(); @@ -35,7 +35,7 @@ protected function setUp() ->getMock(); $objectManager = new ObjectManager($this); - $this->model = $objectManager->getObject( + $this->model = $objectManager->getObject( \Magento\Cookie\Model\Config\Backend\Path::class, [ 'configValidator' => $this->validatorMock, diff --git a/app/code/Magento/Cron/Setup/InstallSchema.php b/app/code/Magento/Cron/Setup/InstallSchema.php index 1001a4d487205..3e0502e8d70c8 100644 --- a/app/code/Magento/Cron/Setup/InstallSchema.php +++ b/app/code/Magento/Cron/Setup/InstallSchema.php @@ -89,6 +89,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRates.php b/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRates.php index da908d99fe945..2b39b1fa42ea8 100644 --- a/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRates.php +++ b/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRates.php @@ -23,7 +23,7 @@ public function execute() try { foreach ($data as $currencyCode => $rate) { foreach ($rate as $currencyTo => $value) { - $value = abs($this->_objectManager->get( + $value = abs($this->_objectManager->get( \Magento\Framework\Locale\FormatInterface::class)->getNumber($value)); $data[$currencyCode][$currencyTo] = $value; if ($value == 0) { diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php index ba859462a0b0e..ccdc6331f5b6c 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Image.php @@ -4,7 +4,6 @@ * See COPYING.txt for license details. */ - /** * Customer Widget Form Image File Element Block * diff --git a/app/code/Magento/Customer/Controller/Adminhtml/File/Address/Upload.php b/app/code/Magento/Customer/Controller/Adminhtml/File/Address/Upload.php index 8f70dee5ad66f..cbf250f505492 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/File/Address/Upload.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/File/Address/Upload.php @@ -114,7 +114,7 @@ public function execute() */ private function convertFilesArray() { - foreach($_FILES['address'] as $itemKey => $item) { + foreach ($_FILES['address'] as $itemKey => $item) { foreach ($item as $value) { if (is_array($value)) { $_FILES['address'][$itemKey] = [ 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/Address/AbstractAddress.php b/app/code/Magento/Customer/Model/Address/AbstractAddress.php index 475116fb94272..bae46345cde48 100644 --- a/app/code/Magento/Customer/Model/Address/AbstractAddress.php +++ b/app/code/Magento/Customer/Model/Address/AbstractAddress.php @@ -584,21 +584,18 @@ public function validate() if ($this->isTelephoneRequired()) { if (!\Zend_Validate::is($this->getTelephone(), 'NotEmpty')) { $errors[] = __('%fieldName is a required field.', ['fieldName' => 'telephone']); - } } if ($this->isFaxRequired()) { if (!\Zend_Validate::is($this->getFax(), 'NotEmpty')) { $errors[] = __('%fieldName is a required field.', ['fieldName' => 'fax']); - } } if ($this->isCompanyRequired()) { if (!\Zend_Validate::is($this->getCompany(), 'NotEmpty')) { $errors[] = __('%fieldName is a required field.', ['fieldName' => 'company']); - } } 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/Metadata/Form/File.php b/app/code/Magento/Customer/Model/Metadata/Form/File.php index c0a3d195f971e..31a1d2593521d 100644 --- a/app/code/Magento/Customer/Model/Metadata/Form/File.php +++ b/app/code/Magento/Customer/Model/Metadata/Form/File.php @@ -127,7 +127,7 @@ public function extractValue(\Magento\Framework\App\RequestInterface $request) $value[$fileKey] = $scopeData[$attrCode]; } } - } else if (isset($extend[0]['file']) && !empty($extend[0]['file'])) { + } elseif (isset($extend[0]['file']) && !empty($extend[0]['file'])) { /** * This case is required by file uploader UI component * 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/Customer/Observer/AfterAddressSaveObserver.php b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php index 89cd1758c6462..c02abd9e8ee51 100644 --- a/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php +++ b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php @@ -190,8 +190,7 @@ protected function _canProcessAddress($address) return true; } - if ( - $this->_coreRegistry->registry(BeforeAddressSaveObserver::VIV_CURRENTLY_SAVED_ADDRESS) != $address->getId() + if ($this->_coreRegistry->registry(BeforeAddressSaveObserver::VIV_CURRENTLY_SAVED_ADDRESS) != $address->getId() ) { return false; } diff --git a/app/code/Magento/Customer/Setup/InstallSchema.php b/app/code/Magento/Customer/Setup/InstallSchema.php index bba058cde8319..efe926479683d 100644 --- a/app/code/Magento/Customer/Setup/InstallSchema.php +++ b/app/code/Magento/Customer/Setup/InstallSchema.php @@ -1273,6 +1273,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/Customer/Setup/UpgradeSchema.php b/app/code/Magento/Customer/Setup/UpgradeSchema.php index c4ab78f362fec..fdd776aa09a29 100755 --- a/app/code/Magento/Customer/Setup/UpgradeSchema.php +++ b/app/code/Magento/Customer/Setup/UpgradeSchema.php @@ -187,13 +187,11 @@ private function getForeignKeys(SchemaSetupInterface $setup) $keysTree = $setup->getConnection()->getForeignKeysTree(); foreach ($keysTree as $indexes) { foreach ($indexes as $index) { - if ( - $index['REF_TABLE_NAME'] == $setup->getTable('customer_group') + if ($index['REF_TABLE_NAME'] == $setup->getTable('customer_group') && $index['REF_COLUMN_NAME'] == 'customer_group_id' ) { $foreignKeys[] = $index; } - } } return $foreignKeys; diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php index 435b1edd77a1d..4a582b60e65aa 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php @@ -129,11 +129,11 @@ protected function setUp() $this->storeManagerMock = $this->getMock(\Magento\Store\Model\StoreManager::class, [], [], '', false); $this->storeMock = $this->getMock(\Magento\Store\Model\Store::class, [], [], '', false); $this->redirectResultMock = $this->getMock( - \Magento\Framework\Controller\Result\Redirect::class, - [], - [], - '', - false + \Magento\Framework\Controller\Result\Redirect::class, + [], + [], + '', + false ); $resultFactoryMock = $this->getMock( @@ -314,8 +314,6 @@ public function testSuccessMessage($customerId, $key, $vatValidationEnabled, $ad ->method('getStore') ->will($this->returnValue($this->storeMock)); - - $cookieMetadataManager = $this->getMockBuilder(\Magento\Framework\Stdlib\Cookie\PhpCookieManager::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php index 34437b2d10d79..7898fa481b90f 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php @@ -129,6 +129,7 @@ class CreatePostTest extends \PHPUnit_Framework_TestCase * @var \Magento\Framework\Controller\Result\RedirectFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $resultRedirectFactoryMock; + /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ @@ -151,17 +152,17 @@ protected function setUp() ->method('create') ->will($this->returnValue($this->urlMock)); - $this->customerMock = $this->getMock( + $this->customerMock = $this->getMock( \Magento\Customer\Api\Data\CustomerInterface::class, [], [], '', false ); - $this->customerDetailsMock = $this->getMock( + $this->customerDetailsMock = $this->getMock( \Magento\Customer\Api\Data\CustomerInterface::class, [], [], '', false ); - $this->customerDetailsFactoryMock = $this->getMock( + $this->customerDetailsFactoryMock = $this->getMock( \Magento\Customer\Api\Data\CustomerInterfaceFactory::class, [], [], '', false ); @@ -177,34 +178,34 @@ protected function setUp() $formFactoryMock = $this->getMock(\Magento\Customer\Model\Metadata\FormFactory::class, [], [], '', false); $this->subscriberMock = $this->getMock(\Magento\Newsletter\Model\Subscriber::class, [], [], '', false); - $subscriberFactoryMock = $this->getMock( + $subscriberFactoryMock = $this->getMock( \Magento\Newsletter\Model\SubscriberFactory::class, ['create'], [], '', false ); $subscriberFactoryMock->expects($this->any()) ->method('create') ->will($this->returnValue($this->subscriberMock)); - $regionFactoryMock = $this->getMock( + $regionFactoryMock = $this->getMock( \Magento\Customer\Api\Data\RegionInterfaceFactory::class, [], [], '', false ); - $addressFactoryMock = $this->getMock( + $addressFactoryMock = $this->getMock( \Magento\Customer\Api\Data\AddressInterfaceFactory::class, [], [], '', false ); $this->customerUrl = $this->getMock(\Magento\Customer\Model\Url::class, [], [], '', false); $this->registration = $this->getMock(\Magento\Customer\Model\Registration::class, [], [], '', false); $escaperMock = $this->getMock(\Magento\Framework\Escaper::class, [], [], '', false); - $this->customerExtractorMock = $this->getMock( - \Magento\Customer\Model\CustomerExtractor::class, - [], - [], - '', - false + $this->customerExtractorMock = $this->getMock( + \Magento\Customer\Model\CustomerExtractor::class, + [], + [], + '', + false ); $this->dataObjectHelperMock = $this->getMock(\Magento\Framework\Api\DataObjectHelper::class, [], [], '', false); $eventManagerMock = $this->getMock(\Magento\Framework\Event\ManagerInterface::class, [], [], '', false); - $this->resultRedirectFactoryMock = $this->getMockBuilder( + $this->resultRedirectFactoryMock = $this->getMockBuilder( \Magento\Framework\Controller\Result\RedirectFactory::class) ->setMethods(['create']) ->getMock(); @@ -232,7 +233,7 @@ protected function setUp() ->method('getResultRedirectFactory') ->willReturn($this->resultRedirectFactoryMock); - $this->model = $objectManager->getObject( + $this->model = $objectManager->getObject( \Magento\Customer\Controller\Account\CreatePost::class, [ 'context' => $contextMock, diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php index dc4c80a7c2482..fa3faf9fdcab7 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreateTest.php @@ -65,15 +65,15 @@ protected function setUp() $this->response = $this->getMock(\Magento\Framework\App\ResponseInterface::class); $this->request = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) ->disableOriginalConstructor()->getMock(); - $this->redirectResultMock = $this->getMock( - \Magento\Framework\Controller\Result\Redirect::class, - [], - [], - '', - false + $this->redirectResultMock = $this->getMock( + \Magento\Framework\Controller\Result\Redirect::class, + [], + [], + '', + false ); - $this->redirectFactoryMock = $this->getMock( + $this->redirectFactoryMock = $this->getMock( \Magento\Framework\Controller\Result\RedirectFactory::class, ['create'], [], @@ -84,7 +84,7 @@ protected function setUp() $this->resultPageMock = $this->getMock(\Magento\Framework\View\Result\Page::class, [], [], '', false ); $this->pageFactoryMock = $this->getMock(\Magento\Framework\View\Result\PageFactory::class, [], [], '', false); - $this->object = $objectManager->getObject( + $this->object = $objectManager->getObject( \Magento\Customer\Controller\Account\Create::class, [ 'request' => $this->request, diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Ajax/LoginTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Ajax/LoginTest.php index c399eac1f2d82..420bc81859ec4 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Ajax/LoginTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Ajax/LoginTest.php @@ -77,14 +77,14 @@ protected function setUp() { $this->request = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) ->disableOriginalConstructor()->getMock(); - $this->response = $this->getMock( + $this->response = $this->getMock( \Magento\Framework\App\ResponseInterface::class, ['setRedirect', 'sendResponse', 'representJson', 'setHttpResponseCode'], [], '', false ); - $this->customerSession = $this->getMock( + $this->customerSession = $this->getMock( \Magento\Customer\Model\Session::class, [ 'isLoggedIn', @@ -98,7 +98,7 @@ protected function setUp() '', false ); - $this->objectManager = $this->getMock( + $this->objectManager = $this->getMock( \Magento\Framework\ObjectManager\ObjectManager::class, ['get'], [], @@ -106,7 +106,7 @@ protected function setUp() false ); $this->customerAccountManagementMock = - $this->getMock( + $this->getMock( \Magento\Customer\Model\AccountManagement::class, ['authenticate'], [], @@ -114,7 +114,7 @@ protected function setUp() false ); - $this->jsonHelperMock = $this->getMock( + $this->jsonHelperMock = $this->getMock( \Magento\Framework\Json\Helper\Data::class, ['jsonDecode'], [], @@ -147,7 +147,7 @@ protected function setUp() $contextMock->expects($this->atLeastOnce())->method('getRequest')->willReturn($this->request); $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->object = $objectManager->getObject( + $this->object = $objectManager->getObject( \Magento\Customer\Controller\Ajax\Login::class, [ 'context' => $contextMock, diff --git a/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php b/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php index 4a9b78bc121af..9376defd4b634 100644 --- a/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php +++ b/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php @@ -72,21 +72,21 @@ protected function setUp() { $this->customerSessionMock = $this->getMock(\Magento\Customer\Model\Session::class, [], [], '', false); $this->layoutMock = $this->getMock(\Magento\Framework\View\Layout::class, [], [], '', false); - $this->customerInterfaceFactoryMock = $this->getMock( + $this->customerInterfaceFactoryMock = $this->getMock( \Magento\Customer\Api\Data\CustomerInterfaceFactory::class, ['create', 'setGroupId'], [], '', false ); - $this->customerDataMock = $this->getMock( + $this->customerDataMock = $this->getMock( \Magento\Customer\Api\Data\CustomerInterface::class, [], [], '', false ); - $this->customerRepositoryMock = $this->getMock( + $this->customerRepositoryMock = $this->getMock( \Magento\Customer\Api\CustomerRepositoryInterface::class, [], [], diff --git a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/DateTest.php b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/DateTest.php index dee3e3a98d045..db88efbb99009 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/DateTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/DateTest.php @@ -7,7 +7,6 @@ */ namespace Magento\Customer\Test\Unit\Model\Metadata\Form; - class DateTest extends AbstractFormTestCase { /** @var \Magento\Customer\Model\Metadata\Form\Date */ diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php index b25f63bcfc663..fe88039363e9c 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/AddressTest.php @@ -41,7 +41,6 @@ protected function setUp() false ); - $this->entityRelationCompositeMock = $this->getMock( \Magento\Framework\Model\ResourceModel\Db\VersionControl\RelationComposite::class, [], diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProvider/DocumentTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProvider/DocumentTest.php index ccea8265365cf..48adc02aa6d90 100644 --- a/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProvider/DocumentTest.php +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProvider/DocumentTest.php @@ -20,7 +20,7 @@ /** * Class DocumentTest - * + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class DocumentTest extends \PHPUnit_Framework_TestCase diff --git a/app/code/Magento/Customer/Ui/Component/Listing/AttributeRepository.php b/app/code/Magento/Customer/Ui/Component/Listing/AttributeRepository.php index ad89b7cb0564e..2c98d65c1a4c6 100644 --- a/app/code/Magento/Customer/Ui/Component/Listing/AttributeRepository.php +++ b/app/code/Magento/Customer/Ui/Component/Listing/AttributeRepository.php @@ -129,7 +129,6 @@ protected function getOptionArray(array $options) return $options; } - /** * @param string $code * @return [] diff --git a/app/code/Magento/CustomerImportExport/Model/Import/AbstractCustomer.php b/app/code/Magento/CustomerImportExport/Model/Import/AbstractCustomer.php index 1cb17a9318ea9..6056a5e2ea7d9 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/AbstractCustomer.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/AbstractCustomer.php @@ -28,7 +28,6 @@ abstract class AbstractCustomer extends \Magento\ImportExport\Model\Import\Entit const COLUMN_DEFAULT_SHIPPING = 'default_shipping'; - /**#@-*/ /**#@+ diff --git a/app/code/Magento/CustomerImportExport/Model/Import/Address.php b/app/code/Magento/CustomerImportExport/Model/Import/Address.php index c137475e7d6f6..85f677e79c4e5 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/Address.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/Address.php @@ -527,7 +527,6 @@ protected function _prepareDataForUpdate(array $rowData) continue; } } elseif ($newAddress && !strlen($rowData[$attributeAlias])) { - } elseif ('select' == $attributeParams['type']) { $value = $attributeParams['options'][strtolower($rowData[$attributeAlias])]; } elseif ('datetime' == $attributeParams['type']) { @@ -599,7 +598,6 @@ protected function _saveAddressEntities(array $addRows, array $updateRows) $fields = array_diff(array_keys($row), ['entity_id', 'parent_id', 'created_at']); $this->_connection->insertOnDuplicate($this->_entityTable, $row, $fields); } - } return $this; } @@ -645,7 +643,6 @@ protected function _saveCustomerDefaults(array $defaults) ); $this->_connection->insertOnDuplicate($tableName, $data, array_keys($defaultsData)); } - } return $this; } @@ -753,8 +750,7 @@ protected function _validateRowForUpdate(array $rowData, $rowNumber) } } - if ( - isset($rowData[self::COLUMN_POSTCODE]) + if (isset($rowData[self::COLUMN_POSTCODE]) && isset($rowData[self::COLUMN_COUNTRY_ID]) && !$this->postcodeValidator->isValid( $rowData[self::COLUMN_COUNTRY_ID], diff --git a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerCompositeTest.php b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerCompositeTest.php index 4f31066a37fc5..969243735e911 100644 --- a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerCompositeTest.php +++ b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/CustomerCompositeTest.php @@ -131,7 +131,7 @@ protected function setUp() $this->_string = new \Magento\Framework\Stdlib\StringUtils(); - $this->_importFactory = $this->getMock( + $this->_importFactory = $this->getMock( \Magento\ImportExport\Model\ImportFactory::class, [], [], @@ -139,28 +139,28 @@ protected function setUp() false ); $this->_resource = $this->getMock(\Magento\Framework\App\ResourceConnection::class, [], [], '', false); - $this->_resourceHelper = $this->getMock( + $this->_resourceHelper = $this->getMock( \Magento\ImportExport\Model\ResourceModel\Helper::class, [], [], '', false ); - $this->_dataFactory = $this->getMock( + $this->_dataFactory = $this->getMock( \Magento\CustomerImportExport\Model\ResourceModel\Import\CustomerComposite\DataFactory::class, [], [], '', false ); - $this->_customerFactory = $this->getMock( + $this->_customerFactory = $this->getMock( \Magento\CustomerImportExport\Model\Import\CustomerFactory::class, [], [], '', false ); - $this->_addressFactory = $this->getMock( + $this->_addressFactory = $this->getMock( \Magento\CustomerImportExport\Model\Import\AddressFactory::class, [], [], @@ -168,7 +168,7 @@ protected function setUp() false ); - $this->errorFactory = $this->getMock( + $this->errorFactory = $this->getMock( \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorFactory::class, ['create'], [], @@ -176,7 +176,7 @@ protected function setUp() false ); - $this->error = $this->getMock( + $this->error = $this->getMock( \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError::class, ['init'], [], @@ -187,7 +187,7 @@ protected function setUp() $this->errorFactory->expects($this->any())->method('create')->will($this->returnValue($this->error)); $this->error->expects($this->any())->method('init')->will($this->returnValue(true)); - $this->errorAggregator = $this->getMock( + $this->errorAggregator = $this->getMock( \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregator::class, ['hasToBeTerminated'], [$this->errorFactory], @@ -309,7 +309,7 @@ protected function _getCustomerEntityMock(array $mockedMethods = null) $mockedMethods[] = 'getAttributeCollection'; $mockedMethods[] = 'getWebsiteId'; - $customerEntity = $this->getMock( + $customerEntity = $this->getMock( \Magento\CustomerImportExport\Model\Import\Customer::class, $mockedMethods, [], @@ -344,7 +344,7 @@ protected function _getAddressEntityMock(array $mockedMethods = null) } $mockedMethods[] = 'getAttributeCollection'; - $addressEntity = $this->getMock( + $addressEntity = $this->getMock( \Magento\CustomerImportExport\Model\Import\Address::class, $mockedMethods, [], @@ -641,7 +641,7 @@ public function testSetSource() $modelUnderTest = $this->_createModelMock($data); - $source = $this->getMockForAbstractClass( + $source = $this->getMockForAbstractClass( \Magento\ImportExport\Model\Import\AbstractSource::class, [], '', diff --git a/app/code/Magento/Deploy/Console/Command/SetModeCommand.php b/app/code/Magento/Deploy/Console/Command/SetModeCommand.php index 4629ebe8b7c1c..410a223ac6227 100644 --- a/app/code/Magento/Deploy/Console/Command/SetModeCommand.php +++ b/app/code/Magento/Deploy/Console/Command/SetModeCommand.php @@ -89,7 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ); $toMode = $input->getArgument(self::MODE_ARGUMENT); $skipCompilation = $input->getOption(self::SKIP_COMPILATION_OPTION); - switch($toMode) { + switch ($toMode) { case State::MODE_DEVELOPER: $modeController->enableDeveloperMode(); break; diff --git a/app/code/Magento/Deploy/Model/ConfigWriter.php b/app/code/Magento/Deploy/Model/ConfigWriter.php index 8713442c9b0b1..126cd525cc828 100644 --- a/app/code/Magento/Deploy/Model/ConfigWriter.php +++ b/app/code/Magento/Deploy/Model/ConfigWriter.php @@ -96,8 +96,7 @@ private function setConfig(array $config, $configPath, $configValue) private function getPathPrefix($scope, $scopeCode) { $pathPrefixes = [System::CONFIG_TYPE, $scope]; - if ( - $scope !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT + if ($scope !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT && !empty($scopeCode) ) { $pathPrefixes[] = $scopeCode; diff --git a/app/code/Magento/Deploy/Model/Deploy/LocaleDeploy.php b/app/code/Magento/Deploy/Model/Deploy/LocaleDeploy.php index 22274b45b14e9..f567dd2f1bfc6 100644 --- a/app/code/Magento/Deploy/Model/Deploy/LocaleDeploy.php +++ b/app/code/Magento/Deploy/Model/Deploy/LocaleDeploy.php @@ -333,7 +333,6 @@ private function isCanBeDeployed($fileArea, $fileTheme, $area, $themePath) private function deployLibFiles($area, $themePath, $locale) { foreach ($this->filesUtil->getStaticLibraryFiles() as $filePath) { - if ($this->checkSkip($filePath)) { continue; } diff --git a/app/code/Magento/Deploy/Model/DeployManager.php b/app/code/Magento/Deploy/Model/DeployManager.php index a5cbd0eb93a91..31b373c8292d0 100644 --- a/app/code/Magento/Deploy/Model/DeployManager.php +++ b/app/code/Magento/Deploy/Model/DeployManager.php @@ -182,7 +182,6 @@ private function runInParallel(DeployStrategyProvider $strategyProvider) } else { $dependentStrategy[] = $deploymentFunc; } - } $processQueueManager->addTaskToQueue($baseStrategy, $dependentStrategy); } diff --git a/app/code/Magento/Developer/Model/Config/Backend/WorkflowType.php b/app/code/Magento/Developer/Model/Config/Backend/WorkflowType.php index 9f57e1c517fd6..d3eafc236e6d3 100644 --- a/app/code/Magento/Developer/Model/Config/Backend/WorkflowType.php +++ b/app/code/Magento/Developer/Model/Config/Backend/WorkflowType.php @@ -55,7 +55,6 @@ public function beforeSave() if ($this->isValueChanged() && $this->_appState->getMode() == \Magento\Framework\App\State::MODE_PRODUCTION && $this->getValue() == \Magento\Developer\Model\Config\Source\WorkflowType::CLIENT_SIDE_COMPILATION) { - throw new \Magento\Framework\Exception\LocalizedException( __('Client side compilation doesn\'t work in production mode') ); diff --git a/app/code/Magento/Directory/Model/Country/Postcode/ConfigInterface.php b/app/code/Magento/Directory/Model/Country/Postcode/ConfigInterface.php index f6f13f6ecf6d7..ae1aed12f2b62 100644 --- a/app/code/Magento/Directory/Model/Country/Postcode/ConfigInterface.php +++ b/app/code/Magento/Directory/Model/Country/Postcode/ConfigInterface.php @@ -7,7 +7,6 @@ interface ConfigInterface { - /** * Returns array of postcodes validation patterns * diff --git a/app/code/Magento/Directory/Model/Data/CurrencyInformation.php b/app/code/Magento/Directory/Model/Data/CurrencyInformation.php index f58f9b09734e8..ecd8c3fc4b9ed 100644 --- a/app/code/Magento/Directory/Model/Data/CurrencyInformation.php +++ b/app/code/Magento/Directory/Model/Data/CurrencyInformation.php @@ -118,7 +118,6 @@ public function setExchangeRates(array $exchangeRates = null) return $this->setData(self::KEY_EXCHANGE_RATES, $exchangeRates); } - /** * @inheritDoc */ diff --git a/app/code/Magento/Directory/Setup/InstallSchema.php b/app/code/Magento/Directory/Setup/InstallSchema.php index ace5dfdf9108a..c064f6426cff3 100644 --- a/app/code/Magento/Directory/Setup/InstallSchema.php +++ b/app/code/Magento/Directory/Setup/InstallSchema.php @@ -206,6 +206,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/Downloadable/Api/Data/LinkInterface.php b/app/code/Magento/Downloadable/Api/Data/LinkInterface.php index 61ffb6aa826c4..b24056608f501 100644 --- a/app/code/Magento/Downloadable/Api/Data/LinkInterface.php +++ b/app/code/Magento/Downloadable/Api/Data/LinkInterface.php @@ -11,7 +11,6 @@ */ interface LinkInterface extends \Magento\Framework\Api\ExtensibleDataInterface { - /** * @return int|null Sample(or link) id */ diff --git a/app/code/Magento/Downloadable/Api/Data/SampleInterface.php b/app/code/Magento/Downloadable/Api/Data/SampleInterface.php index ed25cb24eea44..96e87b548d17b 100644 --- a/app/code/Magento/Downloadable/Api/Data/SampleInterface.php +++ b/app/code/Magento/Downloadable/Api/Data/SampleInterface.php @@ -13,7 +13,6 @@ */ interface SampleInterface extends \Magento\Framework\Api\ExtensibleDataInterface { - /** * Product sample id * diff --git a/app/code/Magento/Downloadable/Model/Link.php b/app/code/Magento/Downloadable/Model/Link.php index fa5f413026787..a632cf7be8b4c 100644 --- a/app/code/Magento/Downloadable/Model/Link.php +++ b/app/code/Magento/Downloadable/Model/Link.php @@ -428,5 +428,6 @@ public function setExtensionAttributes(\Magento\Downloadable\Api\Data\LinkExtens { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/Downloadable/Observer/IsAllowedGuestCheckoutObserver.php b/app/code/Magento/Downloadable/Observer/IsAllowedGuestCheckoutObserver.php index bd93e99e68a22..5c28ec6373e77 100644 --- a/app/code/Magento/Downloadable/Observer/IsAllowedGuestCheckoutObserver.php +++ b/app/code/Magento/Downloadable/Observer/IsAllowedGuestCheckoutObserver.php @@ -31,7 +31,6 @@ public function __construct( $this->_scopeConfig = $scopeConfig; } - /** * Check is allowed guest checkout if quote contain downloadable product(s) * diff --git a/app/code/Magento/Downloadable/Observer/SetLinkStatusObserver.php b/app/code/Magento/Downloadable/Observer/SetLinkStatusObserver.php index 4962ac67bb711..c3fff29776ae4 100644 --- a/app/code/Magento/Downloadable/Observer/SetLinkStatusObserver.php +++ b/app/code/Magento/Downloadable/Observer/SetLinkStatusObserver.php @@ -34,7 +34,6 @@ public function __construct( $this->_itemsFactory = $itemsFactory; } - /** * Set status of link * diff --git a/app/code/Magento/Downloadable/Setup/InstallSchema.php b/app/code/Magento/Downloadable/Setup/InstallSchema.php index 01c3760913fd7..9adea2d14d350 100644 --- a/app/code/Magento/Downloadable/Setup/InstallSchema.php +++ b/app/code/Magento/Downloadable/Setup/InstallSchema.php @@ -717,6 +717,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php index 898e8d6085442..a00b3c8f5ae99 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php @@ -111,7 +111,7 @@ protected function _prepareForm() $attributeObject = $this->getAttributeObject(); /** @var \Magento\Framework\Data\Form $form */ - $form = $this->_formFactory->create( + $form = $this->_formFactory->create( ['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']] ); diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php index 5ec997b768939..a34bb483a0e8a 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php @@ -84,7 +84,7 @@ public function getStores() /** * Returns stores sorted by Sort Order - * + * * @return array */ public function getStoresSortedBySortOrder() diff --git a/app/code/Magento/Eav/Model/CustomAttributesMapper.php b/app/code/Magento/Eav/Model/CustomAttributesMapper.php index 8fb31324822f9..9365071950e80 100644 --- a/app/code/Magento/Eav/Model/CustomAttributesMapper.php +++ b/app/code/Magento/Eav/Model/CustomAttributesMapper.php @@ -5,7 +5,6 @@ */ namespace Magento\Eav\Model; - use Magento\Framework\Api\AttributeInterface; use Magento\Framework\Api\CustomAttributesDataInterface; use Magento\Eav\Api\AttributeRepositoryInterface; diff --git a/app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator/ComplexType.php b/app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator/ComplexType.php index 5c4e7b477105f..48ce5c7ba442f 100644 --- a/app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator/ComplexType.php +++ b/app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator/ComplexType.php @@ -30,7 +30,7 @@ public function __construct( /** * Get attribute type based on its backend model. - * + * * @param \Magento\Eav\Api\Data\AttributeInterface $attribute * @param string $serviceClass * @param $serviceBackendModelDataInterfaceMap array diff --git a/app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator/SimpleType.php b/app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator/SimpleType.php index e06b00b18d077..e6903d4688b3c 100644 --- a/app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator/SimpleType.php +++ b/app/code/Magento/Eav/Model/EavCustomAttributeTypeLocator/SimpleType.php @@ -15,7 +15,7 @@ class SimpleType { /** * List of attributes, type of which cannot be identified reliably. We do not validate these attributes. - * + * * @var string[] */ private $anyTypeAttributes = ['quantity_and_stock_status']; diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php b/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php index b27cace0ee83c..e58c82f77397b 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/AbstractAttribute.php @@ -1106,6 +1106,7 @@ public function setIsRequired($isRequired) { return $this->setData(self::IS_REQUIRED, $isRequired); } + //@codeCoverageIgnoreEnd /** @@ -1264,6 +1265,7 @@ public function setSourceModel($sourceModel) { return $this->setData(self::SOURCE_MODEL, $sourceModel); } + //@codeCoverageIgnoreEnd /** diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Group.php b/app/code/Magento/Eav/Model/Entity/Attribute/Group.php index 45fa3351d8c96..06b7004013158 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Group.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Group.php @@ -193,5 +193,6 @@ public function setExtensionAttributes( ) { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Set.php b/app/code/Magento/Eav/Model/Entity/Attribute/Set.php index 79476a4079f7c..adb7290851140 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Set.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Set.php @@ -487,5 +487,6 @@ public function setExtensionAttributes(\Magento\Eav\Api\Data\AttributeSetExtensi { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/Eav/Model/ResourceModel/Form/Fieldset/Collection.php b/app/code/Magento/Eav/Model/ResourceModel/Form/Fieldset/Collection.php index ed902da57c8e1..26e36ab188dd2 100644 --- a/app/code/Magento/Eav/Model/ResourceModel/Form/Fieldset/Collection.php +++ b/app/code/Magento/Eav/Model/ResourceModel/Form/Fieldset/Collection.php @@ -4,7 +4,6 @@ * See COPYING.txt for license details. */ - /** * Eav Form Fieldset Resource Collection * diff --git a/app/code/Magento/Eav/Plugin/Model/ResourceModel/Entity/Attribute.php b/app/code/Magento/Eav/Plugin/Model/ResourceModel/Entity/Attribute.php index 3aa52b3618820..ac41a3be837e5 100644 --- a/app/code/Magento/Eav/Plugin/Model/ResourceModel/Entity/Attribute.php +++ b/app/code/Magento/Eav/Plugin/Model/ResourceModel/Entity/Attribute.php @@ -82,7 +82,7 @@ public function aroundGetStoreLabelsByAttributeId( /** * Check if cache is enabled - * + * * @return bool */ private function isCacheEnabled() diff --git a/app/code/Magento/Eav/Setup/EavSetup.php b/app/code/Magento/Eav/Setup/EavSetup.php index 5872057bebf92..8829ae6319cdb 100644 --- a/app/code/Magento/Eav/Setup/EavSetup.php +++ b/app/code/Magento/Eav/Setup/EavSetup.php @@ -770,12 +770,12 @@ private function _validateAttributeData($data) $attributeCodeMaxLength = \Magento\Eav\Model\Entity\Attribute::ATTRIBUTE_CODE_MAX_LENGTH; if (isset( - $data['attribute_code'] - ) && !\Zend_Validate::is( - $data['attribute_code'], - 'StringLength', - ['max' => $attributeCodeMaxLength] - ) + $data['attribute_code'] + ) && !\Zend_Validate::is( + $data['attribute_code'], + 'StringLength', + ['max' => $attributeCodeMaxLength] + ) ) { throw new LocalizedException( __('An attribute code must not be more than %1 characters.', $attributeCodeMaxLength) diff --git a/app/code/Magento/Eav/Setup/InstallSchema.php b/app/code/Magento/Eav/Setup/InstallSchema.php index 3494cf02f9622..2ab1ad3660684 100644 --- a/app/code/Magento/Eav/Setup/InstallSchema.php +++ b/app/code/Magento/Eav/Setup/InstallSchema.php @@ -1415,6 +1415,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/FileTest.php b/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/FileTest.php index 63afe832ec468..c2baf390d44b1 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/FileTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/FileTest.php @@ -31,7 +31,7 @@ protected function setUp() $loggerMock = $this->getMock(\Psr\Log\LoggerInterface::class, [], [], '', false); $localeResolverMock = $this->getMock(\Magento\Framework\Locale\ResolverInterface::class); $this->urlEncoder = $this->getMock(\Magento\Framework\Url\EncoderInterface::class, [], [], '', false); - $this->fileValidatorMock = $this->getMock( + $this->fileValidatorMock = $this->getMock( \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension::class, ['isValid', 'getMessages'], [], '', false ); $filesystemMock = $this->getMock(\Magento\Framework\Filesystem::class, [], [], '', false); diff --git a/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/ImageTest.php b/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/ImageTest.php index e691f17a99cbe..bd25b99cc026b 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/ImageTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/ImageTest.php @@ -22,7 +22,7 @@ protected function setUp() $loggerMock = $this->getMock(\Psr\Log\LoggerInterface::class, [], [], '', false); $localeResolverMock = $this->getMock(\Magento\Framework\Locale\ResolverInterface::class); $urlEncoder = $this->getMock(\Magento\Framework\Url\EncoderInterface::class, [], [], '', false); - $fileValidatorMock = $this->getMock( + $fileValidatorMock = $this->getMock( \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension::class, [], [], '', false ); $filesystemMock = $this->getMock(\Magento\Framework\Filesystem::class, [], [], '', false); diff --git a/app/code/Magento/Eav/Test/Unit/Model/AttributeManagementTest.php b/app/code/Magento/Eav/Test/Unit/Model/AttributeManagementTest.php index 7fe219851bb0e..735450e08a4c0 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/AttributeManagementTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/AttributeManagementTest.php @@ -303,6 +303,7 @@ public function testUnassignInputException() $this->model->unassign($attributeSetId, $attributeCode); } + /** * @expectedException \Magento\Framework\Exception\NoSuchEntityException * @expectedExceptionMessage Attribute set not found: 1 diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/AbstractAttributeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/AbstractAttributeTest.php index 11bdc07c8fe00..e50c0405ca2f0 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/AbstractAttributeTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/AbstractAttributeTest.php @@ -1,5 +1,5 @@ [ 'new_option' => 'optionSortOrder', ], - ]; + ]; $this->attributeRepositoryMock->expects($this->once())->method('get')->with($entityType, $attributeCode) ->willReturn($attributeMock); diff --git a/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/Entity/Attribute/SetTest.php b/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/Entity/Attribute/SetTest.php index 211487292d047..5dbe7d3b63413 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/Entity/Attribute/SetTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/ResourceModel/Entity/Attribute/SetTest.php @@ -1,5 +1,5 @@ emulatedDesignConfig = clone $this->getDesignConfig(); - if ( - $this->getDesignConfig()->getStore() != $storeId + if ($this->getDesignConfig()->getStore() != $storeId || $this->getDesignConfig()->getArea() != $area ) { $this->setDesignConfig(['area' => $area, 'store' => $storeId]); diff --git a/app/code/Magento/Email/Setup/InstallSchema.php b/app/code/Magento/Email/Setup/InstallSchema.php index 7aa58ff4517a2..66a2a45f1a0fe 100644 --- a/app/code/Magento/Email/Setup/InstallSchema.php +++ b/app/code/Magento/Email/Setup/InstallSchema.php @@ -119,6 +119,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con ); $installer->getConnection()->createTable($table); - } } diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php index ffb0fcb02e230..f927ee83cf8ff 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/Config/XsdTest.php @@ -116,12 +116,12 @@ public function mergedXmlDataProvider() */ protected function _testXmlAgainstXsd($fixtureXml, $schemaFile, array $expectedErrors) { - $validationStateMock = $this->getMock( - \Magento\Framework\Config\ValidationStateInterface::class, - [], - [], - '', - false + $validationStateMock = $this->getMock( + \Magento\Framework\Config\ValidationStateInterface::class, + [], + [], + '', + false ); $validationStateMock->method('isValidationRequired') ->willReturn(true); diff --git a/app/code/Magento/Fedex/Setup/InstallData.php b/app/code/Magento/Fedex/Setup/InstallData.php index f59decdbeef20..12f871757c934 100644 --- a/app/code/Magento/Fedex/Setup/InstallData.php +++ b/app/code/Magento/Fedex/Setup/InstallData.php @@ -106,6 +106,5 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $conn->update($configDataTable, ['value' => $mapNew], $whereConfigId); } } - } } diff --git a/app/code/Magento/GiftMessage/Model/Message.php b/app/code/Magento/GiftMessage/Model/Message.php index 379d67fddc01c..87ae1cf82c74c 100644 --- a/app/code/Magento/GiftMessage/Model/Message.php +++ b/app/code/Magento/GiftMessage/Model/Message.php @@ -186,5 +186,6 @@ public function setExtensionAttributes(\Magento\GiftMessage\Api\Data\MessageExte { return $this->_setExtensionAttributes($extensionAttributes); } + //@codeCoverageIgnoreEnd } diff --git a/app/code/Magento/GiftMessage/Model/Plugin/OrderSave.php b/app/code/Magento/GiftMessage/Model/Plugin/OrderSave.php index 0f064dc72b7d2..588ba3f637239 100644 --- a/app/code/Magento/GiftMessage/Model/Plugin/OrderSave.php +++ b/app/code/Magento/GiftMessage/Model/Plugin/OrderSave.php @@ -61,8 +61,7 @@ public function afterSave( protected function saveOrderGiftMessage(\Magento\Sales\Api\Data\OrderInterface $order) { $extensionAttributes = $order->getExtensionAttributes(); - if ( - null !== $extensionAttributes && + if (null !== $extensionAttributes && null !== $extensionAttributes->getGiftMessage() ) { /* @var \Magento\GiftMessage\Api\Data\MessageInterface $giftMessage */ @@ -93,8 +92,7 @@ protected function saveOrderItemGiftMessage(\Magento\Sales\Api\Data\OrderInterfa /** @var \Magento\Sales\Api\Data\OrderItemInterface $orderItem */ foreach ($items as $orderItem) { $extensionAttribute = $orderItem->getExtensionAttributes(); - if ( - null !== $extensionAttribute && + if (null !== $extensionAttribute && null !== $extensionAttribute->getGiftMessage() ) { /* @var \Magento\GiftMessage\Api\Data\MessageInterface $giftMessage */ diff --git a/app/code/Magento/GiftMessage/Setup/InstallSchema.php b/app/code/Magento/GiftMessage/Setup/InstallSchema.php index a3deb694aa23d..5c27f4ce66698 100644 --- a/app/code/Magento/GiftMessage/Setup/InstallSchema.php +++ b/app/code/Magento/GiftMessage/Setup/InstallSchema.php @@ -65,6 +65,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/GiftMessage/Setup/UpgradeData.php b/app/code/Magento/GiftMessage/Setup/UpgradeData.php index 16ae64a6d5aba..58cf50372885c 100644 --- a/app/code/Magento/GiftMessage/Setup/UpgradeData.php +++ b/app/code/Magento/GiftMessage/Setup/UpgradeData.php @@ -42,7 +42,6 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $attribute = $categorySetup->getAttribute($entityTypeId, 'gift_message_available'); if (version_compare($context->getVersion(), '2.0.1', '<')) { - $groupName = 'Gift Options'; if (!$categorySetup->getAttributeGroup(Product::ENTITY, $attributeSetId, $groupName)) { @@ -59,7 +58,6 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface } if (version_compare($context->getVersion(), '2.1.0', '<')) { - $categorySetup->updateAttribute( $entityTypeId, $attribute['attribute_id'], diff --git a/app/code/Magento/GiftMessage/Test/Unit/Model/CartRepositoryTest.php b/app/code/Magento/GiftMessage/Test/Unit/Model/CartRepositoryTest.php index 558bc5892af3e..c772f7ffced53 100644 --- a/app/code/Magento/GiftMessage/Test/Unit/Model/CartRepositoryTest.php +++ b/app/code/Magento/GiftMessage/Test/Unit/Model/CartRepositoryTest.php @@ -70,7 +70,7 @@ class CartRepositoryTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->quoteRepositoryMock = $this->getMock(\Magento\Quote\Api\CartRepositoryInterface::class); - $this->messageFactoryMock = $this->getMock( + $this->messageFactoryMock = $this->getMock( \Magento\GiftMessage\Model\MessageFactory::class, [ 'create', @@ -81,7 +81,7 @@ protected function setUp() false ); $this->messageMock = $this->getMock(\Magento\GiftMessage\Model\Message::class, [], [], '', false); - $this->quoteItemMock = $this->getMock( + $this->quoteItemMock = $this->getMock( \Magento\Quote\Model\Quote\Item::class, [ 'getGiftMessageId', @@ -91,7 +91,7 @@ protected function setUp() '', false ); - $this->quoteMock = $this->getMock( + $this->quoteMock = $this->getMock( \Magento\Quote\Model\Quote::class, [ 'getGiftMessageId', diff --git a/app/code/Magento/GiftMessage/Test/Unit/Model/GiftMessageManagerTest.php b/app/code/Magento/GiftMessage/Test/Unit/Model/GiftMessageManagerTest.php index 48bf40bbd5262..bd22086d2d11a 100644 --- a/app/code/Magento/GiftMessage/Test/Unit/Model/GiftMessageManagerTest.php +++ b/app/code/Magento/GiftMessage/Test/Unit/Model/GiftMessageManagerTest.php @@ -53,7 +53,7 @@ protected function setUp() $this->messageFactoryMock = $this->getMock(\Magento\GiftMessage\Model\MessageFactory::class, ['create', '__wakeup'], [], '', false); - $this->quoteMock = $this->getMock( + $this->quoteMock = $this->getMock( \Magento\Quote\Model\Quote::class, [ 'setGiftMessageId', @@ -69,7 +69,7 @@ protected function setUp() [], '', false); - $this->quoteItemMock = $this->getMock( + $this->quoteItemMock = $this->getMock( \Magento\Quote\Model\Quote\Item::class, [ 'setGiftMessageId', @@ -81,7 +81,7 @@ protected function setUp() '', false); - $this->quoteAddressMock = $this->getMock( + $this->quoteAddressMock = $this->getMock( \Magento\Quote\Model\Quote\Address::class, [ 'getGiftMessageId', @@ -94,7 +94,7 @@ protected function setUp() '', false); - $this->quoteAddressItemMock = $this->getMock( + $this->quoteAddressItemMock = $this->getMock( \Magento\Quote\Model\Quote\Address\Item::class, [ 'getGiftMessageId', @@ -106,7 +106,7 @@ protected function setUp() '', false); - $this->giftMessageMock = $this->getMock( + $this->giftMessageMock = $this->getMock( \Magento\GiftMessage\Model\Message::class, [ 'setSender', diff --git a/app/code/Magento/GiftMessage/Test/Unit/Model/Type/Plugin/OnepageTest.php b/app/code/Magento/GiftMessage/Test/Unit/Model/Type/Plugin/OnepageTest.php index cb471bdf06624..d85117b15635f 100644 --- a/app/code/Magento/GiftMessage/Test/Unit/Model/Type/Plugin/OnepageTest.php +++ b/app/code/Magento/GiftMessage/Test/Unit/Model/Type/Plugin/OnepageTest.php @@ -34,7 +34,7 @@ protected function setUp() $this->messageMock = $this->getMock(\Magento\GiftMessage\Model\GiftMessageManager::class, [], [], '', false); $this->requestMock = $this->getMock(\Magento\Framework\App\RequestInterface::class); - $this->plugin = $objectManager->getObject( + $this->plugin = $objectManager->getObject( \Magento\GiftMessage\Model\Type\Plugin\Onepage::class, [ 'message' => $this->messageMock, diff --git a/app/code/Magento/GoogleAnalytics/Helper/Data.php b/app/code/Magento/GoogleAnalytics/Helper/Data.php index df3a53f4aa003..5c1f580f69964 100644 --- a/app/code/Magento/GoogleAnalytics/Helper/Data.php +++ b/app/code/Magento/GoogleAnalytics/Helper/Data.php @@ -47,5 +47,4 @@ public function isAnonymizedIpActive($store = null) { $anonymize = $this->scopeConfig->getValue(self::XML_PATH_ANONYMIZE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store); return $anonymize; } - } diff --git a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Cms/Page/EntityCmsPage.php b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Cms/Page/EntityCmsPage.php index a421da5112988..45b263ea13e14 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Cms/Page/EntityCmsPage.php +++ b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Cms/Page/EntityCmsPage.php @@ -5,7 +5,6 @@ */ namespace Magento\GoogleOptimizer\Block\Adminhtml\Cms\Page; - use Magento\Framework\DataObject; use Magento\Framework\Exception\NoSuchEntityException; use Magento\GoogleOptimizer\Block\Adminhtml\EntityCodeResolverInterface; diff --git a/app/code/Magento/GoogleOptimizer/Setup/InstallSchema.php b/app/code/Magento/GoogleOptimizer/Setup/InstallSchema.php index eb6664af94dc3..40008efba18d4 100644 --- a/app/code/Magento/GoogleOptimizer/Setup/InstallSchema.php +++ b/app/code/Magento/GoogleOptimizer/Setup/InstallSchema.php @@ -84,6 +84,5 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con $installer->getConnection()->createTable($table); $installer->endSetup(); - } } diff --git a/app/code/Magento/GroupedProduct/Setup/UpgradeData.php b/app/code/Magento/GroupedProduct/Setup/UpgradeData.php index 3dc0b613266f8..71d29ae44266d 100644 --- a/app/code/Magento/GroupedProduct/Setup/UpgradeData.php +++ b/app/code/Magento/GroupedProduct/Setup/UpgradeData.php @@ -46,7 +46,8 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $connection->query( $connection->insertFromSelect( - $select, $this->relationProcessor->getMainTable(), + $select, + $this->relationProcessor->getMainTable(), ['parent_id', 'child_id'], AdapterInterface::INSERT_IGNORE ) diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GroupedTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GroupedTest.php index be9a613a877fe..5b4640f209916 100644 --- a/app/code/Magento/GroupedProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GroupedTest.php +++ b/app/code/Magento/GroupedProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GroupedTest.php @@ -81,7 +81,6 @@ class GroupedTest extends AbstractModifierTest */ protected $storeMock; - protected function setUp() { $this->objectManager = new ObjectManager($this); 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 */ ?>