From 0284bcda3d182f438fbe6b0ed05462128091d53e Mon Sep 17 00:00:00 2001 From: Oleksandr Shmyheliuk Date: Fri, 30 Jun 2017 10:00:24 +0300 Subject: [PATCH 1/9] MAGETWO-69964: PHPCS cannot parse correctly syntax of PHP 7.x return types --- .../Magento/Catalog/Block/Product/Context.php | 2 +- .../Product/Price/PricePersistenceTest.php | 42 +- .../Product/Form/Modifier/AdvancedPricing.php | 2 +- .../frontend/templates/product/image.phtml | 2 +- .../product/image_with_borders.phtml | 2 +- .../Model/Import/Product/Type/VirtualTest.php | 16 +- .../Model/Indexer/Fulltext/Action/Full.php | 1 - .../ResourceModel/Advanced/Collection.php | 4 +- .../Observer/UrlRewriteHandler.php | 3 +- .../Unit/Block/Cart/LayoutProcessorTest.php | 1 - .../Block/Checkout/TotalsProcessorTest.php | 23 +- .../Config/Block/System/Config/Form.php | 2 +- .../Magento/Config/Model/Config/Structure.php | 2 +- .../Block/Product/View/Type/Configurable.php | 1 - .../Attribute/OptionSelectBuilder.php | 4 +- .../Attribute/InStockOptionSelectBuilder.php | 2 +- .../Form/Modifier/ConfigurablePanel.php | 3 +- .../Form/Modifier/ConfigurablePrice.php | 6 +- .../Block/Adminhtml/Edit/UnlockButtonTest.php | 13 +- .../Listing/Column/InlineEditUpdater.php | 1 - .../Magento/Deploy/Package/PackagePool.php | 3 +- app/code/Magento/Deploy/Process/Queue.php | 1 - .../Magento/Deploy/Strategy/QuickDeploy.php | 5 +- .../Console/Command/DiInfoCommand.php | 2 +- .../Helper/Plugin/Downloadable.php | 2 +- .../Import/Product/Type/DownloadableTest.php | 16 +- .../Email/Block/Adminhtml/Template/Edit.php | 8 +- .../Model/Source/Import/AbstractBehavior.php | 2 +- app/code/Magento/Paypal/Block/Logo.php | 2 +- .../Paypal/Test/Unit/Model/InfoTest.php | 2 +- .../templates/system/config/api_wizard.phtml | 3 +- .../Paypal/view/frontend/templates/bml.phtml | 5 +- .../templates/product/edit/base_image.phtml | 2 +- app/code/Magento/Quote/Model/Quote/Item.php | 2 +- .../Product/Lowstock/Collection.php | 6 +- .../ResourceModel/Quote/CollectionFactory.php | 2 +- .../Magento/Rule/Model/Condition/Context.php | 2 +- app/code/Magento/Sales/Model/Increment.php | 2 +- .../Sales/Model/Order/Total/AbstractTotal.php | 2 +- .../templates/order/create/form/account.phtml | 2 +- .../Model/Rule/Metadata/_files/MetaData.php | 233 +++--- .../templates/session/activity.phtml | 3 +- .../Importer/DataDifferenceCalculator.php | 4 +- .../Store/Model/Plugin/StoreCookie.php | 3 +- .../Notification/ApplyDiscountOnPrices.php | 3 +- .../Message/Notification/DiscountErrors.php | 3 +- .../Model/Calculation/RateRepositoryTest.php | 6 +- .../Test/Unit/Model/TaxRuleRepositoryTest.php | 14 +- .../Magento/Theme/CustomerData/Messages.php | 2 +- .../Unit/Model/Indexer/Design/ConfigTest.php | 27 +- app/code/Magento/Ui/Config/Converter.php | 3 +- .../Ui/Config/Converter/HtmlContent.php | 1 - .../Config/Reader/DefinitionMap/Converter.php | 2 - .../Unit/Component/MassAction/FilterTest.php | 6 +- .../view/adminhtml/templates/role/info.phtml | 4 +- app/code/Magento/Usps/Model/Carrier.php | 14 +- .../GetPriceConfigurationObserverTest.php | 16 +- .../Wishlist/Test/Unit/Model/ItemTest.php | 3 +- .../messages/addProductSuccessMessage.phtml | 3 +- composer.json | 2 +- composer.lock | 251 +++---- .../Handler/CatalogProductSimple/Curl.php | 6 +- .../_files/template/products_variation_1.php | 60 +- .../_files/template/products_variation_2.php | 119 ++- .../_files/template/products_variation_3.php | 303 ++++---- .../AssertShippingMethodAvailableInCart.php | 2 - .../Block/Adminhtml/Order/AbstractForm.php | 1 - ...icBundleWithSpecialPriceCalculatorTest.php | 1 - .../Block/Product/View/OptionsTest.php | 12 +- .../Modifier/_files/expected_categories.php | 131 ++-- .../_files/input_meta_for_categories.php | 84 ++- .../Checkout/Plugin/GuestValidationTest.php | 1 - .../Search/_files/search_request_merged.php | 493 ++++++------- .../Indexer/Model/Config/_files/result.php | 125 ++-- .../Magento/Sniffs/Annotations/Helper.php | 576 --------------- .../RequireAnnotatedAttributesSniff.php | 357 --------- .../RequireAnnotatedMethodsSniff.php | 694 ------------------ .../Sniffs/Arrays/ShortArraySyntaxSniff.php | 14 +- .../Magento/Sniffs/Files/LineLengthSniff.php | 6 +- .../Magento/Sniffs/Less/AvoidIdSniff.php | 10 +- .../Sniffs/Less/BracesFormattingSniff.php | 12 +- .../Magento/Sniffs/Less/ClassNamingSniff.php | 8 +- .../Magento/Sniffs/Less/ColonSpacingSniff.php | 20 +- .../Sniffs/Less/ColourDefinitionSniff.php | 8 +- .../Less/CombinatorIndentationSniff.php | 8 +- .../Sniffs/Less/CommentLevelsSniff.php | 20 +- .../Sniffs/Less/ImportantPropertySniff.php | 8 +- .../Magento/Sniffs/Less/IndentationSniff.php | 8 +- .../Sniffs/Less/PropertiesLineBreakSniff.php | 8 +- .../Sniffs/Less/PropertiesSortingSniff.php | 14 +- .../Magento/Sniffs/Less/QuotesSniff.php | 8 +- .../Sniffs/Less/SelectorDelimiterSniff.php | 12 +- .../Sniffs/Less/SemicolonSpacingSniff.php | 16 +- .../Less/TypeSelectorConcatenationSniff.php | 10 +- .../Sniffs/Less/TypeSelectorsSniff.php | 8 +- .../Magento/Sniffs/Less/VariablesSniff.php | 20 +- .../Magento/Sniffs/Less/ZeroUnitsSniff.php | 12 +- .../LiteralNamespacesSniff.php | 14 +- .../Sniffs/MicroOptimizations/IsNullSniff.php | 14 +- .../NamingConventions/InterfaceNameSniff.php | 14 +- .../NamingConventions/ReservedWordsSniff.php | 16 +- .../Sniffs/Translation/ConstantUsageSniff.php | 11 +- .../Whitespace/EmptyLineMissedSniff.php | 12 +- .../Whitespace/MultipleEmptyLinesSniff.php | 8 +- .../CodingStandard/Tool/CodeSniffer.php | 27 +- .../Tool/CodeSniffer/LessWrapper.php | 153 +--- .../Tool/CodeSniffer/Wrapper.php | 40 +- dev/tests/static/framework/autoload.php | 1 + .../Translation/ConstantUsageSniffTest.php | 6 +- .../Tool/CodeSniffer/WrapperTest.php | 7 +- .../CodingStandard/Tool/CodeSnifferTest.php | 15 +- ...neratedClassNotInConstructorFinderTest.php | 1 - .../Utility/ClassNameExtractorTest.php | 3 - .../Magento/Test/Integrity/ClassesTest.php | 10 +- .../Magento/Test/Integrity/PublicCodeTest.php | 3 +- .../Framework/DB/Test/Unit/SelectTest.php | 110 ++- .../Magento/Framework/Data/Collection.php | 2 +- .../Framework/Exception/InputException.php | 5 +- .../Exception/State/InitException.php | 2 +- .../Indexer/Handler/AttributeHandler.php | 1 - .../Unit/Code/Generator/_files/Sample.php | 1 - .../Module/Test/Unit/DbVersionInfoTest.php | 33 +- .../Test/Unit/ModuleList/LoaderTest.php | 14 +- .../Magento/Framework/Pricing/Helper/Data.php | 2 +- .../ExtensionAttributesGenerator.php | 1 - .../Autoloader/GeneratedClassesAutoloader.php | 2 - .../Unit/Listener/ReplaceObjectManager.php | 2 - .../Asset/File/FallbackContextFactory.php | 2 - .../Console/Command/DiCompileCommand.php | 26 +- .../src/Magento/Setup/Model/AdminAccount.php | 2 +- 130 files changed, 1324 insertions(+), 3237 deletions(-) delete mode 100644 dev/tests/static/framework/Magento/Sniffs/Annotations/Helper.php delete mode 100644 dev/tests/static/framework/Magento/Sniffs/Annotations/RequireAnnotatedAttributesSniff.php delete mode 100644 dev/tests/static/framework/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php diff --git a/app/code/Magento/Catalog/Block/Product/Context.php b/app/code/Magento/Catalog/Block/Product/Context.php index 7b4afffc3cf27..8c15075747ed1 100644 --- a/app/code/Magento/Catalog/Block/Product/Context.php +++ b/app/code/Magento/Catalog/Block/Product/Context.php @@ -16,7 +16,7 @@ * As Magento moves from inheritance-based APIs all such classes will be deprecated together with * the classes they were introduced for. * - * @deprecated + * @deprecated * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Context extends \Magento\Framework\View\Element\Template\Context diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/PricePersistenceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/PricePersistenceTest.php index 58ab1149da47f..94f69c62a61af 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/PricePersistenceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/PricePersistenceTest.php @@ -93,14 +93,12 @@ public function testGet() $attributeId = 5; $skus = ['sku_1', 'sku_2']; $idsBySku = [ - 'sku_1' => - [ - 1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE - ], - 'sku_2' => - [ - 2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL - ] + 'sku_1' => [ + 1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE + ], + 'sku_2' => [ + 2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL + ] ]; $select = $this->getMockBuilder(\Magento\Framework\DB\Select::class) ->disableOriginalConstructor()->getMock(); @@ -228,14 +226,12 @@ public function testDelete() $attributeId = 5; $skus = ['sku_1', 'sku_2']; $idsBySku = [ - 'sku_1' => - [ - 1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE - ], - 'sku_2' => - [ - 2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL - ] + 'sku_1' => [ + 1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE + ], + 'sku_2' => [ + 2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL + ] ]; $this->productIdLocator ->expects($this->once()) @@ -278,14 +274,12 @@ public function testDeleteWithException() $attributeId = 5; $skus = ['sku_1', 'sku_2']; $idsBySku = [ - 'sku_1' => - [ - 1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE - ], - 'sku_2' => - [ - 2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL - ] + 'sku_1' => [ + 1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE + ], + 'sku_2' => [ + 2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL + ] ]; $this->productIdLocator ->expects($this->once()) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php index cd2bccd7b7385..592f955f8ac4f 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php @@ -27,7 +27,7 @@ /** * Class AdvancedPricing - * + * * @api * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/image.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/image.phtml index 1a9b9c54344af..7a5ac263ccc66 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/image.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/image.phtml @@ -7,7 +7,7 @@ getCustomAttributes(); ?> + getCustomAttributes(); ?> src="getImageUrl(); ?>" width="getWidth(); ?>" height="getHeight(); ?>" diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml index 6c64b3949f8ce..0e4a228425aca 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml @@ -11,7 +11,7 @@ getCustomAttributes(); ?> + getCustomAttributes(); ?> src="getImageUrl(); ?>" width="getResizedImageWidth(); ?>" height="getResizedImageHeight(); ?>" diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/VirtualTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/VirtualTest.php index 203f8b570ecd0..04ab6143b6df0 100644 --- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/VirtualTest.php +++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/VirtualTest.php @@ -34,14 +34,10 @@ public function testPrepareAttributesWithDefaultValueForSave() 'is_unique' => '0', 'frontend_label' => 'Name', 'is_static' => false, - 'apply_to' => - [ - ], + 'apply_to' => [], 'type' => 'varchar', 'default_value' => null, - 'options' => - [ - ], + 'options' => [], ], 'sku' => [ 'id' => '70', @@ -51,14 +47,10 @@ public function testPrepareAttributesWithDefaultValueForSave() 'is_unique' => '1', 'frontend_label' => 'SKU', 'is_static' => true, - 'apply_to' => - [ - ], + 'apply_to' => [], 'type' => 'varchar', 'default_value' => null, - 'options' => - [ - ], + 'options' => [], ] ] ] diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php index 28ca68ad75b25..16ee3fadcf446 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php @@ -355,7 +355,6 @@ public function rebuildStoreIndex($storeId, $productIds = null) $products = $this->dataProvider ->getSearchableProducts($storeId, $staticFields, $productIds, $lastProductId); while (count($products) > 0) { - $productsIds = array_column($products, 'entity_id'); $relatedProducts = $this->getRelatedProducts($products); $productsIds = array_merge($productsIds, array_values($relatedProducts)); diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php index c4f0aa7684309..0388b724da89e 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php @@ -185,7 +185,9 @@ protected function _renderFiltersBefore() $searchResult = $this->searchResultFactory->create()->setItems([]); } catch (NonExistingRequestNameException $e) { $this->_logger->error($e->getMessage()); - throw new LocalizedException(__('Sorry, something went wrong. You can find out more in the error log.')); + throw new LocalizedException( + __('Sorry, something went wrong. You can find out more in the error log.') + ); } $temporaryStorage = $this->temporaryStorageFactory->create(); $table = $temporaryStorage->storeApiDocuments($searchResult->getItems()); diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandler.php b/app/code/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandler.php index c8816b8e4daf7..8e38d64eca166 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandler.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandler.php @@ -149,8 +149,7 @@ public function getCategoryProductsUrlRewrites( ->addAttributeToSelect('url_path'); foreach ($productCollection as $product) { - if ( - isset($this->isSkippedProduct[$category->getEntityId()]) && + if (isset($this->isSkippedProduct[$category->getEntityId()]) && in_array($product->getId(), $this->isSkippedProduct[$category->getEntityId()]) ) { continue; diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Cart/LayoutProcessorTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Cart/LayoutProcessorTest.php index 15c8fab220682..2e10cb3fde7a9 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Cart/LayoutProcessorTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Cart/LayoutProcessorTest.php @@ -5,7 +5,6 @@ */ namespace Magento\Checkout\Test\Unit\Block\Cart; - class LayoutProcessorTest extends \PHPUnit_Framework_TestCase { 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 f774a83987783..32dfcc405a1f2 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Checkout/TotalsProcessorTest.php @@ -33,18 +33,21 @@ protected function setUp() public function testProcess() { + $jsLayoutData = [ + 'sub-total' => [], + 'grand-total' => [], + 'non-existant-total' => null + ]; + $expectedResultData = [ + 'sub-total' => ['sortOrder' => 10], + 'grand-total' => ['sortOrder' => 20], + 'non-existant-total' => null + ]; $jsLayout['components']['checkout']['children']['sidebar']['children']['summary'] - ['children']['totals']['children'] = [ - 'sub-total' => [], - 'grand-total' => [], - 'non-existant-total' => null - ]; + ['children']['totals']['children'] = $jsLayoutData; $expectedResult['components']['checkout']['children']['sidebar']['children']['summary'] - ['children']['totals']['children'] = [ - 'sub-total' => ['sortOrder' => 10], - 'grand-total' => ['sortOrder' => 20], - 'non-existant-total' => null - ]; + ['children']['totals']['children'] = $expectedResultData; + $configData = ['sub_total' => 10, 'grand_total' => 20]; $this->scopeConfigMock->expects($this->once())->method('getValue')->with('sales/totals_sort') diff --git a/app/code/Magento/Config/Block/System/Config/Form.php b/app/code/Magento/Config/Block/System/Config/Form.php index a5bb7ab163e07..220affe2b441b 100644 --- a/app/code/Magento/Config/Block/System/Config/Form.php +++ b/app/code/Magento/Config/Block/System/Config/Form.php @@ -92,7 +92,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic protected $_configStructure; /** - *Form fieldset factory + * Form fieldset factory * * @var \Magento\Config\Block\System\Config\Form\Fieldset\Factory */ diff --git a/app/code/Magento/Config/Model/Config/Structure.php b/app/code/Magento/Config/Model/Config/Structure.php index d43452618cc9b..ce82924ead676 100644 --- a/app/code/Magento/Config/Model/Config/Structure.php +++ b/app/code/Magento/Config/Model/Config/Structure.php @@ -351,7 +351,7 @@ protected function _getGroupFieldPathsByAttribute(array $fields, $parentPath, $a * 'section/group/field' => [ * 'section_id/group_id/field_two_id' * ] - *``` + * ``` * * @return array An array of config path to config structure path map */ diff --git a/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php index e3377993f953c..b28e6f422d395 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php @@ -245,7 +245,6 @@ protected function getOptionImages() { $images = []; foreach ($this->getAllowProducts() as $product) { - $productImages = $this->helper->getGalleryImages($product) ?: []; foreach ($productImages as $image) { $images[$product->getId()][] = diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Attribute/OptionSelectBuilder.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Attribute/OptionSelectBuilder.php index c8e4af088a0fe..958d802682d52 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Attribute/OptionSelectBuilder.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Attribute/OptionSelectBuilder.php @@ -17,14 +17,14 @@ class OptionSelectBuilder implements OptionSelectBuilderInterface { /** * Configurable Attribute Resource Model. - * + * * @var Attribute */ private $attributeResource; /** * Option Provider. - * + * * @var OptionProvider */ private $attributeOptionProvider; diff --git a/app/code/Magento/ConfigurableProduct/Plugin/Model/ResourceModel/Attribute/InStockOptionSelectBuilder.php b/app/code/Magento/ConfigurableProduct/Plugin/Model/ResourceModel/Attribute/InStockOptionSelectBuilder.php index 48d019869de90..0afde6144bf88 100644 --- a/app/code/Magento/ConfigurableProduct/Plugin/Model/ResourceModel/Attribute/InStockOptionSelectBuilder.php +++ b/app/code/Magento/ConfigurableProduct/Plugin/Model/ResourceModel/Attribute/InStockOptionSelectBuilder.php @@ -35,7 +35,7 @@ public function __construct(Status $stockStatusResource) * @param OptionSelectBuilderInterface $subject * @param Select $select * @return Select - * + * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetSelect(OptionSelectBuilderInterface $subject, Select $select) diff --git a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanel.php b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanel.php index bdb63ca563156..0e03dfe3cde51 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanel.php +++ b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanel.php @@ -160,7 +160,8 @@ public function modifyMeta(array $meta) 'component' => 'Magento_Ui/js/form/components/html', 'additionalClasses' => 'message message-notice', 'content' => __( - 'Choose a new product to delete and replace the current product configuration.' + 'Choose a new product to delete and replace' + . ' the current product configuration.' ), 'imports' => [ 'visible' => '!ns = ${ $.ns }, index = ' diff --git a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePrice.php b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePrice.php index e3e1ef2ff87bb..d3129a09d0056 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePrice.php +++ b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePrice.php @@ -72,9 +72,9 @@ public function modifyMeta(array $meta) ] ); } - if ( - !empty($meta[$groupCode]['children'][self::CODE_GROUP_PRICE]['children'][self::$advancedPricingButton]) - ) { + if (!empty( + $meta[$groupCode]['children'][self::CODE_GROUP_PRICE]['children'][self::$advancedPricingButton] + )) { $productTypeId = $this->locator->getProduct()->getTypeId(); $visibilityConfig = ($productTypeId === ConfigurableType::TYPE_CODE) ? ['visible' => 0, 'disabled' => 1] diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/UnlockButtonTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/UnlockButtonTest.php index ffcbdb8c41733..23b3a49a19ed3 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/UnlockButtonTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/UnlockButtonTest.php @@ -116,13 +116,12 @@ public function getButtonDataProvider() { return [ [ - 'result' => - [ - 'label' => new \Magento\Framework\Phrase('Unlock'), - 'class' => 'unlock unlock-customer', - 'on_click' => "location.href = 'http://website.com/';", - 'sort_order' => 50, - ], + 'result' => [ + 'label' => new \Magento\Framework\Phrase('Unlock'), + 'class' => 'unlock unlock-customer', + 'on_click' => "location.href = 'http://website.com/';", + 'sort_order' => 50, + ], 'expectedValue' => 'true' ], ['result' => [], 'expectedValue' => false] diff --git a/app/code/Magento/Customer/Ui/Component/Listing/Column/InlineEditUpdater.php b/app/code/Magento/Customer/Ui/Component/Listing/Column/InlineEditUpdater.php index 6da0fa8c6d86a..c8aca1f28e30d 100644 --- a/app/code/Magento/Customer/Ui/Component/Listing/Column/InlineEditUpdater.php +++ b/app/code/Magento/Customer/Ui/Component/Listing/Column/InlineEditUpdater.php @@ -51,7 +51,6 @@ public function applyEditing( if (in_array($frontendInput, $this->editableFields)) { $config = $column->getConfiguration(); if (!(isset($config['editor']) && isset($config['editor']['editorType']))) { - if (isset($config['editor']) && is_string($config['editor'])) { $editorType = $config['editor']; } elseif (isset($config['dataType'])) { diff --git a/app/code/Magento/Deploy/Package/PackagePool.php b/app/code/Magento/Deploy/Package/PackagePool.php index c3dbe0dafba92..b9c0418df860a 100644 --- a/app/code/Magento/Deploy/Package/PackagePool.php +++ b/app/code/Magento/Deploy/Package/PackagePool.php @@ -185,8 +185,7 @@ private function ensurePackagesForRequiredLocales(array $options) continue; } foreach ($inheritedThemes as $inheritedTheme) { - if ( - $package->getTheme() === $inheritedTheme->getThemePath() + if ($package->getTheme() === $inheritedTheme->getThemePath() && $package->getArea() === $inheritedTheme->getArea() ) { $this->ensurePackage([ diff --git a/app/code/Magento/Deploy/Process/Queue.php b/app/code/Magento/Deploy/Process/Queue.php index 671e47fe2d7d6..e5e10c8f54a19 100644 --- a/app/code/Magento/Deploy/Process/Queue.php +++ b/app/code/Magento/Deploy/Process/Queue.php @@ -300,7 +300,6 @@ private function isDeployed(Package $package) } return false; } - } return $package->getState(); } diff --git a/app/code/Magento/Deploy/Strategy/QuickDeploy.php b/app/code/Magento/Deploy/Strategy/QuickDeploy.php index a211d8d9709b0..02badd7272936 100644 --- a/app/code/Magento/Deploy/Strategy/QuickDeploy.php +++ b/app/code/Magento/Deploy/Strategy/QuickDeploy.php @@ -90,9 +90,8 @@ private function preparePackages($level, array $levelPackages) if ($level > 1) { $parentPackage = null; $packageId = $package->getArea() . '/' . $package->getTheme(); - if ( - // use base package if it is not the same as current - isset($this->baseLocalePackages[$packageId]) + // use base package if it is not the same as current + if (isset($this->baseLocalePackages[$packageId]) && $package !== $this->baseLocalePackages[$packageId] ) { $parentPackage = $this->baseLocalePackages[$packageId]; diff --git a/app/code/Magento/Developer/Console/Command/DiInfoCommand.php b/app/code/Magento/Developer/Console/Command/DiInfoCommand.php index 79fcae74cf2c1..2235aa5e5d9df 100644 --- a/app/code/Magento/Developer/Console/Command/DiInfoCommand.php +++ b/app/code/Magento/Developer/Console/Command/DiInfoCommand.php @@ -51,7 +51,7 @@ protected function configure() ->setDescription('Provides information on Dependency Injection configuration for the Command.') ->setDefinition([ new InputArgument(self::CLASS_NAME, InputArgument::REQUIRED, 'Class name') - ]); + ]); parent::configure(); } diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Downloadable.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Downloadable.php index 604b84a6a723d..f56b219f72db2 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Downloadable.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Downloadable.php @@ -40,7 +40,7 @@ class Downloadable /** * Constructor - * + * * @param RequestInterface $request * @param LinkBuilder $linkBuilder * @param SampleBuilder $sampleBuilder diff --git a/app/code/Magento/DownloadableImportExport/Test/Unit/Model/Import/Product/Type/DownloadableTest.php b/app/code/Magento/DownloadableImportExport/Test/Unit/Model/Import/Product/Type/DownloadableTest.php index efc121a8becf0..ad097724705be 100644 --- a/app/code/Magento/DownloadableImportExport/Test/Unit/Model/Import/Product/Type/DownloadableTest.php +++ b/app/code/Magento/DownloadableImportExport/Test/Unit/Model/Import/Product/Type/DownloadableTest.php @@ -821,14 +821,10 @@ public function testPrepareAttributesWithDefaultValueForSave() 'is_unique' => '0', 'frontend_label' => 'Name', 'is_static' => false, - 'apply_to' => - [ - ], + 'apply_to' => [], 'type' => 'varchar', 'default_value' => null, - 'options' => - [ - ], + 'options' => [], ], 'sku' => [ 'id' => '70', @@ -838,14 +834,10 @@ public function testPrepareAttributesWithDefaultValueForSave() 'is_unique' => '1', 'frontend_label' => 'SKU', 'is_static' => true, - 'apply_to' => - [ - ], + 'apply_to' => [], 'type' => 'varchar', 'default_value' => null, - 'options' => - [ - ], + 'options' => [], ] ] ] diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php index 4a3b65fb13c7c..e1f4add630d7c 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php @@ -102,7 +102,7 @@ public function __construct( } /** - *{@inheritdoc} + * {@inheritdoc} */ public function updateButton($buttonId, $key, $data) { @@ -111,7 +111,7 @@ public function updateButton($buttonId, $key, $data) } /** - *{@inheritdoc} + * {@inheritdoc} */ public function canRender(\Magento\Backend\Block\Widget\Button\Item $item) { @@ -119,7 +119,7 @@ public function canRender(\Magento\Backend\Block\Widget\Button\Item $item) } /** - *{@inheritdoc} + * {@inheritdoc} */ public function removeButton($buttonId) { @@ -222,7 +222,7 @@ protected function _prepareLayout() } /** - *{@inheritdoc} + * {@inheritdoc} */ public function addButton($buttonId, $data, $level = 0, $sortOrder = 0, $region = 'toolbar') { diff --git a/app/code/Magento/ImportExport/Model/Source/Import/AbstractBehavior.php b/app/code/Magento/ImportExport/Model/Source/Import/AbstractBehavior.php index 9ee5f2df2be53..55533044b33f1 100644 --- a/app/code/Magento/ImportExport/Model/Source/Import/AbstractBehavior.php +++ b/app/code/Magento/ImportExport/Model/Source/Import/AbstractBehavior.php @@ -39,7 +39,7 @@ public function toOptionArray() /** * Get current behaviour group code - *; + * * @abstract * @return string */ diff --git a/app/code/Magento/Paypal/Block/Logo.php b/app/code/Magento/Paypal/Block/Logo.php index cea9b7a3a6262..6b3900afb485e 100644 --- a/app/code/Magento/Paypal/Block/Logo.php +++ b/app/code/Magento/Paypal/Block/Logo.php @@ -63,7 +63,7 @@ protected function _getConfig() /** * Disable block output if logo turned off - *M + * * @return string */ protected function _toHtml() diff --git a/app/code/Magento/Paypal/Test/Unit/Model/InfoTest.php b/app/code/Magento/Paypal/Test/Unit/Model/InfoTest.php index 3fb20edfea9a8..1b6c36c2e4a29 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/InfoTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/InfoTest.php @@ -158,7 +158,7 @@ public function additionalInfoDataProvider() } /** - *List of public labels + * List of public labels * * @return array */ diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/api_wizard.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/api_wizard.phtml index 6a3b6ff944a5c..6372425945958 100644 --- a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/api_wizard.phtml +++ b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/api_wizard.phtml @@ -29,8 +29,7 @@ escapeUrl($block->getSandboxButtonUrl(). '?' . $block->getQuery()); ?>" target="PPFrame">escapeHtml($block->getSandboxButtonLabel()); ?> diff --git a/app/code/Magento/Paypal/view/frontend/templates/bml.phtml b/app/code/Magento/Paypal/view/frontend/templates/bml.phtml index 765228c9cf8d4..e3adc6be8a0e6 100644 --- a/app/code/Magento/Paypal/view/frontend/templates/bml.phtml +++ b/app/code/Magento/Paypal/view/frontend/templates/bml.phtml @@ -3,10 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - - - - ?> +?> " >
-

diff --git a/app/code/Magento/Quote/Model/Quote/Item.php b/app/code/Magento/Quote/Model/Quote/Item.php index 5363054d66f66..b62d633ae96c2 100644 --- a/app/code/Magento/Quote/Model/Quote/Item.php +++ b/app/code/Magento/Quote/Model/Quote/Item.php @@ -671,7 +671,7 @@ public function updateQtyOption(\Magento\Framework\DataObject $option, $value) } /** - *Remove option from item options + * Remove option from item options * * @param string $code * @return $this diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php index 996de8228c597..da1da7bc3c92b 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php @@ -11,6 +11,8 @@ */ namespace Magento\Reports\Model\ResourceModel\Product\Lowstock; +use Magento\Framework\Exception\LocalizedException; + /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @api @@ -245,13 +247,13 @@ public function joinInventoryItem($fields = []) * Add filter by product type(s) * * @param array|string $typeFilter - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @return $this */ public function filterByProductType($typeFilter) { if (!is_string($typeFilter) && !is_array($typeFilter)) { - throw new \Magento\Framework\Exception\LocalizedException(__('The product type filter specified is incorrect.')); + throw new LocalizedException(__('The product type filter specified is incorrect.')); } $this->addAttributeToFilter('type_id', $typeFilter); return $this; diff --git a/app/code/Magento/Reports/Model/ResourceModel/Quote/CollectionFactory.php b/app/code/Magento/Reports/Model/ResourceModel/Quote/CollectionFactory.php index 1a836e8fc4889..dfdd66455d02e 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Quote/CollectionFactory.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Quote/CollectionFactory.php @@ -41,7 +41,7 @@ public function __construct( } /** - *{ @inheritdoc) + * {@inheritdoc) */ public function create(array $data = []) { diff --git a/app/code/Magento/Rule/Model/Condition/Context.php b/app/code/Magento/Rule/Model/Condition/Context.php index 4cac8f8601b60..b09218c2c64d9 100644 --- a/app/code/Magento/Rule/Model/Condition/Context.php +++ b/app/code/Magento/Rule/Model/Condition/Context.php @@ -17,7 +17,7 @@ * the classes they were introduced for. * * @api - * @deprecated + * @deprecated */ class Context implements \Magento\Framework\ObjectManager\ContextInterface { diff --git a/app/code/Magento/Sales/Model/Increment.php b/app/code/Magento/Sales/Model/Increment.php index c435e69c8ca9d..c1f3218fbae5f 100644 --- a/app/code/Magento/Sales/Model/Increment.php +++ b/app/code/Magento/Sales/Model/Increment.php @@ -9,7 +9,7 @@ /** * Class Increment - * @deprecated + * @deprecated */ class Increment { diff --git a/app/code/Magento/Sales/Model/Order/Total/AbstractTotal.php b/app/code/Magento/Sales/Model/Order/Total/AbstractTotal.php index 1113f739fee2b..ee84ba2db912f 100644 --- a/app/code/Magento/Sales/Model/Order/Total/AbstractTotal.php +++ b/app/code/Magento/Sales/Model/Order/Total/AbstractTotal.php @@ -8,7 +8,7 @@ /** * Base class for configure totals order * @api - * + * * @author Magento Core Team */ abstract class AbstractTotal extends \Magento\Framework\DataObject diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/account.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/account.phtml index 2569675f63097..f49c080e373ec 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/account.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/account.phtml @@ -3,7 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - ?> +?>
getHeaderText() ?> diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Metadata/_files/MetaData.php b/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Metadata/_files/MetaData.php index 4dbf4b8926790..f288792d36ddb 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Metadata/_files/MetaData.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Rule/Metadata/_files/MetaData.php @@ -5,171 +5,162 @@ */ return [ - 'rule_information' => - [ - 'children' => - [ - 'website_ids' => ['arguments' => ['data' => ['config' => ['options' => []]]]], - 'is_active' => + 'rule_information' => [ + 'children' => + [ + 'website_ids' => ['arguments' => ['data' => ['config' => ['options' => []]]]], + 'is_active' => [ + 'arguments' => [ - 'arguments' => + 'data' => [ - 'data' => + 'config' => [ - 'config' => + 'options' => [ - 'options' => - [ - [ - 'label' => __('Active'), - 'value' => '1', - ], - [ - 'label' => __('Inactive'), - 'value' => '0', - ], - ], + [ + 'label' => __('Active'), + 'value' => '1', + ], + [ + 'label' => __('Inactive'), + 'value' => '0', + ], ], ], ], ], - 'customer_group_ids' => ['arguments' => ['data' => ['config' => ['options' => []]]]], - 'coupon_type' => - [ - 'arguments' => - [ - 'data' => - [ - 'config' => + ], + 'customer_group_ids' => ['arguments' => ['data' => ['config' => ['options' => []]]]], + 'coupon_type' => [ + 'arguments' => [ + 'data' => + [ + 'config' => + [ + 'options' => + [ [ - 'options' => - [ - [ - 'label' => 'couponType1', - 'value' => 'key1', - ], - [ - 'label' => 'couponType2', - 'value' => 'key2', - ], - ], + 'label' => 'couponType1', + 'value' => 'key1', ], - ], - ], - ], - 'is_rss' => + [ + 'label' => 'couponType2', + 'value' => 'key2', + ], + ], + ], + ], + ], + ], + 'is_rss' => [ + 'arguments' => [ - 'arguments' => + 'data' => [ - 'data' => + 'config' => [ - 'config' => + 'options' => [ - 'options' => - [ - [ - 'label' => __('Yes'), - 'value' => '1', - ], - [ - 'label' => __('No'), - 'value' => '0', - ], - ], + [ + 'label' => __('Yes'), + 'value' => '1', + ], + [ + 'label' => __('No'), + 'value' => '0', + ], ], ], ], ], ], - ], - 'actions' => - [ - 'children' => - [ - 'simple_action' => + ], + ], + 'actions' => [ + 'children' => + [ + 'simple_action' => [ + 'arguments' => [ - 'arguments' => + 'data' => [ - 'data' => + 'config' => [ - 'config' => + 'options' => [ - 'options' => - [ - [ - 'label' => __('Percent of product price discount'), - 'value' => 'by_percent', - ], - [ - 'label' => __('Fixed amount discount'), - 'value' => 'by_fixed', - ], - [ - 'label' => __('Fixed amount discount for whole cart'), - 'value' => 'cart_fixed', - ], - [ - 'label' => __( - 'Buy X get Y free (discount amount is Y)' - ), - 'value' => 'buy_x_get_y', - ], - ], + [ + 'label' => __('Percent of product price discount'), + 'value' => 'by_percent', + ], + [ + 'label' => __('Fixed amount discount'), + 'value' => 'by_fixed', + ], + [ + 'label' => __('Fixed amount discount for whole cart'), + 'value' => 'cart_fixed', + ], + [ + 'label' => __( + 'Buy X get Y free (discount amount is Y)' + ), + 'value' => 'buy_x_get_y', + ], ], ], ], ], - 'discount_amount' => ['arguments' => ['data' => ['config' => ['value' => '0']]]], - 'discount_qty' => ['arguments' => ['data' => ['config' => ['value' => '0']]]], - 'apply_to_shipping' => + ], + 'discount_amount' => ['arguments' => ['data' => ['config' => ['value' => '0']]]], + 'discount_qty' => ['arguments' => ['data' => ['config' => ['value' => '0']]]], + 'apply_to_shipping' => [ + 'arguments' => [ - 'arguments' => + 'data' => [ - 'data' => + 'config' => [ - 'config' => + 'options' => [ - 'options' => - [ - [ - 'label' => __('Yes'), - 'value' => '1' - ], - [ - 'label' => __('No'), - 'value' => '0' - ], - ], + [ + 'label' => __('Yes'), + 'value' => '1' + ], + [ + 'label' => __('No'), + 'value' => '0' + ], ], ], ], ], - 'stop_rules_processing' => + ], + 'stop_rules_processing' => [ + 'arguments' => [ - 'arguments' => + 'data' => [ - 'data' => + 'config' => [ - 'config' => - [ - 'options' => - [ - [ - 'label' => __('Yes'), - 'value' => '1' - ], + 'options' => + [ + [ + 'label' => __('Yes'), + 'value' => '1' + ], - [ - 'label' => __('No'), - 'value' => '0' - ], - ], + [ + 'label' => __('No'), + 'value' => '0' + ], ], ], ], ], ], - ], + ], + ], 'labels' => ['children' => ['store_labels[0]' => ['arguments' => ['data' => ['config' => ['value' => 'label0']]]]]], ]; diff --git a/app/code/Magento/Security/view/adminhtml/templates/session/activity.phtml b/app/code/Magento/Security/view/adminhtml/templates/session/activity.phtml index da4c4e3df294d..308ae40c82d6c 100644 --- a/app/code/Magento/Security/view/adminhtml/templates/session/activity.phtml +++ b/app/code/Magento/Security/view/adminhtml/templates/session/activity.phtml @@ -7,6 +7,7 @@ /** * Account activity template * + * @codingStandardsIgnoreFile * @var $block \Magento\Security\Block\Adminhtml\Session\Activity */ @@ -38,7 +39,7 @@ $sessionInfoCollection = $block->getSessionInfoCollection(); + foreach ($sessionInfoCollection as $item): ?> escapeHtml($item->getFormattedIp()) ?> escapeHtml($block->formatDateTime($item->getCreatedAt())) ?> diff --git a/app/code/Magento/Store/Model/Config/Importer/DataDifferenceCalculator.php b/app/code/Magento/Store/Model/Config/Importer/DataDifferenceCalculator.php index 23256e8ca9c05..75fbe23d78f8b 100644 --- a/app/code/Magento/Store/Model/Config/Importer/DataDifferenceCalculator.php +++ b/app/code/Magento/Store/Model/Config/Importer/DataDifferenceCalculator.php @@ -79,9 +79,7 @@ public function getItemsToUpdate($scope, array $data) ); foreach ($runtimeScopeData as $entityCode => $entityData) { - if ( - isset($data[$entityCode]) && array_diff_assoc($entityData, $data[$entityCode]) - ) { + if (isset($data[$entityCode]) && array_diff_assoc($entityData, $data[$entityCode])) { $itemsToUpdate[$entityCode] = array_replace($entityData, $data[$entityCode]); } } diff --git a/app/code/Magento/Store/Model/Plugin/StoreCookie.php b/app/code/Magento/Store/Model/Plugin/StoreCookie.php index b637377000460..612d35e136d7e 100644 --- a/app/code/Magento/Store/Model/Plugin/StoreCookie.php +++ b/app/code/Magento/Store/Model/Plugin/StoreCookie.php @@ -82,8 +82,7 @@ public function beforeDispatch( $this->storeCookieManager->deleteStoreCookie($this->storeManager->getDefaultStoreView()); } } - if ( - $this->storeCookieManager->getStoreCodeFromCookie() === null + if ($this->storeCookieManager->getStoreCodeFromCookie() === null || $request->getParam(StoreResolverInterface::PARAM_NAME) !== null ) { $storeId = $this->storeResolver->getCurrentStoreId(); diff --git a/app/code/Magento/Tax/Model/System/Message/Notification/ApplyDiscountOnPrices.php b/app/code/Magento/Tax/Model/System/Message/Notification/ApplyDiscountOnPrices.php index cafd4cb561af9..ab1a6d40115b4 100644 --- a/app/code/Magento/Tax/Model/System/Message/Notification/ApplyDiscountOnPrices.php +++ b/app/code/Magento/Tax/Model/System/Message/Notification/ApplyDiscountOnPrices.php @@ -82,7 +82,8 @@ public function getText() if ($this->isDisplayed()) { $messageDetails .= ''; - $messageDetails .= __('To apply the discount on prices including tax and apply the tax after discount, set Catalog Prices to “Including Tax”. '); + $messageDetails .= __('To apply the discount on prices including tax and apply the tax after discount,' + . ' set Catalog Prices to “Including Tax”. '); $messageDetails .= '

'; $messageDetails .= __('Store(s) affected: '); $messageDetails .= implode(', ', $this->getStoresWithWrongSettings()); diff --git a/app/code/Magento/Tax/Model/System/Message/Notification/DiscountErrors.php b/app/code/Magento/Tax/Model/System/Message/Notification/DiscountErrors.php index 1ee37150015ff..ff16e350580a0 100644 --- a/app/code/Magento/Tax/Model/System/Message/Notification/DiscountErrors.php +++ b/app/code/Magento/Tax/Model/System/Message/Notification/DiscountErrors.php @@ -80,7 +80,8 @@ public function getText() if (!empty($this->getStoresWithWrongSettings()) && !$this->taxConfig->isWrongDiscountSettingsIgnored()) { $messageDetails .= ''; - $messageDetails .= __('With customer tax applied “Before Discount”, the final discount calculation may not match customers’ expectations. '); + $messageDetails .= __('With customer tax applied “Before Discount”,' + . ' the final discount calculation may not match customers’ expectations. '); $messageDetails .= '

'; $messageDetails .= __('Store(s) affected: '); $messageDetails .= implode(', ', $this->getStoresWithWrongSettings()); diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php index 7ed0129de1c28..408866a916d4a 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php @@ -363,11 +363,13 @@ public function saveThrowsExceptionIfCannotSaveTitlesDataProvider() { return [ 'entity_already_exists' => [ - new AlreadyExistsException(__('Entity already exists')), \Magento\Framework\Exception\AlreadyExistsException::class, + new AlreadyExistsException(__('Entity already exists')), + AlreadyExistsException::class, 'Entity already exists' ], 'cannot_save_title' => [ - new LocalizedException(__('Cannot save titles')), \Magento\Framework\Exception\LocalizedException::class, + new LocalizedException(__('Cannot save titles')), + LocalizedException::class, 'Cannot save titles' ] ]; diff --git a/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php index 233253b328196..d879aba5d8474 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/TaxRuleRepositoryTest.php @@ -6,6 +6,10 @@ namespace Magento\Tax\Test\Unit\Model; use Magento\Framework\Api\SortOrder; +use Magento\Framework\Exception\AlreadyExistsException; +use Magento\Framework\Exception\CouldNotSaveException; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; use \Magento\Tax\Model\TaxRuleRepository; /** @@ -170,9 +174,9 @@ public function testSave() * @param $exceptionName * @param $exceptionMessage * @throws \Exception - * @throws \Magento\Framework\Exception\CouldNotSaveException + * @throws CouldNotSaveException * @throws \Magento\Framework\Exception\InputException - * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws NoSuchEntityException */ public function testSaveWithExceptions($exceptionObject, $exceptionName, $exceptionMessage) { @@ -192,13 +196,13 @@ public function saveExceptionsDataProvider() { return [ [ - new \Magento\Framework\Exception\LocalizedException(__('Could not save')), \Magento\Framework\Exception\CouldNotSaveException::class, + new LocalizedException(__('Could not save')), CouldNotSaveException::class, 'Could not save' ], [ - new \Magento\Framework\Exception\AlreadyExistsException(__('Entity already exists')), \Magento\Framework\Exception\AlreadyExistsException::class, + new AlreadyExistsException(__('Entity already exists')), AlreadyExistsException::class, 'Entity already exists' ], [ - new \Magento\Framework\Exception\NoSuchEntityException(__('No such entity')), \Magento\Framework\Exception\NoSuchEntityException::class, + new NoSuchEntityException(__('No such entity')), NoSuchEntityException::class, 'No such entity' ] ]; diff --git a/app/code/Magento/Theme/CustomerData/Messages.php b/app/code/Magento/Theme/CustomerData/Messages.php index a205cb445efd7..adb3f7df27395 100644 --- a/app/code/Magento/Theme/CustomerData/Messages.php +++ b/app/code/Magento/Theme/CustomerData/Messages.php @@ -30,7 +30,7 @@ class Messages implements SectionSourceInterface /** * Constructor - * + * * @param MessageManager $messageManager * @param InterpretationStrategyInterface $interpretationStrategy */ diff --git a/app/code/Magento/Theme/Test/Unit/Model/Indexer/Design/ConfigTest.php b/app/code/Magento/Theme/Test/Unit/Model/Indexer/Design/ConfigTest.php index 808da5d0363a5..0e6964bfa32cf 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Indexer/Design/ConfigTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Indexer/Design/ConfigTest.php @@ -78,21 +78,20 @@ protected function setUp() [ 'fieldsets' => ['test_fieldset' => [ - 'fields' => - [ - 'first_field' => [ - 'name' => 'firstField', - 'origin' => null, - 'type' => 'filterable', - 'handler' => null, - ], - 'second_field' => [ - 'name' => 'secondField', - 'origin' => null, - 'type' => 'searchable', - 'handler' => null, - ], + 'fields' => [ + 'first_field' => [ + 'name' => 'firstField', + 'origin' => null, + 'type' => 'filterable', + 'handler' => null, ], + 'second_field' => [ + 'name' => 'secondField', + 'origin' => null, + 'type' => 'searchable', + 'handler' => null, + ], + ], 'provider' => $indexerFieldset, ] ], diff --git a/app/code/Magento/Ui/Config/Converter.php b/app/code/Magento/Ui/Config/Converter.php index 72de0f70863e9..463bd0c3afa0c 100644 --- a/app/code/Magento/Ui/Config/Converter.php +++ b/app/code/Magento/Ui/Config/Converter.php @@ -257,8 +257,7 @@ private function convertChildNodes(\DOMNode $node) } if ($itemNode->localName === static::ARGUMENT_KEY) { $arguments += $this->toArray($itemNode); - } elseif ( - $this->converterUtils->isUiComponent($itemNode) + } elseif ($this->converterUtils->isUiComponent($itemNode) && isset($this->schemaMap[$itemNode->localName]) ) { $itemNodeName = $this->converterUtils->getComponentName($itemNode); diff --git a/app/code/Magento/Ui/Config/Converter/HtmlContent.php b/app/code/Magento/Ui/Config/Converter/HtmlContent.php index 5c12358ef9c3f..f77b4a5285d5a 100644 --- a/app/code/Magento/Ui/Config/Converter/HtmlContent.php +++ b/app/code/Magento/Ui/Config/Converter/HtmlContent.php @@ -32,7 +32,6 @@ public function convert(\DOMNode $node, array $data) $items['name']['xsi:type'] = 'string'; $items['name']['name'] = 'block'; $items['name']['value'] = $node->getAttribute('name'); - } return [ 'xsi:type' => 'array', diff --git a/app/code/Magento/Ui/Config/Reader/DefinitionMap/Converter.php b/app/code/Magento/Ui/Config/Reader/DefinitionMap/Converter.php index 9c0514b88dd70..77220c8ac145a 100644 --- a/app/code/Magento/Ui/Config/Reader/DefinitionMap/Converter.php +++ b/app/code/Magento/Ui/Config/Reader/DefinitionMap/Converter.php @@ -83,7 +83,6 @@ private function toArray(\DOMNode $node) ); } $result[ $attributes[static::NAME_ATTRIBUTE_KEY] ] = $this->argumentParser->parse($node); - } else { list($arguments, $childResult) = $this->convertChildNodes($node); @@ -156,7 +155,6 @@ private function processMap($componentData, $sourceMap) $result ); } - } if (isset($componentData[static::CURRENT_SCHEMA_KEY])) { diff --git a/app/code/Magento/Ui/Test/Unit/Component/MassAction/FilterTest.php b/app/code/Magento/Ui/Test/Unit/Component/MassAction/FilterTest.php index 7be75c1072582..efd9b0b05c85d 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/MassAction/FilterTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/MassAction/FilterTest.php @@ -25,7 +25,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase { /** - *\PHPUnit_Framework_MockObject_MockObject + * \PHPUnit_Framework_MockObject_MockObject */ private $requestMock; @@ -48,12 +48,12 @@ class FilterTest extends \PHPUnit_Framework_TestCase private $objectManager; /** - *\PHPUnit_Framework_MockObject_MockObject + * \PHPUnit_Framework_MockObject_MockObject */ private $dataProviderMock; /** - *\PHPUnit_Framework_MockObject_MockObject + * \PHPUnit_Framework_MockObject_MockObject */ private $abstractDbMock; diff --git a/app/code/Magento/User/view/adminhtml/templates/role/info.phtml b/app/code/Magento/User/view/adminhtml/templates/role/info.phtml index e726cea0111f3..0c7d33364e144 100644 --- a/app/code/Magento/User/view/adminhtml/templates/role/info.phtml +++ b/app/code/Magento/User/view/adminhtml/templates/role/info.phtml @@ -9,8 +9,8 @@