From 7d7c32772ab93f96869cf2f138a583c3d1658f9d Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 20 Oct 2016 23:15:57 +0200 Subject: [PATCH 01/92] - Removed the @codingStandardsIgnoreFile in every php file in the framework. - Made a couple of changes to some files already - This will probably break the build. Let's see if I can fix all the issues --- .../Framework/Acl/AclResource/Provider.php | 12 ++++++---- .../Unit/Api/ImageContentValidatorTest.php | 6 ++--- .../Api/Test/Unit/Api/ImageProcessorTest.php | 8 +++---- .../ExtensionAttributesGeneratorTest.php | 2 +- ...ensionAttributesInterfaceGeneratorTest.php | 2 +- .../Api/Test/Unit/DataObjectHelperTest.php | 2 -- .../App/Test/Unit/Action/ActionTest.php | 2 -- .../Framework/App/Test/Unit/AreaListTest.php | 2 -- .../Framework/App/Test/Unit/BootstrapTest.php | 2 -- .../Unit/ObjectManager/ConfigLoaderTest.php | 6 ++--- .../App/Test/Unit/ReinitableConfigTest.php | 2 -- .../App/Test/Unit/Request/HttpTest.php | 2 -- .../App/Test/Unit/Response/HttpTest.php | 2 -- .../Unit/Router/NoRouteHandlerListTest.php | 2 -- .../Test/Unit/Router/NoRouteHandlerTest.php | 2 -- .../Framework/App/Test/Unit/StateTest.php | 2 -- .../App/Test/Unit/StaticResourceTest.php | 2 -- .../Magento/Framework/Archive/Helper/File.php | 15 ++++++++---- .../Framework/Archive/Helper/File/Gz.php | 2 -- .../Test/Unit/ClassLoaderWrapperTest.php | 2 -- .../Magento/Framework/Backup/Archive/Tar.php | 7 +++--- .../Framework/Backup/Db/BackupFactory.php | 9 +++---- .../Magento/Framework/Backup/Factory.php | 2 -- .../Magento/Framework/Backup/Filesystem.php | 2 -- .../Framework/Cache/Backend/Database.php | 7 +++--- .../Framework/Cache/Backend/Eaccelerator.php | 2 -- .../Framework/Cache/Test/Unit/CoreTest.php | 2 -- .../Code/Test/Unit/GeneratorTest.php | 2 -- .../_files/ClassesForArgumentsReader.php | 2 -- .../ConstructorArgumentTypesTest.php | 6 ++--- .../_files/ClassesForArgumentSequence.php | 2 -- .../_files/ClassesForConstructorIntegrity.php | 2 -- .../_files/ClassesForContextAggregation.php | 2 -- .../_files/ClassesForTypeDuplication.php | 2 -- .../SomeModule/Model/SevenInterface.php | 2 -- lib/internal/Magento/Framework/Config/Dom.php | 2 -- .../Config/Test/Unit/Composer/PackageTest.php | 2 -- .../Framework/Config/Test/Unit/DataTest.php | 2 -- .../Test/Unit/Result/RedirectFactoryTest.php | 2 -- .../Css/PreProcessor/Instruction/Import.php | 2 -- .../PreProcessor/Instruction/ImportTest.php | 4 +--- .../Instruction/MagentoImportTest.php | 2 -- .../Magento/Framework/CurrencyFactory.php | 8 +++---- .../Framework/DB/Adapter/Pdo/Mysql.php | 2 -- .../Magento/Framework/DB/MapperFactory.php | 2 -- .../Magento/Framework/DB/QueryFactory.php | 2 -- .../Framework/DB/Statement/Pdo/Mysql.php | 2 -- .../DB/Test/Unit/AbstractMapperTest.php | 2 -- .../DB/Test/Unit/Adapter/Pdo/MysqlTest.php | 10 ++++---- .../Framework/Data/Form/Element/Editor.php | 2 -- .../Framework/Data/Form/Element/Gallery.php | 4 +--- .../Framework/Data/Form/Element/Time.php | 2 -- .../Magento/Framework/Data/FormFactory.php | 7 +++--- .../Data/Test/Unit/Collection/DbTest.php | 2 -- .../Unit/Form/Element/AbstractElementTest.php | 2 -- .../Magento/Framework/Encryption/Crypt.php | 15 ++++++++---- .../Framework/Encryption/Helper/Security.php | 2 -- .../Event/Invoker/InvokerDefault.php | 8 +++---- lib/internal/Magento/Framework/File/Csv.php | 2 -- .../Magento/Framework/File/CsvMulty.php | 2 -- .../Framework/File/Test/Unit/CsvTest.php | 2 -- .../Framework/File/Transfer/Adapter/Http.php | 8 +++---- .../Magento/Framework/Filesystem/Io/Sftp.php | 6 ++--- .../Framework/Filter/Input/MaliciousCode.php | 2 -- .../Magento/Framework/HTTP/Adapter/Curl.php | 2 -- .../Magento/Framework/HTTP/Header.php | 8 +++---- .../Magento/Framework/Image/Factory.php | 10 ++++---- .../Code/Generator/Interceptor.php | 2 -- .../Unit/Code/Generator/InterceptorTest.php | 6 ++--- .../Test/Unit/Code/InterfaceValidatorTest.php | 2 -- .../Test/Unit/Config/ConfigTest.php | 2 +- .../ItemPlugin/ExtraParameters.php | 2 -- .../ItemPlugin/IncompatibleArgumentsCount.php | 2 -- .../ItemPlugin/IncompatibleArgumentsType.php | 5 ++-- .../ItemPlugin/InvalidProceed.php | 6 ++--- .../ItemPlugin/ValidPlugin.php | 8 +++---- .../Framework/Locale/Test/Unit/ConfigTest.php | 10 ++++---- .../Locale/Test/Unit/CurrencyTest.php | 4 +--- .../Framework/Locale/TranslatedLists.php | 2 -- .../Magento/Framework/Message/Factory.php | 2 -- .../Db/Collection/AbstractCollection.php | 2 -- .../Model/ResourceModel/Type/Db/Pdo/Mysql.php | 2 -- .../Test/Unit/AbstractExtensibleModelTest.php | 2 -- .../Unit/ResourceModel/Db/AbstractDbTest.php | 2 -- .../Db/Collection/AbstractCollectionTest.php | 2 -- .../Framework/Module/ModuleResource.php | 2 -- .../Module/Setup/MigrationFactory.php | 2 -- .../Magento/Framework/Mview/ActionFactory.php | 6 ++--- .../Mview/Test/Unit/Config/Data/ProxyTest.php | 2 -- .../Framework/Mview/Test/Unit/ConfigTest.php | 4 +--- .../Mview/Test/Unit/View/CollectionTest.php | 2 -- .../Unit/View/SubscriptionFactoryTest.php | 2 -- .../Mview/Test/Unit/View/SubscriptionTest.php | 11 ++++++--- lib/internal/Magento/Framework/Mview/View.php | 2 -- .../Framework/Mview/View/Subscription.php | 6 ++--- .../Code/Generator/Persistor.php | 2 -- .../Code/Generator/Repository.php | 2 -- .../ObjectManager/DefinitionFactory.php | 10 ++++---- .../Config/Reader/_files/ConfigDomMock.php | 11 +++++---- .../Test/Unit/Relations/RuntimeTest.php | 2 -- .../Test/Unit/Renderer/CompositeTest.php | 2 -- .../Framework/Pricing/Render/RendererPool.php | 2 -- .../Framework/Profiler/Driver/Factory.php | 7 +++--- .../Session/Test/Unit/ConfigTest.php | 2 -- .../Stdlib/DateTime/TimezoneInterface.php | 2 -- .../Test/Unit/Cookie/CookieScopeTest.php | 8 +++---- .../Test/Unit/Cookie/PhpCookieManagerTest.php | 2 -- .../Magento/Framework/Test/Unit/ShellTest.php | 7 +++--- .../Magento/Framework/Test/Unit/UrlTest.php | 2 -- .../Test/Unit/ValidatorFactoryTest.php | 4 +--- .../Magento/Framework/Translate/Adapter.php | 2 -- .../Framework/Translate/AdapterInterface.php | 2 -- .../Magento/Framework/Translate/Inline.php | 8 ++++--- lib/internal/Magento/Framework/Url.php | 14 +++++++---- lib/internal/Magento/Framework/UrlFactory.php | 8 +++---- .../Magento/Framework/Validator/Builder.php | 19 ++++++++++----- .../Validator/Constraint/Property.php | 2 -- .../Framework/Validator/ConstraintFactory.php | 8 +++---- .../Magento/Framework/Validator/Factory.php | 4 +--- .../Asset/NotationResolver/ModuleTest.php | 2 -- .../View/Test/Unit/Asset/SourceTest.php | 2 -- .../View/Test/Unit/BlockPoolTest.php | 2 -- .../View/Test/Unit/DataSourcePoolTest.php | 2 -- .../Fallback/Resolver/AlternativeTest.php | 9 +++---- .../View/Test/Unit/Design/Theme/ImageTest.php | 2 -- .../View/Test/Unit/DesignLoaderTest.php | 2 -- .../Test/Unit/Element/AbstractBlockTest.php | 2 -- .../Decorator/ModuleDependencyTest.php | 2 -- .../Collector/Decorator/ModuleOutputTest.php | 2 -- .../View/Test/Unit/File/FileListTest.php | 2 -- .../View/Test/Unit/FileSystemTest.php | 24 +++++++++---------- .../View/Test/Unit/Layout/Reader/MoveTest.php | 2 -- .../View/Test/Unit/Layout/XsdTest.php | 2 -- .../View/Test/Unit/Result/LayoutTest.php | 4 +--- .../Unit/TemplateEngine/_files/simple.phtml | 2 -- .../Test/Unit/ServiceInputProcessorTest.php | 2 -- 136 files changed, 195 insertions(+), 362 deletions(-) diff --git a/lib/internal/Magento/Framework/Acl/AclResource/Provider.php b/lib/internal/Magento/Framework/Acl/AclResource/Provider.php index 1898a2fccef1b..1935aee1cf045 100644 --- a/lib/internal/Magento/Framework/Acl/AclResource/Provider.php +++ b/lib/internal/Magento/Framework/Acl/AclResource/Provider.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Acl\AclResource; class Provider implements ProviderInterface @@ -24,8 +22,10 @@ class Provider implements ProviderInterface * @param \Magento\Framework\Config\ReaderInterface $configReader * @param TreeBuilder $resourceTreeBuilder */ - public function __construct(\Magento\Framework\Config\ReaderInterface $configReader, TreeBuilder $resourceTreeBuilder) - { + public function __construct( + \Magento\Framework\Config\ReaderInterface $configReader, + TreeBuilder $resourceTreeBuilder + ) { $this->_configReader = $configReader; $this->_resourceTreeBuilder = $resourceTreeBuilder; } @@ -37,7 +37,9 @@ public function getAclResources() { $aclResourceConfig = $this->_configReader->read(); if (!empty($aclResourceConfig['config']['acl']['resources'])) { - return $this->_resourceTreeBuilder->build($aclResourceConfig['config']['acl']['resources']); + return $this->_resourceTreeBuilder->build( + $aclResourceConfig['config']['acl']['resources'] + ); } return []; } diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php index e57635a2d9750..eead35e801997 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageContentValidatorTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Api\Test\Unit\Api; /** @@ -26,8 +24,8 @@ class ImageContentValidatorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->imageContentValidator = $this->objectManager->getObject( - \Magento\Framework\Api\ImageContentValidator::class + $this->imageContentValidator = $this->objectManager->getObject( + \Magento\Framework\Api\ImageContentValidator::class ); } diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php index 83d1a9ece7c18..6bab696f580f4 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Api\Test\Unit\Api; /** @@ -57,7 +55,7 @@ protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->directoryWriteMock = $this->getMockForAbstractClass( + $this->directoryWriteMock = $this->getMockForAbstractClass( \Magento\Framework\Filesystem\Directory\WriteInterface::class ); $this->fileSystemMock = $this->getMockBuilder(\Magento\Framework\Filesystem::class) @@ -66,7 +64,7 @@ protected function setUp() $this->fileSystemMock->expects($this->any()) ->method('getDirectoryWrite') ->willReturn($this->directoryWriteMock); - $this->contentValidatorMock = $this->getMockBuilder( + $this->contentValidatorMock = $this->getMockBuilder( \Magento\Framework\Api\ImageContentValidatorInterface::class) ->disableOriginalConstructor() ->getMock(); @@ -90,7 +88,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->imageProcessor = $this->objectManager->getObject( + $this->imageProcessor = $this->objectManager->getObject( \Magento\Framework\Api\ImageProcessor::class, [ 'fileSystem' => $this->fileSystemMock, diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/ExtensionAttributesGeneratorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/ExtensionAttributesGeneratorTest.php index 6a7fac692f4d0..dea20b3cceacf 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/ExtensionAttributesGeneratorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/ExtensionAttributesGeneratorTest.php @@ -3,7 +3,7 @@ * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile + namespace Magento\Framework\Api\Test\Unit\Code\Generator; use Magento\Framework\Api\ExtensionAttribute\Config\Converter; diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/ExtensionAttributesInterfaceGeneratorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/ExtensionAttributesInterfaceGeneratorTest.php index 842802470454b..d3938629f1da2 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/ExtensionAttributesInterfaceGeneratorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/ExtensionAttributesInterfaceGeneratorTest.php @@ -3,7 +3,7 @@ * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile + namespace Magento\Framework\Api\Test\Unit\Code\Generator; use Magento\Framework\Api\ExtensionAttribute\Config\Converter; diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php index 95e46d99a8e45..9fa851f69e355 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Api\Test\Unit; use Magento\Framework\Api\CustomAttributesDataInterface; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php index cb9c427816d23..f42a4e4e353a6 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit\Action; use \Magento\Framework\App\Action\Action; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/AreaListTest.php b/lib/internal/Magento/Framework/App/Test/Unit/AreaListTest.php index 9886abf023216..56a4518f100a7 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/AreaListTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/AreaListTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit; use \Magento\Framework\App\AreaList; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php b/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php index 66564cc7f2120..13a3cfb04ad2a 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit; use \Magento\Framework\App\Bootstrap; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/ConfigLoaderTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/ConfigLoaderTest.php index 5a0b4ae96f26c..7fb25813b5867 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/ConfigLoaderTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/ConfigLoaderTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit\ObjectManager; class ConfigLoaderTest extends \PHPUnit_Framework_TestCase @@ -32,7 +30,7 @@ class ConfigLoaderTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_readerMock = $this->getMock( + $this->_readerMock = $this->getMock( \Magento\Framework\ObjectManager\Config\Reader\Dom::class, [], [], @@ -40,7 +38,7 @@ protected function setUp() false ); - $this->_readerFactoryMock = $this->getMock( + $this->_readerFactoryMock = $this->getMock( \Magento\Framework\ObjectManager\Config\Reader\DomFactory::class, ['create'], [], diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ReinitableConfigTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ReinitableConfigTest.php index 9a35aa9104e80..bcb4dba000a0b 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ReinitableConfigTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ReinitableConfigTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit; class ReinitableConfigTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index 98742f397e1cf..94e389178f85d 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -5,8 +5,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit\Request; use Magento\Framework\App\Config\ScopeConfigInterface; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php index 2045fc9bd17b4..8955fa5e2e6ea 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit\Response; use \Magento\Framework\App\Response\Http; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerListTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerListTest.php index 1af3a0b86ee7e..3260fae911f7c 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerListTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerListTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit\Router; class NoRouteHandlerListTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerTest.php index eaa6418348dba..1c59226bb0e5a 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Router/NoRouteHandlerTest.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit\Router; class NoRouteHandlerTest extends \Magento\Framework\TestFramework\Unit\BaseTestCase diff --git a/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php b/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php index ae3845834ee02..a62c04c2eebca 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/StateTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit; use \Magento\Framework\App\Area; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php index 002e4746f6fb0..ace2f28c089c7 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\App\Test\Unit; use Magento\Framework\App\Bootstrap; diff --git a/lib/internal/Magento/Framework/Archive/Helper/File.php b/lib/internal/Magento/Framework/Archive/Helper/File.php index a0e8b3084e855..ec39bb38d40fc 100644 --- a/lib/internal/Magento/Framework/Archive/Helper/File.php +++ b/lib/internal/Magento/Framework/Archive/Helper/File.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Helper class that simplifies files stream reading and writing */ @@ -98,7 +96,10 @@ public function open($mode = 'w+', $chmod = null) if ($this->_isInWriteMode) { if (!is_writable($this->_fileLocation)) { throw new LocalizedException( - new \Magento\Framework\Phrase('Permission denied to write to %1', [$this->_fileLocation]) + new \Magento\Framework\Phrase( + 'Permission denied to write to %1', + [$this->_fileLocation] + ) ); } @@ -199,7 +200,9 @@ protected function _open($mode) $this->_fileHandler = @fopen($this->_filePath, $mode); if (false === $this->_fileHandler) { - throw new LocalizedException(new \Magento\Framework\Phrase('Failed to open file %1', [$this->_filePath])); + throw new LocalizedException( + new \Magento\Framework\Phrase('Failed to open file %1', [$this->_filePath]) + ); } } @@ -215,7 +218,9 @@ protected function _write($data) $result = @fwrite($this->_fileHandler, $data); if (false === $result) { - throw new LocalizedException(new \Magento\Framework\Phrase('Failed to write data to %1', [$this->_filePath])); + throw new LocalizedException( + new \Magento\Framework\Phrase('Failed to write data to %1', [$this->_filePath]) + ); } } diff --git a/lib/internal/Magento/Framework/Archive/Helper/File/Gz.php b/lib/internal/Magento/Framework/Archive/Helper/File/Gz.php index 2bc293270aabd..3d2d1e73061c2 100644 --- a/lib/internal/Magento/Framework/Archive/Helper/File/Gz.php +++ b/lib/internal/Magento/Framework/Archive/Helper/File/Gz.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Helper class that simplifies gz files stream reading and writing */ diff --git a/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php b/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php index be40adcdc0edc..3ebb08f4b0988 100644 --- a/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php +++ b/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Autoload\Test\Unit; use Composer\Autoload\ClassLoader; diff --git a/lib/internal/Magento/Framework/Backup/Archive/Tar.php b/lib/internal/Magento/Framework/Backup/Archive/Tar.php index 8610a7e5994f4..3abd3b0347d40 100644 --- a/lib/internal/Magento/Framework/Backup/Archive/Tar.php +++ b/lib/internal/Magento/Framework/Backup/Archive/Tar.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Extended version of \Magento\Framework\Archive\Tar that supports filtering * @@ -41,7 +39,10 @@ protected function _createTar($skipRoot = false, $finalize = false) \RecursiveIteratorIterator::SELF_FIRST ); - $iterator = new \Magento\Framework\Backup\Filesystem\Iterator\Filter($filesystemIterator, $this->_skipFiles); + $iterator = new \Magento\Framework\Backup\Filesystem\Iterator\Filter( + $filesystemIterator, + $this->_skipFiles + ); foreach ($iterator as $item) { $this->_setCurrentFile($item->getPathname()); diff --git a/lib/internal/Magento/Framework/Backup/Db/BackupFactory.php b/lib/internal/Magento/Framework/Backup/Db/BackupFactory.php index 4ea115adf9927..c468591ddabe9 100644 --- a/lib/internal/Magento/Framework/Backup/Db/BackupFactory.php +++ b/lib/internal/Magento/Framework/Backup/Db/BackupFactory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Backup\Db; class BackupFactory @@ -32,8 +30,11 @@ class BackupFactory * @param string $backupInstanceName * @param string $backupDbInstanceName */ - public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $backupInstanceName, $backupDbInstanceName) - { + public function __construct( + \Magento\Framework\ObjectManagerInterface $objectManager, + $backupInstanceName, + $backupDbInstanceName + ) { $this->_objectManager = $objectManager; $this->_backupInstanceName = $backupInstanceName; $this->_backupDbInstanceName = $backupDbInstanceName; diff --git a/lib/internal/Magento/Framework/Backup/Factory.php b/lib/internal/Magento/Framework/Backup/Factory.php index 6a0837c138952..05182610b0e25 100644 --- a/lib/internal/Magento/Framework/Backup/Factory.php +++ b/lib/internal/Magento/Framework/Backup/Factory.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Backup; class Factory diff --git a/lib/internal/Magento/Framework/Backup/Filesystem.php b/lib/internal/Magento/Framework/Backup/Filesystem.php index 7fe469441eeaf..309a22426bb92 100644 --- a/lib/internal/Magento/Framework/Backup/Filesystem.php +++ b/lib/internal/Magento/Framework/Backup/Filesystem.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Backup; use Magento\Framework\App\ObjectManager; diff --git a/lib/internal/Magento/Framework/Cache/Backend/Database.php b/lib/internal/Magento/Framework/Cache/Backend/Database.php index 1f03a0e5d97e1..3da59b78fdef9 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/Database.php +++ b/lib/internal/Magento/Framework/Cache/Backend/Database.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** Tables declaration: @@ -148,7 +146,10 @@ public function load($id, $doNotTestCacheValidity = false) { if ($this->_options['store_data'] && !$this->_options['infinite_loop_flag']) { $this->_options['infinite_loop_flag'] = true; - $select = $this->_getConnection()->select()->from($this->_getDataTable(), 'data')->where('id=:cache_id'); + $select = $this->_getConnection()->select()->from( + $this->_getDataTable(), + 'data' + )->where('id=:cache_id'); if (!$doNotTestCacheValidity) { $select->where('expire_time=0 OR expire_time>?', time()); diff --git a/lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php b/lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php index c8b96659a6b40..cf5e1aefbe1d6 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php +++ b/lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Cache\Backend; class Eaccelerator extends \Zend_Cache_Backend implements \Zend_Cache_Backend_ExtendedInterface diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php index cdbbc4baed695..403e05dd5fe84 100644 --- a/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php +++ b/lib/internal/Magento/Framework/Cache/Test/Unit/CoreTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * \Magento\Framework\Cache\Core test case */ diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php index 9024d56e8a29a..634584c0524dc 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Code\Test\Unit; use Magento\Framework\Code\Generator; diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Reader/_files/ClassesForArgumentsReader.php b/lib/internal/Magento/Framework/Code/Test/Unit/Reader/_files/ClassesForArgumentsReader.php index ff5dda80cbee2..02c1eadbd7e8b 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Reader/_files/ClassesForArgumentsReader.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Reader/_files/ClassesForArgumentsReader.php @@ -5,8 +5,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - class ClassWithAllArgumentTypes { const DEFAULT_VALUE = 'Const Value'; diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ConstructorArgumentTypesTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ConstructorArgumentTypesTest.php index d03db534f1837..fba2110b780ca 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ConstructorArgumentTypesTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ConstructorArgumentTypesTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Code\Test\Unit\Validator; class ConstructorArgumentTypesTest extends \PHPUnit_Framework_TestCase @@ -28,14 +26,14 @@ class ConstructorArgumentTypesTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->argumentsReaderMock = $this->getMock( + $this->argumentsReaderMock = $this->getMock( \Magento\Framework\Code\Reader\ArgumentsReader::class, [], [], '', false ); - $this->sourceArgumentsReaderMock = $this->getMock( + $this->sourceArgumentsReaderMock = $this->getMock( \Magento\Framework\Code\Reader\SourceArgumentsReader::class, [], [], diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php index 32c3a7d674f17..4a4a3f244d3c6 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForArgumentSequence.php @@ -5,8 +5,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace ArgumentSequence; class ContextObject implements \Magento\Framework\ObjectManager\ContextInterface diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php index 698b16992bbfe..8878bf49fdecd 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php @@ -5,8 +5,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - class ClassA { } diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php index 27a677e7fe71e..08d10b401a52d 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php @@ -5,8 +5,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - class ClassFirst { } diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForTypeDuplication.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForTypeDuplication.php index 1542747bc231a..ea290232ee261 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForTypeDuplication.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForTypeDuplication.php @@ -5,8 +5,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace TypeDuplication; interface ArgumentInterface diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php index b059686b3e119..e5c30cd14aa95 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\SomeModule\Model; use Magento\SomeModule\Model\Two\Test as TestTwo; diff --git a/lib/internal/Magento/Framework/Config/Dom.php b/lib/internal/Magento/Framework/Config/Dom.php index 826b50927a2f3..691241adfeac3 100644 --- a/lib/internal/Magento/Framework/Config/Dom.php +++ b/lib/internal/Magento/Framework/Config/Dom.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Magento configuration XML DOM utility */ diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/Composer/PackageTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/Composer/PackageTest.php index 0fdbbf22e54ca..1369cad90236e 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/Composer/PackageTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/Composer/PackageTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Config\Test\Unit\Composer; use \Magento\Framework\Config\Composer\Package; diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php index 5c58310e096bb..16dce5df8bb23 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Config\Test\Unit; class DataTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectFactoryTest.php b/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectFactoryTest.php index ba102c00027b5..03d3010ad035b 100644 --- a/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectFactoryTest.php +++ b/lib/internal/Magento/Framework/Controller/Test/Unit/Result/RedirectFactoryTest.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Controller\Test\Unit\Result; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/Instruction/Import.php b/lib/internal/Magento/Framework/Css/PreProcessor/Instruction/Import.php index 524ccc8c11fe3..215a73dec392d 100644 --- a/lib/internal/Magento/Framework/Css/PreProcessor/Instruction/Import.php +++ b/lib/internal/Magento/Framework/Css/PreProcessor/Instruction/Import.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Css\PreProcessor\Instruction; use Magento\Framework\View\Asset\LocalInterface; diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php index 2441422bb1821..20c0dbb293584 100644 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Css\Test\Unit\PreProcessor\Instruction; use Magento\Framework\Css\PreProcessor\FileGenerator\RelatedGenerator; @@ -39,7 +37,7 @@ class ImportTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->notationResolver = $this->getMock( + $this->notationResolver = $this->getMock( \Magento\Framework\View\Asset\NotationResolver\Module::class, [], [], '', false ); $this->asset = $this->getMock(\Magento\Framework\View\Asset\File::class, [], [], '', false); diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/MagentoImportTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/MagentoImportTest.php index 9bc04c8ff33e9..507c059671f9d 100644 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/MagentoImportTest.php +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/MagentoImportTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Css\Test\Unit\PreProcessor\Instruction; use Magento\Framework\Css\PreProcessor\Instruction\MagentoImport; diff --git a/lib/internal/Magento/Framework/CurrencyFactory.php b/lib/internal/Magento/Framework/CurrencyFactory.php index 75313af3d289b..8ee2ebbd48d7e 100644 --- a/lib/internal/Magento/Framework/CurrencyFactory.php +++ b/lib/internal/Magento/Framework/CurrencyFactory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework; class CurrencyFactory @@ -24,8 +22,10 @@ class CurrencyFactory * @param ObjectManagerInterface $objectManager * @param string $instanceName */ - public function __construct(ObjectManagerInterface $objectManager, $instanceName = CurrencyInterface::class) - { + public function __construct( + ObjectManagerInterface $objectManager, + $instanceName = CurrencyInterface::class + ) { $this->_objectManager = $objectManager; $this->_instanceName = $instanceName; } diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index cfbeb4f54c9e2..6f04a2a7c38d8 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\DB\Adapter\Pdo; use Magento\Framework\Cache\FrontendInterface; diff --git a/lib/internal/Magento/Framework/DB/MapperFactory.php b/lib/internal/Magento/Framework/DB/MapperFactory.php index c387c9d73ce38..7a870f7b71f68 100644 --- a/lib/internal/Magento/Framework/DB/MapperFactory.php +++ b/lib/internal/Magento/Framework/DB/MapperFactory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\DB; /** diff --git a/lib/internal/Magento/Framework/DB/QueryFactory.php b/lib/internal/Magento/Framework/DB/QueryFactory.php index 8783a92ab10d3..ff6265a2a6aa3 100644 --- a/lib/internal/Magento/Framework/DB/QueryFactory.php +++ b/lib/internal/Magento/Framework/DB/QueryFactory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\DB; /** diff --git a/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php index 822694b4a2a4a..5b7cccf11388a 100644 --- a/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Mysql DB Statement * diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php index c01121595f795..d66b209368132 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\DB\Test\Unit; use Magento\Framework\DB\Select; diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php index 565548de0a26f..281048686e822 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * \Magento\Framework\DB\Adapter\Pdo\Mysql class test */ @@ -60,7 +58,7 @@ protected function setUp() // LoggerInterface $logger, // SelectFactory $selectFactory, // array $config = [] - $this->_mockAdapter = $this->getMock( + $this->_mockAdapter = $this->getMock( \Magento\Framework\DB\Adapter\Pdo\Mysql::class, ['beginTransaction', 'getTransactionLevel'], [ @@ -82,7 +80,7 @@ protected function setUp() ->method('getTransactionLevel') ->will($this->returnValue(1)); - $this->_adapter = $this->getMock( + $this->_adapter = $this->getMock( \Magento\Framework\DB\Adapter\Pdo\Mysql::class, [ 'getCreateTable', @@ -108,7 +106,7 @@ protected function setUp() true ); - $profiler = $this->getMock( + $profiler = $this->getMock( \Zend_Db_Profiler::class ); @@ -468,7 +466,7 @@ public function testInsertOnDuplicateWithQuotedColumnName() */ public function testAddColumn($options, $expectedQuery) { - $connectionMock = $this->getMock( + $connectionMock = $this->getMock( \Magento\Framework\DB\Adapter\Pdo\Mysql::class, ['tableColumnExists', '_getTableName', 'rawQuery', 'resetDdlCache', 'quote'], [], '', false ); diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php index c4e6797242e19..3792badf61a0a 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Data\Form\Element; use Magento\Framework\Escaper; diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php b/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php index a2cf4843bb78d..5690c07b2f05b 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Category form input image element * @@ -45,7 +43,7 @@ public function getElementHtml() $html = ''; $html .= ''; $widgetButton = $this->getForm()->getParent()->getLayout(); - $buttonHtml = $widgetButton->createBlock( + $buttonHtml = $widgetButton->createBlock( \Magento\Backend\Block\Widget\Button::class )->setData( ['label' => 'Add New Image', 'onclick' => 'addNewImg()', 'class' => 'add'] diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Time.php b/lib/internal/Magento/Framework/Data/Form/Element/Time.php index fe23e73b1352e..e0a400d41a9a9 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Time.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Time.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Form time element * diff --git a/lib/internal/Magento/Framework/Data/FormFactory.php b/lib/internal/Magento/Framework/Data/FormFactory.php index 6602b2b609d85..84a47672ef401 100644 --- a/lib/internal/Magento/Framework/Data/FormFactory.php +++ b/lib/internal/Magento/Framework/Data/FormFactory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Data; /** @@ -54,7 +52,10 @@ public function create(array $data = []) $form = $this->_objectManager->create($this->_instanceName, $data); if (!$form instanceof \Magento\Framework\Data\Form) { throw new \Magento\Framework\Exception\LocalizedException( - new \Magento\Framework\Phrase('%1 doesn\'t extend \Magento\Framework\Data\Form', [$this->_instanceName]) + new \Magento\Framework\Phrase( + '%1 doesn\'t extend \Magento\Framework\Data\Form', + [$this->_instanceName] + ) ); } return $form; diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php index 09f4c08628e1d..60d14a11c052c 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Data\Test\Unit\Collection; /** diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php index a6cdfd23c50e0..8d826272ec261 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Tests for \Magento\Framework\Data\Form\Element\AbstractElement */ diff --git a/lib/internal/Magento/Framework/Encryption/Crypt.php b/lib/internal/Magento/Framework/Encryption/Crypt.php index 98fcb40757802..8ccc77dd60d39 100644 --- a/lib/internal/Magento/Framework/Encryption/Crypt.php +++ b/lib/internal/Magento/Framework/Encryption/Crypt.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Encryption; /** @@ -47,8 +45,12 @@ class Crypt * FALSE fills initial vector with zero bytes to not use it. * @throws \Exception */ - public function __construct($key, $cipher = MCRYPT_BLOWFISH, $mode = MCRYPT_MODE_ECB, $initVector = false) - { + public function __construct( + $key, + $cipher = MCRYPT_BLOWFISH, + $mode = MCRYPT_MODE_ECB, + $initVector = false + ) { $this->_cipher = $cipher; $this->_mode = $mode; $this->_handle = mcrypt_module_open($cipher, '', $mode, ''); @@ -72,7 +74,10 @@ public function __construct($key, $cipher = MCRYPT_BLOWFISH, $mode = MCRYPT_MODE $initVector = str_repeat("\0", $initVectorSize); } elseif (!is_string($initVector) || strlen($initVector) != $initVectorSize) { throw new \Magento\Framework\Exception\LocalizedException( - new \Magento\Framework\Phrase('Init vector must be a string of %1 bytes.', [$initVectorSize]) + new \Magento\Framework\Phrase( + 'Init vector must be a string of %1 bytes.', + [$initVectorSize] + ) ); } $this->_initVector = $initVector; diff --git a/lib/internal/Magento/Framework/Encryption/Helper/Security.php b/lib/internal/Magento/Framework/Encryption/Helper/Security.php index eea9e8d378233..b3bd46f8e8b99 100644 --- a/lib/internal/Magento/Framework/Encryption/Helper/Security.php +++ b/lib/internal/Magento/Framework/Encryption/Helper/Security.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Encryption\Helper; use Zend\Crypt\Utils; diff --git a/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php b/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php index 20743df52198a..1a2a702c5c8db 100644 --- a/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php +++ b/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Event\Invoker; use Magento\Framework\Event\Observer; @@ -33,8 +31,10 @@ class InvokerDefault implements \Magento\Framework\Event\InvokerInterface * @param \Magento\Framework\Event\ObserverFactory $observerFactory * @param \Magento\Framework\App\State $appState */ - public function __construct(\Magento\Framework\Event\ObserverFactory $observerFactory, \Magento\Framework\App\State $appState) - { + public function __construct( + \Magento\Framework\Event\ObserverFactory $observerFactory, + \Magento\Framework\App\State $appState + ) { $this->_observerFactory = $observerFactory; $this->_appState = $appState; } diff --git a/lib/internal/Magento/Framework/File/Csv.php b/lib/internal/Magento/Framework/File/Csv.php index 1e8050c04a60e..a0a2822272bec 100644 --- a/lib/internal/Magento/Framework/File/Csv.php +++ b/lib/internal/Magento/Framework/File/Csv.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\File; use Magento\Framework\Filesystem\Driver\File; diff --git a/lib/internal/Magento/Framework/File/CsvMulty.php b/lib/internal/Magento/Framework/File/CsvMulty.php index eb0c65656bc80..5f6e2de205763 100644 --- a/lib/internal/Magento/Framework/File/CsvMulty.php +++ b/lib/internal/Magento/Framework/File/CsvMulty.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Csv parse * diff --git a/lib/internal/Magento/Framework/File/Test/Unit/CsvTest.php b/lib/internal/Magento/Framework/File/Test/Unit/CsvTest.php index 609be97a8ec77..e8081a17c1885 100644 --- a/lib/internal/Magento/Framework/File/Test/Unit/CsvTest.php +++ b/lib/internal/Magento/Framework/File/Test/Unit/CsvTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\File\Test\Unit; use Magento\Framework\Filesystem\Driver\File; diff --git a/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php b/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php index 7404cf50fdd0a..87c76ea518b4b 100644 --- a/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php +++ b/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\File\Transfer\Adapter; class Http @@ -24,8 +22,10 @@ class Http * @param \Magento\Framework\App\Response\Http * @param \Magento\Framework\File\Mime $mime */ - public function __construct(\Magento\Framework\HTTP\PhpEnvironment\Response $response, \Magento\Framework\File\Mime $mime) - { + public function __construct( + \Magento\Framework\HTTP\PhpEnvironment\Response $response, + \Magento\Framework\File\Mime $mime + ) { $this->response = $response; $this->mime = $mime; } diff --git a/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php b/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php index 30bed420be66c..630a9eb3082bf 100644 --- a/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php +++ b/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Filesystem\Io; /** @@ -48,7 +46,9 @@ public function open(array $args = []) } $this->_connection = new \phpseclib\Net\SFTP($host, $port, $args['timeout']); if (!$this->_connection->login($args['username'], $args['password'])) { - throw new \Exception(sprintf("Unable to open SFTP connection as %s@%s", $args['username'], $args['host'])); + throw new \Exception( + sprintf("Unable to open SFTP connection as %s@%s", $args['username'], $args['host']) + ); } } diff --git a/lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php b/lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php index 10f1289b90c18..7090d925edc84 100644 --- a/lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php +++ b/lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Filter\Input; class MaliciousCode implements \Zend_Filter_Interface diff --git a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php index fb00e9f59c830..be113354cc57c 100644 --- a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * HTTP CURL Adapter * diff --git a/lib/internal/Magento/Framework/HTTP/Header.php b/lib/internal/Magento/Framework/HTTP/Header.php index e6371fe38c6cd..d21fb244a55a8 100644 --- a/lib/internal/Magento/Framework/HTTP/Header.php +++ b/lib/internal/Magento/Framework/HTTP/Header.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\HTTP; /** @@ -29,8 +27,10 @@ class Header * @param \Magento\Framework\App\RequestInterface $httpRequest * @param \Magento\Framework\Stdlib\StringUtils $converter */ - public function __construct(\Magento\Framework\App\RequestInterface $httpRequest, \Magento\Framework\Stdlib\StringUtils $converter) - { + public function __construct( + \Magento\Framework\App\RequestInterface $httpRequest, + \Magento\Framework\Stdlib\StringUtils $converter + ) { $this->_request = $httpRequest; $this->_converter = $converter; } diff --git a/lib/internal/Magento/Framework/Image/Factory.php b/lib/internal/Magento/Framework/Image/Factory.php index 2239d141d2fc2..f6ac872ef9912 100644 --- a/lib/internal/Magento/Framework/Image/Factory.php +++ b/lib/internal/Magento/Framework/Image/Factory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Image; use Magento\Framework\ObjectManagerInterface; @@ -26,8 +24,10 @@ class Factory * @param ObjectManagerInterface $objectManager * @param AdapterFactory $adapterFactory */ - public function __construct(ObjectManagerInterface $objectManager, AdapterFactory $adapterFactory) - { + public function __construct( + ObjectManagerInterface $objectManager, + AdapterFactory $adapterFactory + ) { $this->objectManager = $objectManager; $this->adapterFactory = $adapterFactory; } @@ -42,7 +42,7 @@ public function __construct(ObjectManagerInterface $objectManager, AdapterFactor public function create($fileName = null, $adapterName = null) { $adapter = $this->adapterFactory->create($adapterName); - return $this->objectManager->create( + return $this->objectManager->create( \Magento\Framework\Image::class, ['adapter' => $adapter, 'fileName' => $fileName]); } } diff --git a/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php b/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php index 0c920717bdf38..f0edfa49eb980 100644 --- a/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php +++ b/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Interception\Code\Generator; class Interceptor extends \Magento\Framework\Code\Generator\EntityAbstract diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php index 4c26b41a1547a..3ec7bcca3c6a4 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/InterceptorTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Interception\Test\Unit\Code\Generator; class InterceptorTest extends \PHPUnit_Framework_TestCase @@ -23,7 +21,7 @@ class InterceptorTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->ioObjectMock = $this->getMock(\Magento\Framework\Code\Generator\Io::class, [], [], '', false); - $this->classGeneratorMock = $this->getMock( + $this->classGeneratorMock = $this->getMock( \Magento\Framework\Code\Generator\CodeGeneratorInterface::class, [], [], @@ -35,7 +33,7 @@ protected function setUp() public function testGetDefaultResultClassName() { // resultClassName should be stdClass_Interceptor - $model = $this->getMock( + $model = $this->getMock( \Magento\Framework\Interception\Code\Generator\Interceptor::class, ['_validateData'], [ diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php index a2660a4561fe9..95752d0dbbf81 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Interception\Test\Unit\Code; use \Magento\Framework\Interception\Code\InterfaceValidator; diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php index 992ed838b7c52..db449c0f4030b 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php @@ -3,7 +3,7 @@ * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile + namespace Magento\Framework\Interception\Test\Unit\Config; require_once __DIR__ . '/../Custom/Module/Model/Item.php'; diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ExtraParameters.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ExtraParameters.php index 3de967defdbca..46252efb75ca0 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ExtraParameters.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ExtraParameters.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin; class ExtraParameters diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsCount.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsCount.php index ac9f606383941..9478a8dc845d7 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsCount.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsCount.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin; class IncompatibleArgumentsCount diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsType.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsType.php index c971dfeed7620..cb4bf15710f42 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsType.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsType.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin; class IncompatibleArgumentsType @@ -18,7 +16,8 @@ class IncompatibleArgumentsType * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeGetItem( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, array $names + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, + array $names ) { return count($names); } diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/InvalidProceed.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/InvalidProceed.php index 7244816430882..c5eb2f23a3fd8 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/InvalidProceed.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/InvalidProceed.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin; class InvalidProceed @@ -19,7 +17,9 @@ class InvalidProceed * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundGetItem( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\Item $subject, $name, $surname + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\Item $subject, + $name, + $surname ) { return $name . $surname; } diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ValidPlugin.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ValidPlugin.php index 821b8bdf93de9..2d589c8678c0e 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ValidPlugin.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ValidPlugin.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin; class ValidPlugin @@ -18,7 +16,8 @@ class ValidPlugin * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetItem( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, $result + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, + $result ) { return $result . '!'; } @@ -31,7 +30,8 @@ public function afterGetItem( * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeGetItem( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, $name + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, + $name ) { return '|' . $name; } diff --git a/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php index 5af8e61b2fc26..d6f63bc470349 100644 --- a/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Locale\Test\Unit; class ConfigTest extends \PHPUnit_Framework_TestCase @@ -91,7 +89,7 @@ public function testGetAllowedLocalesNoDataArray() public function testGetAllowedLocalesGivenDataArray() { $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject( + ->getObject( \Magento\Framework\Locale\Config::class, [ 'data' => [ @@ -117,7 +115,7 @@ public function testGetAllowedLocalesGivenDataArray() public function testGetAllowedLocalesGivenRedundantDataArray() { $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject( + ->getObject( \Magento\Framework\Locale\Config::class, [ 'data' => [ @@ -159,7 +157,7 @@ public function testGetAllowedCurrenciesNoDataArray() public function testGetAllowedCurrenciesGivenDataArray() { $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject( + ->getObject( \Magento\Framework\Locale\Config::class, [ 'data' => [ @@ -185,7 +183,7 @@ public function testGetAllowedCurrenciesGivenDataArray() public function testGetAllowedCurrenciesGivenRedundantDataArray() { $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject( + ->getObject( \Magento\Framework\Locale\Config::class, [ 'data' => [ diff --git a/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php b/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php index 5883276fa1fe3..ab65f41ebeaa8 100644 --- a/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php +++ b/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Locale\Test\Unit; use Magento\Framework\Locale\Currency; @@ -58,7 +56,7 @@ protected function setUp() ->getMock(); $this->testCurrencyObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject( + ->getObject( \Magento\Framework\Locale\Currency::class, [ 'eventManager' => $this->mockEventManager, diff --git a/lib/internal/Magento/Framework/Locale/TranslatedLists.php b/lib/internal/Magento/Framework/Locale/TranslatedLists.php index a9724176f198e..78ad9d09e0662 100644 --- a/lib/internal/Magento/Framework/Locale/TranslatedLists.php +++ b/lib/internal/Magento/Framework/Locale/TranslatedLists.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Locale; use Magento\Framework\Locale\Bundle\CurrencyBundle; diff --git a/lib/internal/Magento/Framework/Message/Factory.php b/lib/internal/Magento/Framework/Message/Factory.php index 56d010da58521..ccd71fce91222 100644 --- a/lib/internal/Magento/Framework/Message/Factory.php +++ b/lib/internal/Magento/Framework/Message/Factory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Message; use Magento\Framework\ObjectManagerInterface; diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php index 6c82dafb6c44e..b22494603a69e 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Model\ResourceModel\Db\Collection; use Magento\Framework\App\ResourceConnection\SourceProviderInterface; diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php index 8b6a2c23386ff..202633a27d27e 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Model\ResourceModel\Type\Db\Pdo; use Magento\Framework\App\ResourceConnection\ConnectionAdapterInterface; diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/AbstractExtensibleModelTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/AbstractExtensibleModelTest.php index 13a9ed5be4f92..011463ab56741 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/AbstractExtensibleModelTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/AbstractExtensibleModelTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Model\Test\Unit; use Magento\Framework\Api\AttributeValue; diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php index d13bcdc539aa8..7ad907c22421b 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Model\Test\Unit\ResourceModel\Db; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Adapter\DuplicateException; diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php index d458810732b6b..a2555f13898ae 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Model\Test\Unit\ResourceModel\Db\Collection; use Magento\Framework\DB\Select; diff --git a/lib/internal/Magento/Framework/Module/ModuleResource.php b/lib/internal/Magento/Framework/Module/ModuleResource.php index 42a14ac74d3ec..325420f4b12df 100644 --- a/lib/internal/Magento/Framework/Module/ModuleResource.php +++ b/lib/internal/Magento/Framework/Module/ModuleResource.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Module; /** diff --git a/lib/internal/Magento/Framework/Module/Setup/MigrationFactory.php b/lib/internal/Magento/Framework/Module/Setup/MigrationFactory.php index dd8067278728e..9521ecd905938 100644 --- a/lib/internal/Magento/Framework/Module/Setup/MigrationFactory.php +++ b/lib/internal/Magento/Framework/Module/Setup/MigrationFactory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Module\Setup; /** diff --git a/lib/internal/Magento/Framework/Mview/ActionFactory.php b/lib/internal/Magento/Framework/Mview/ActionFactory.php index 77b0c89c8cc39..f4fd28bb12693 100644 --- a/lib/internal/Magento/Framework/Mview/ActionFactory.php +++ b/lib/internal/Magento/Framework/Mview/ActionFactory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Mview; class ActionFactory @@ -34,7 +32,9 @@ public function get($className) { $action = $this->objectManager->get($className); if (!$action instanceof ActionInterface) { - throw new \InvalidArgumentException($className . ' doesn\'t implement \Magento\Framework\Mview\ActionInterface'); + throw new \InvalidArgumentException( + $className . ' doesn\'t implement \Magento\Framework\Mview\ActionInterface' + ); } return $action; diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/Config/Data/ProxyTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/Config/Data/ProxyTest.php index 34ebdcca3f136..2baa1b733aa3e 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/Config/Data/ProxyTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/Config/Data/ProxyTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Mview\Test\Unit\Config\Data; use \Magento\Framework\Mview\Config\Data\Proxy; diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/ConfigTest.php index 52925e4a5a0e2..1dd5627d7d422 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/ConfigTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Mview\Test\Unit; use \Magento\Framework\Mview\Config; @@ -24,7 +22,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->dataMock = $this->getMock( + $this->dataMock = $this->getMock( \Magento\Framework\Mview\Config\Data::class, [], [], '', false ); $this->model = new Config( diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/CollectionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/CollectionTest.php index d92241871423e..231da97292922 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/CollectionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/CollectionTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Mview\Test\Unit\View; class CollectionTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionFactoryTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionFactoryTest.php index 79d8e8d419e93..f27efd62b7321 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionFactoryTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionFactoryTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Mview\Test\Unit\View; use \Magento\Framework\Mview\View\SubscriptionFactory; diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index 2cbf5da0bfbbb..8085e73a7d0c2 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Mview\Test\Unit\View; use \Magento\Framework\Mview\View\Subscription; @@ -39,7 +37,14 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->connectionMock = $this->getMock(\Magento\Framework\DB\Adapter\Pdo\Mysql::class, [], [], '', false); + $this->connectionMock = $this->getMock( + \Magento\Framework\DB\Adapter\Pdo\Mysql::class, + [], + [], + '', + false + ); + $this->resourceMock = $this->getMock( \Magento\Framework\App\ResourceConnection::class, [], diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index 16d88767e508c..90d85947e8f5b 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Mview; use Magento\Framework\Mview\View\ChangelogTableNotExistsException; diff --git a/lib/internal/Magento/Framework/Mview/View/Subscription.php b/lib/internal/Magento/Framework/Mview/View/Subscription.php index 7dd440ae9a4aa..cac109d427dd9 100644 --- a/lib/internal/Magento/Framework/Mview/View/Subscription.php +++ b/lib/internal/Magento/Framework/Mview/View/Subscription.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Mview\View; use Magento\Framework\App\ResourceConnection; @@ -154,7 +152,9 @@ public function remove() protected function getLinkedViews() { if (!$this->linkedViews) { - $viewList = $this->viewCollection->getViewsByStateMode(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED); + $viewList = $this->viewCollection->getViewsByStateMode( + \Magento\Framework\Mview\View\StateInterface::MODE_ENABLED + ); foreach ($viewList as $view) { /** @var \Magento\Framework\Mview\ViewInterface $view */ diff --git a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Persistor.php b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Persistor.php index e1ac605e802ff..62043e1389733 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Persistor.php +++ b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Persistor.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\ObjectManager\Code\Generator; /** diff --git a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php index 0c825a5ed5ac5..9aa3123b7db73 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php +++ b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\ObjectManager\Code\Generator; use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface; diff --git a/lib/internal/Magento/Framework/ObjectManager/DefinitionFactory.php b/lib/internal/Magento/Framework/ObjectManager/DefinitionFactory.php index 40959aa196694..af324937ccba5 100644 --- a/lib/internal/Magento/Framework/ObjectManager/DefinitionFactory.php +++ b/lib/internal/Magento/Framework/ObjectManager/DefinitionFactory.php @@ -7,8 +7,6 @@ * */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\ObjectManager; use Magento\Framework\Api\Code\Generator\Mapper as MapperGenerator; @@ -78,8 +76,12 @@ class DefinitionFactory * @param string $generationDir * @param string $definitionFormat */ - public function __construct(DriverInterface $filesystemDriver, $definitionDir, $generationDir, $definitionFormat) - { + public function __construct( + DriverInterface $filesystemDriver, + $definitionDir, + $generationDir, + $definitionFormat + ) { $this->_filesystemDriver = $filesystemDriver; $this->_definitionDir = $definitionDir; $this->_generationDir = $generationDir; diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/_files/ConfigDomMock.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/_files/ConfigDomMock.php index 265367641e796..9fed71539a650 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/_files/ConfigDomMock.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/Reader/_files/ConfigDomMock.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - class ConfigDomMock extends \PHPUnit_Framework_TestCase { /** @@ -15,8 +13,13 @@ class ConfigDomMock extends \PHPUnit_Framework_TestCase * @param $perFileSchema * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function __construct($initialContents, $validationState, $idAttributes, $typeAttribute, $perFileSchema) - { + public function __construct( + $initialContents, + $validationState, + $idAttributes, + $typeAttribute, + $perFileSchema + ) { $this->assertEquals('first content item', $initialContents); $this->assertEquals('xsi:type', $typeAttribute); } diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Relations/RuntimeTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Relations/RuntimeTest.php index cb274f845b668..af59e9fbccdd3 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Relations/RuntimeTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Relations/RuntimeTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\ObjectManager\Test\Unit\Relations; require_once __DIR__ . '/../_files/Child.php'; diff --git a/lib/internal/Magento/Framework/Phrase/Test/Unit/Renderer/CompositeTest.php b/lib/internal/Magento/Framework/Phrase/Test/Unit/Renderer/CompositeTest.php index cb453ef2cd4c5..aeb586271a207 100644 --- a/lib/internal/Magento/Framework/Phrase/Test/Unit/Renderer/CompositeTest.php +++ b/lib/internal/Magento/Framework/Phrase/Test/Unit/Renderer/CompositeTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Phrase\Test\Unit\Renderer; use \Magento\Framework\Phrase\Renderer\Composite; diff --git a/lib/internal/Magento/Framework/Pricing/Render/RendererPool.php b/lib/internal/Magento/Framework/Pricing/Render/RendererPool.php index 8f3c117baa722..84ce0084e6a1a 100644 --- a/lib/internal/Magento/Framework/Pricing/Render/RendererPool.php +++ b/lib/internal/Magento/Framework/Pricing/Render/RendererPool.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Pricing\Render; use Magento\Framework\Pricing\Amount\AmountInterface; diff --git a/lib/internal/Magento/Framework/Profiler/Driver/Factory.php b/lib/internal/Magento/Framework/Profiler/Driver/Factory.php index 5975f60f41ddb..392cecad548e5 100644 --- a/lib/internal/Magento/Framework/Profiler/Driver/Factory.php +++ b/lib/internal/Magento/Framework/Profiler/Driver/Factory.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Profiler\Driver; use Magento\Framework\Profiler\DriverInterface; @@ -65,7 +63,10 @@ public function create(array $config = null) $driver = new $class($config); if (!$driver instanceof DriverInterface) { throw new \InvalidArgumentException( - sprintf("Driver class \"%s\" must implement \Magento\Framework\Profiler\DriverInterface.", get_class($driver)) + sprintf( + "Driver class \"%s\" must implement \Magento\Framework\Profiler\DriverInterface.", + get_class($driver) + ) ); } return $driver; diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php index 1df7cfa69ca83..c8ddd288db2b6 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/ConfigTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Test class for \Magento\Framework\Session\Config */ diff --git a/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php b/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php index b5049edd721c7..f3b521a6084d3 100644 --- a/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php +++ b/lib/internal/Magento/Framework/Stdlib/DateTime/TimezoneInterface.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Stdlib\DateTime; /** diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php index 28dcd4447b37e..a903fccc9f84b 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Stdlib\Test\Unit\Cookie; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; @@ -297,7 +295,7 @@ protected function createCookieScope($params = []) */ public function createSensitiveMetadata($metadata = []) { - return $this->objectManager->getObject( + return $this->objectManager->getObject( \Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata::class, ['metadata' => $metadata, 'request' => $this->requestMock] ); @@ -311,7 +309,7 @@ public function createSensitiveMetadata($metadata = []) */ public function createPublicMetadata($metadata = []) { - return $this->objectManager->getObject( + return $this->objectManager->getObject( \Magento\Framework\Stdlib\Cookie\PublicCookieMetadata::class, ['metadata' => $metadata] ); @@ -325,7 +323,7 @@ public function createPublicMetadata($metadata = []) */ public function createCookieMetadata($metadata = []) { - return $this->objectManager->getObject( + return $this->objectManager->getObject( \Magento\Framework\Stdlib\Cookie\CookieMetadata::class, ['metadata' => $metadata] ); diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php index ddb3214705c18..3c5a2ba168d1b 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - // @codingStandardsIgnoreStart namespace { $mockTranslateSetCookie = false; diff --git a/lib/internal/Magento/Framework/Test/Unit/ShellTest.php b/lib/internal/Magento/Framework/Test/Unit/ShellTest.php index d61d2f28829c7..604fa975c62a8 100644 --- a/lib/internal/Magento/Framework/Test/Unit/ShellTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/ShellTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Test\Unit; class ShellTest extends \PHPUnit_Framework_TestCase @@ -54,7 +52,10 @@ protected function _testExecuteCommand(\Magento\Framework\Shell $shell, $command public function testExecute($command, $commandArgs, $expectedResult) { $this->_testExecuteCommand( - new \Magento\Framework\Shell($this->commandRenderer, $this->logger), $command, $commandArgs, $expectedResult + new \Magento\Framework\Shell($this->commandRenderer, $this->logger), + $command, + $commandArgs, + $expectedResult ); } diff --git a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php index 36fce179395b5..9eb8c1c339ee5 100644 --- a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Test\Unit; /** diff --git a/lib/internal/Magento/Framework/Test/Unit/ValidatorFactoryTest.php b/lib/internal/Magento/Framework/Test/Unit/ValidatorFactoryTest.php index 2c8dca01988e7..f82ceedb8e45f 100644 --- a/lib/internal/Magento/Framework/Test/Unit/ValidatorFactoryTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/ValidatorFactoryTest.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Test\Unit; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; @@ -24,7 +22,7 @@ protected function setUp() { $objectManager = new ObjectManager($this); $this->objectManagerMock = $this->getMock(\Magento\Framework\ObjectManagerInterface::class); - $this->model = $objectManager->getObject( + $this->model = $objectManager->getObject( \Magento\Framework\ValidatorFactory::class, ['objectManager' => $this->objectManagerMock] ); diff --git a/lib/internal/Magento/Framework/Translate/Adapter.php b/lib/internal/Magento/Framework/Translate/Adapter.php index a529cb77695fe..b883f756165aa 100644 --- a/lib/internal/Magento/Framework/Translate/Adapter.php +++ b/lib/internal/Magento/Framework/Translate/Adapter.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Magento translate adapter */ diff --git a/lib/internal/Magento/Framework/Translate/AdapterInterface.php b/lib/internal/Magento/Framework/Translate/AdapterInterface.php index f29f4c77565fa..fe7bbf39521b2 100644 --- a/lib/internal/Magento/Framework/Translate/AdapterInterface.php +++ b/lib/internal/Magento/Framework/Translate/AdapterInterface.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Translate; /** diff --git a/lib/internal/Magento/Framework/Translate/Inline.php b/lib/internal/Magento/Framework/Translate/Inline.php index 6ba3cb9dcb330..d8e2bf9e4a655 100644 --- a/lib/internal/Magento/Framework/Translate/Inline.php +++ b/lib/internal/Magento/Framework/Translate/Inline.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Translate; class Inline implements \Magento\Framework\Translate\InlineInterface @@ -242,7 +240,11 @@ protected function stripInlineTranslations(&$body) } } else { if (is_string($body)) { - $body = preg_replace('#' . \Magento\Framework\Translate\Inline\ParserInterface::REGEXP_TOKEN . '#', '$1', $body); + $body = preg_replace( + '#' . \Magento\Framework\Translate\Inline\ParserInterface::REGEXP_TOKEN . '#', + '$1', + $body + ); } } return $this; diff --git a/lib/internal/Magento/Framework/Url.php b/lib/internal/Magento/Framework/Url.php index 7361fdb336dd8..6c9420536c490 100644 --- a/lib/internal/Magento/Framework/Url.php +++ b/lib/internal/Magento/Framework/Url.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework; /** @@ -1068,7 +1066,10 @@ public function useSessionIdForUrl($secure = false) $key = 'use_session_id_for_url_' . (int)$secure; if (is_null($this->getData($key))) { $httpHost = $this->_request->getHttpHost(); - $urlHost = parse_url($this->_getScope()->getBaseUrl(UrlInterface::URL_TYPE_LINK, $secure), PHP_URL_HOST); + $urlHost = parse_url( + $this->_getScope()->getBaseUrl(UrlInterface::URL_TYPE_LINK, $secure), + PHP_URL_HOST + ); if ($httpHost != $urlHost) { $this->setData($key, true); @@ -1090,7 +1091,10 @@ public function isOwnOriginUrl() $referer = parse_url($this->_request->getServer('HTTP_REFERER'), PHP_URL_HOST); foreach ($this->_scopeResolver->getScopes() as $scope) { $scopeDomains[] = parse_url($scope->getBaseUrl(), PHP_URL_HOST); - $scopeDomains[] = parse_url($scope->getBaseUrl(UrlInterface::URL_TYPE_LINK, true), PHP_URL_HOST); + $scopeDomains[] = parse_url( + $scope->getBaseUrl(UrlInterface::URL_TYPE_LINK, true), + PHP_URL_HOST + ); } $scopeDomains = array_unique($scopeDomains); if (empty($referer) || in_array($referer, $scopeDomains)) { @@ -1163,7 +1167,7 @@ protected function getRouteParamsResolver() private function getUrlModifier() { if ($this->urlModifier === null) { - $this->urlModifier = \Magento\Framework\App\ObjectManager::getInstance()->get( + $this->urlModifier = \Magento\Framework\App\ObjectManager::getInstance()->get( \Magento\Framework\Url\ModifierInterface::class ); } diff --git a/lib/internal/Magento/Framework/UrlFactory.php b/lib/internal/Magento/Framework/UrlFactory.php index ac7876a66a757..a419ccb576e75 100644 --- a/lib/internal/Magento/Framework/UrlFactory.php +++ b/lib/internal/Magento/Framework/UrlFactory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework; class UrlFactory @@ -24,8 +22,10 @@ class UrlFactory * @param ObjectManagerInterface $objectManager * @param string $instanceName */ - public function __construct(ObjectManagerInterface $objectManager, $instanceName = UrlInterface::class) - { + public function __construct( + ObjectManagerInterface $objectManager, + $instanceName = UrlInterface::class + ) { $this->_objectManager = $objectManager; $this->_instanceName = $instanceName; } diff --git a/lib/internal/Magento/Framework/Validator/Builder.php b/lib/internal/Magento/Framework/Validator/Builder.php index e31a2c86d9238..602681c04d762 100644 --- a/lib/internal/Magento/Framework/Validator/Builder.php +++ b/lib/internal/Magento/Framework/Validator/Builder.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Validator; use Magento\Framework\Validator\Constraint\OptionInterface; @@ -257,7 +255,11 @@ protected function _createConstraint(array $data) } if (\Magento\Framework\Validator\Config::CONSTRAINT_TYPE_PROPERTY == $data['type']) { - $result = new \Magento\Framework\Validator\Constraint\Property($validator, $data['property'], $data['alias']); + $result = new \Magento\Framework\Validator\Constraint\Property( + $validator, + $data['property'], + ['alias'] + ); } else { $result = $this->_constraintFactory->create(['validator' => $validator, 'alias' => $data['alias']]); } @@ -286,7 +288,10 @@ protected function _createConstraintValidator(array $data) // Check validator type if (!$validator instanceof \Magento\Framework\Validator\ValidatorInterface) { throw new \InvalidArgumentException( - sprintf('Constraint class "%s" must implement \Magento\Framework\Validator\ValidatorInterface', $data['class']) + sprintf( + 'Constraint class "%s" must implement \Magento\Framework\Validator\ValidatorInterface', + $data['class'] + ) ); } @@ -300,8 +305,10 @@ protected function _createConstraintValidator(array $data) * @param array $options * @return void */ - protected function _configureConstraintValidator(\Magento\Framework\Validator\ValidatorInterface $validator, array $options) - { + protected function _configureConstraintValidator( + \Magento\Framework\Validator\ValidatorInterface $validator, + array $options + ) { // Call all validator methods according to configuration if (isset($options['methods'])) { foreach ($options['methods'] as $methodData) { diff --git a/lib/internal/Magento/Framework/Validator/Constraint/Property.php b/lib/internal/Magento/Framework/Validator/Constraint/Property.php index c40e3c1237e64..dc96b9bc3899c 100644 --- a/lib/internal/Magento/Framework/Validator/Constraint/Property.php +++ b/lib/internal/Magento/Framework/Validator/Constraint/Property.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Validator\Constraint; class Property extends \Magento\Framework\Validator\Constraint diff --git a/lib/internal/Magento/Framework/Validator/ConstraintFactory.php b/lib/internal/Magento/Framework/Validator/ConstraintFactory.php index 1077f21bfa2bd..813961eb640ae 100644 --- a/lib/internal/Magento/Framework/Validator/ConstraintFactory.php +++ b/lib/internal/Magento/Framework/Validator/ConstraintFactory.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Factory class for \Magento\Framework\Validator\Constraint */ @@ -33,8 +31,10 @@ class ConstraintFactory * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param string $instanceName */ - public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $instanceName = \Magento\Framework\Validator\Constraint::class) - { + public function __construct( + \Magento\Framework\ObjectManagerInterface $objectManager, + $instanceName = \Magento\Framework\Validator\Constraint::class + ) { $this->_objectManager = $objectManager; $this->_instanceName = $instanceName; } diff --git a/lib/internal/Magento/Framework/Validator/Factory.php b/lib/internal/Magento/Framework/Validator/Factory.php index d2e3837d13138..c79e4e9bedf3a 100644 --- a/lib/internal/Magento/Framework/Validator/Factory.php +++ b/lib/internal/Magento/Framework/Validator/Factory.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Validator; use Magento\Framework\Cache\FrontendInterface; @@ -109,7 +107,7 @@ public function getValidatorConfig() { $this->_initializeConfigList(); $this->_initializeDefaultTranslator(); - return $this->_objectManager->create( + return $this->_objectManager->create( \Magento\Framework\Validator\Config::class, ['configFiles' => $this->_configFiles]); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/NotationResolver/ModuleTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/NotationResolver/ModuleTest.php index 0ba45a729d916..9908b3806bfb7 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/NotationResolver/ModuleTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/NotationResolver/ModuleTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\Asset\NotationResolver; class ModuleTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/SourceTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/SourceTest.php index 2a704650aa9dd..0b565a96d3c65 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/SourceTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/SourceTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\Asset; use Magento\Framework\App\Filesystem\DirectoryList; diff --git a/lib/internal/Magento/Framework/View/Test/Unit/BlockPoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/BlockPoolTest.php index b93e9b7a0e045..9f058d325c6a7 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/BlockPoolTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/BlockPoolTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit; use \Magento\Framework\View\BlockPool; diff --git a/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php index ca74870a715ab..1ed3d501dc1af 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit; use \Magento\Framework\View\DataSourcePool; diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/AlternativeTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/AlternativeTest.php index 98946634477cb..1c2b51bc71fcc 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/AlternativeTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/AlternativeTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\Design\FileResolution\Fallback\Resolver; use \Magento\Framework\View\Design\FileResolution\Fallback\Resolver\Alternative; @@ -58,8 +56,11 @@ protected function setUp() */ public function testConstructorException(array $alternativeExtensions) { - $this->setExpectedException('\InvalidArgumentException', "\$alternativeExtensions must be an array with format:" - . " array('ext1' => array('ext1', 'ext2'), 'ext3' => array(...)]"); + $this->setExpectedException( + '\InvalidArgumentException', + "\$alternativeExtensions must be an array with format:" + . " array('ext1' => array('ext1', 'ext2'), 'ext3' => array(...)]" + ); $readFactory = $this->getMock(\Magento\Framework\Filesystem\Directory\ReadFactory::class, [], [], '', false); $rulePool = $this->getMock(\Magento\Framework\View\Design\Fallback\RulePool::class, [], [], '', false); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ImageTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ImageTest.php index 82bd042feb93e..bcb9144adf2b8 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ImageTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ImageTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Test theme image model */ diff --git a/lib/internal/Magento/Framework/View/Test/Unit/DesignLoaderTest.php b/lib/internal/Magento/Framework/View/Test/Unit/DesignLoaderTest.php index 58331e32deda4..7662eb9eca50f 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/DesignLoaderTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/DesignLoaderTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit; class DesignLoaderTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php index 68cb485f571dd..431ca76fc8f15 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\Element; use Magento\Framework\View\Element\AbstractBlock; diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php index 38e585cce7928..aa2b32ec36c7f 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\File\Collector\Decorator; class ModuleDependencyTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleOutputTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleOutputTest.php index 83be2ee7ac10e..713ad13660b9c 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleOutputTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleOutputTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\File\Collector\Decorator; class ModuleOutputTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/FileListTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/FileListTest.php index 7cf14156d5656..4a251d7c55b1e 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/FileListTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/FileListTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\File; class FileListTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php b/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php index 7ab094d7b3f3f..09694d11298d6 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Test for view filesystem model */ @@ -50,23 +48,23 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_fileResolution = $this->getMock( + $this->_fileResolution = $this->getMock( \Magento\Framework\View\Design\FileResolution\Fallback\File::class, [], [], '', false ); - $this->_templateFileResolution = $this->getMock( + $this->_templateFileResolution = $this->getMock( \Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile::class, [], [], '', false ); - $this->_localeFileResolution = $this->getMock( + $this->_localeFileResolution = $this->getMock( \Magento\Framework\View\Design\FileResolution\Fallback\LocaleFile::class, [], [], '', false ); - $this->_staticFileResolution = $this->getMock( + $this->_staticFileResolution = $this->getMock( \Magento\Framework\View\Design\FileResolution\Fallback\StaticFile::class, [], [], '', false ); - $this->_emailTemplateFileResolution = $this->getMock( + $this->_emailTemplateFileResolution = $this->getMock( \Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile::class, [], [], '', false ); - $this->_assetRepo = $this->getMock( + $this->_assetRepo = $this->getMock( \Magento\Framework\View\Asset\Repository::class, ['extractScope', 'updateDesignParams', 'createAsset'], [], '', false ); @@ -85,7 +83,7 @@ public function testGetFilename() { $params = [ 'area' => 'some_area', - 'themeModel' => $this->getMock( + 'themeModel' => $this->getMock( \Magento\Framework\View\Design\ThemeInterface::class, [], [], '', false, false ), 'module' => 'Some_Module', //It should be set in \Magento\Framework\View\Asset\Repository::extractScope @@ -112,7 +110,7 @@ public function testGetTemplateFileName() { $params = [ 'area' => 'some_area', - 'themeModel' => $this->getMock( + 'themeModel' => $this->getMock( \Magento\Framework\View\Design\ThemeInterface::class, [], [], '', false, false ), 'module' => 'Some_Module', //It should be set in \Magento\Framework\View\Asset\Repository::extractScope @@ -139,7 +137,7 @@ public function testGetLocaleFileName() { $params = [ 'area' => 'some_area', - 'themeModel' => $this->getMock( + 'themeModel' => $this->getMock( \Magento\Framework\View\Design\ThemeInterface::class, [], [], @@ -165,7 +163,7 @@ public function testGetViewFile() { $params = [ 'area' => 'some_area', - 'themeModel' => $this->getMock( + 'themeModel' => $this->getMock( \Magento\Framework\View\Design\ThemeInterface::class, [], [], @@ -263,7 +261,7 @@ public function testGetEmailTemplateFile() $locale = \Magento\Setup\Module\I18n\Locale::DEFAULT_SYSTEM_LOCALE; $params = [ 'area' => 'some_area', - 'themeModel' => $this->getMock( + 'themeModel' => $this->getMock( \Magento\Framework\View\Design\ThemeInterface::class, [], [], '', false, false ), 'module' => 'Some_Module', diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/MoveTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/MoveTest.php index 34d8be322935b..04308256a00f5 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/MoveTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/MoveTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\Layout\Reader; use Magento\Framework\View\Layout\ScheduledStructure; diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/XsdTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/XsdTest.php index 224727d9953c0..beccf1994bed8 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/XsdTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/XsdTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\Layout; class XsdTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Result/LayoutTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Result/LayoutTest.php index ab97670dd6105..c382f8f54cdf8 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Result/LayoutTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Result/LayoutTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\View\Test\Unit\Result; /** @@ -52,7 +50,7 @@ protected function setUp() $context->expects($this->any())->method('getEventManager')->will($this->returnValue($this->eventManager)); $this->resultLayout = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject( + ->getObject( \Magento\Framework\View\Result\Layout::class, ['context' => $context, 'translateInline' => $this->translateInline] ); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/TemplateEngine/_files/simple.phtml b/lib/internal/Magento/Framework/View/Test/Unit/TemplateEngine/_files/simple.phtml index 246ec95b2280e..7395ac755ef91 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/TemplateEngine/_files/simple.phtml +++ b/lib/internal/Magento/Framework/View/Test/Unit/TemplateEngine/_files/simple.phtml @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - ?> testMethod(); diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php index 0ebb6d9be4f3d..b52f1cc849b4a 100644 --- a/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php +++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Webapi\Test\Unit; use Magento\Framework\Webapi\ServiceInputProcessor; From 24e674364ea19b12c2fea40666c5713fc3827978 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Mon, 24 Oct 2016 21:57:26 +0200 Subject: [PATCH 02/92] - Ran phpcbf over all files in order to automatically fix coding standards --- .../Framework/Api/DataObjectHelper.php | 2 +- .../Api/ExtensibleDataObjectConverter.php | 4 +- .../CollectionProcessor/JoinProcessor.php | 1 - .../Magento/Framework/Api/SortOrder.php | 2 +- .../Framework/Api/SortOrderBuilder.php | 1 - .../Api/Test/Unit/Api/ImageProcessorTest.php | 3 +- .../Generator/GenerateSearchResultsTest.php | 1 - .../Api/Test/Unit/DataObjectHelperTest.php | 9 ++- .../Magento/Framework/Api/Uploader.php | 1 - .../Framework/App/DeploymentConfig/Writer.php | 1 - .../Framework/App/Response/HttpInterface.php | 12 ++-- .../Magento/Framework/App/SetupInfo.php | 2 +- .../App/Test/Unit/Action/ActionTest.php | 3 +- .../Framework/App/Test/Unit/AreaListTest.php | 27 +++++--- .../Test/Unit/Cache/FlushCacheByTagsTest.php | 1 - .../Test/Unit/Cache/Frontend/FactoryTest.php | 1 - .../Unit/ObjectManager/ConfigLoaderTest.php | 3 +- .../Test/Unit/ObjectManager/FactoryStub.php | 1 - .../App/Test/Unit/Request/HttpTest.php | 2 +- .../App/Test/Unit/Response/HttpTest.php | 6 +- .../App/Test/Unit/StaticResourceTest.php | 6 +- .../Magento/Framework/App/Utility/Classes.php | 9 ++- .../Magento/Framework/Archive/Helper/File.php | 4 +- .../Framework/Archive/Helper/File/Gz.php | 4 +- .../Test/Unit/ClassLoaderWrapperTest.php | 3 +- .../Magento/Framework/Backup/Filesystem.php | 4 +- .../Magento/Framework/Backup/Media.php | 1 - .../Framework/Cache/Backend/Database.php | 2 +- .../Magento/Framework/Code/GeneratedFiles.php | 1 - .../Magento/Framework/Code/Generator.php | 4 +- .../Code/Generator/EntityAbstract.php | 7 +-- .../Code/Test/Unit/Generator/IoTest.php | 2 +- .../ConstructorArgumentTypesTest.php | 2 - .../SomeModule/Model/SevenInterface.php | 4 +- .../Config/Reader/EnvReader/Validator.php | 3 +- .../Config/Reader/XmlReader/Converter.php | 4 +- .../Framework/Composer/BufferIoFactory.php | 2 +- .../Framework/Config/ConverterInterface.php | 1 - .../Framework/Config/Dom/UrnResolver.php | 2 +- .../Framework/Config/Test/Unit/DataTest.php | 4 +- .../DB/Test/Unit/Adapter/Pdo/MysqlTest.php | 5 +- .../DB/Test/Unit/ExpressionConverterTest.php | 1 - .../Framework/Data/AbstractSearchResult.php | 1 - .../Framework/Data/Form/Element/Gallery.php | 2 +- .../Framework/Data/Form/Element/Radios.php | 1 - .../Data/Test/Unit/Collection/DbTest.php | 24 +++++-- .../Unit/Form/Element/AbstractElementTest.php | 53 +++++++++++++--- .../Magento/Framework/DataObject/Copy.php | 4 +- .../EntityManager/CallbackHandler.php | 1 - .../Framework/EntityManager/MetadataPool.php | 1 - .../Event/Invoker/InvokerDefault.php | 3 +- .../Framework/Filesystem/Directory/Read.php | 1 - .../Test/Unit/File/ExcludeFilterTest.php | 2 +- .../Magento/Framework/Filter/Template.php | 6 +- .../Framework/HTTP/PhpEnvironment/Request.php | 3 +- .../HTTP/PhpEnvironment/Response.php | 2 +- .../HTTP/Test/Unit/Adapter/CurlTest.php | 1 - .../Magento/Framework/Image/Factory.php | 4 +- .../ObjectManager/Config/Compiled.php | 2 +- .../ItemPlugin/ExtraParameters.php | 4 +- .../ItemPlugin/IncompatibleArgumentsCount.php | 4 +- .../Framework/Locale/TranslatedLists.php | 8 +-- .../Model/AbstractExtensibleModel.php | 2 +- .../Db/Collection/AbstractCollection.php | 4 +- .../ResourceModel/Db/CreateEntityRow.php | 1 - .../ResourceModel/Db/UpdateEntityRow.php | 1 - .../Model/Test/Unit/AbstractModelTest.php | 2 - .../Unit/ResourceModel/Db/AbstractDbTest.php | 16 +++-- .../Framework/Module/DependencyChecker.php | 2 +- .../Magento/Framework/Module/Status.php | 2 +- .../Mview/Test/Unit/Config/Data/ProxyTest.php | 18 ++++-- .../Framework/Mview/Test/Unit/ConfigTest.php | 6 +- .../Mview/Test/Unit/View/CollectionTest.php | 14 ++++- .../Unit/View/SubscriptionFactoryTest.php | 5 +- .../Mview/Test/Unit/View/SubscriptionTest.php | 63 ++++++++++++++++--- .../Test/Unit/Renderer/CompositeTest.php | 28 ++++----- .../Pricing/Test/Unit/Price/Stub.php | 3 +- .../Pricing/Test/Unit/Render/PriceBoxTest.php | 2 +- .../Adapter/Mysql/Field/FieldFactory.php | 1 - .../Adapter/Mysql/Field/FieldInterface.php | 1 - .../Adapter/Mysql/Query/MatchContainer.php | 1 - .../_files/mock_session_regenerate_id.php | 2 +- .../Framework/Setup/SampleData/State.php | 1 - .../Test/Unit/Cookie/CookieScopeTest.php | 3 +- .../Test/Unit/Cookie/PhpCookieManagerTest.php | 2 +- .../Unit/DateTime/DateTimeFormatterTest.php | 1 - .../Test/Unit/App/ResourceConnectionTest.php | 1 - .../Test/Unit/Message/PhraseFactoryTest.php | 1 - .../Magento/Framework/Test/Unit/UrlTest.php | 3 +- .../ExtensionGeneratorAutoloader.php | 2 +- lib/internal/Magento/Framework/Url.php | 2 +- .../Magento/Framework/Validator/Factory.php | 4 +- .../Framework/View/Asset/LockerProcess.php | 1 - .../Framework/View/Asset/Minification.php | 6 +- .../View/Asset/PreProcessor/Chain.php | 1 - .../View/Asset/PreProcessor/Minify.php | 3 +- .../Message/MessageConfigurationsPool.php | 6 +- .../Element/UiComponent/Config/DomMerger.php | 2 +- .../View/Element/UiComponent/Context.php | 4 +- .../Magento/Framework/View/Layout.php | 1 - .../Framework/View/Layout/GeneratorPool.php | 4 +- .../Framework/View/Page/Config/Renderer.php | 2 +- .../Framework/View/Page/Config/Structure.php | 1 - .../View/TemplateEngine/Xhtml/Compiler.php | 2 +- .../Framework/View/TemplateEnginePool.php | 1 - .../View/Test/Unit/Asset/MinificationTest.php | 1 - .../Asset/NotationResolver/ModuleTest.php | 5 +- .../View/Test/Unit/Asset/SourceTest.php | 15 ++++- .../View/Test/Unit/DataSourcePoolTest.php | 6 +- .../View/Test/Unit/Design/Theme/ImageTest.php | 12 +++- .../Decorator/ModuleDependencyTest.php | 3 +- .../Collector/Decorator/ModuleOutputTest.php | 3 +- .../View/Test/Unit/File/FileListTest.php | 4 +- .../View/Test/Unit/FileSystemTest.php | 61 ++++++++++++++---- .../Test/Unit/Layout/Generator/BlockTest.php | 3 +- .../View/Test/Unit/Result/LayoutTest.php | 7 ++- .../View/Test/Unit/Url/_files/result.css | 1 + .../Test/Unit/Url/_files/resultImport.css | 1 + .../Test/Unit/Url/_files/resultNormalized.css | 1 + .../View/Test/Unit/Url/_files/source.css | 1 + .../Test/Unit/Url/_files/sourceImport.css | 1 + .../Framework/Webapi/ErrorProcessor.php | 3 +- .../Magento/Framework/Webapi/Rest/Request.php | 1 - .../Rest/Request/ParamOverriderInterface.php | 2 +- .../Webapi/ServiceInputProcessor.php | 4 +- .../Test/Unit/ServiceInputProcessorTest.php | 5 +- 126 files changed, 411 insertions(+), 242 deletions(-) diff --git a/lib/internal/Magento/Framework/Api/DataObjectHelper.php b/lib/internal/Magento/Framework/Api/DataObjectHelper.php index 68f332fe6a9d7..6139338996529 100644 --- a/lib/internal/Magento/Framework/Api/DataObjectHelper.php +++ b/lib/internal/Magento/Framework/Api/DataObjectHelper.php @@ -176,7 +176,7 @@ protected function setComplexValue( if (is_subclass_of($returnType, \Magento\Framework\Api\ExtensibleDataInterface::class)) { $object = $this->objectFactory->create($returnType, []); $this->populateWithArray($object, $value, $returnType); - } else if (is_subclass_of($returnType, \Magento\Framework\Api\ExtensionAttributesInterface::class)) { + } elseif (is_subclass_of($returnType, \Magento\Framework\Api\ExtensionAttributesInterface::class)) { foreach ($value as $extensionAttributeKey => $extensionAttributeValue) { $extensionAttributeGetterMethodName = 'get' . \Magento\Framework\Api\SimpleDataObjectConverter::snakeCaseToUpperCamelCase( diff --git a/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php b/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php index 7c675174aafe0..7ec9ed5706503 100644 --- a/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php +++ b/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php @@ -48,7 +48,7 @@ public function toNestedArray( if (!empty($dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY])) { /** @var AttributeValue[] $customAttributes */ $customAttributes = $dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY]; - unset ($dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY]); + unset($dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY]); foreach ($customAttributes as $attributeValue) { if (!in_array($attributeValue[AttributeValue::ATTRIBUTE_CODE], $skipAttributes)) { $dataObjectArray[$attributeValue[AttributeValue::ATTRIBUTE_CODE]] @@ -59,7 +59,7 @@ public function toNestedArray( if (!empty($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY])) { /** @var array $extensionAttributes */ $extensionAttributes = $dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]; - unset ($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]); + unset($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]); foreach ($extensionAttributes as $attributeKey => $attributeValue) { if (!in_array($attributeKey, $skipAttributes)) { $dataObjectArray[$attributeKey] = $attributeValue; diff --git a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php index 7cf9020f17278..481c5407e46b5 100644 --- a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php +++ b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\Api\SearchCriteria\CollectionProcessor; - use Magento\Framework\Api\SearchCriteria\CollectionProcessor\JoinProcessor\CustomJoinInterface; use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface; use Magento\Framework\Api\SearchCriteriaInterface; diff --git a/lib/internal/Magento/Framework/Api/SortOrder.php b/lib/internal/Magento/Framework/Api/SortOrder.php index ed799cad67719..f9eb2cc63e94a 100644 --- a/lib/internal/Magento/Framework/Api/SortOrder.php +++ b/lib/internal/Magento/Framework/Api/SortOrder.php @@ -78,7 +78,7 @@ public function setDirection($direction) /** * Validate direction argument ASC or DESC - * + * * @param mixed $direction * @return null * @throws InputException diff --git a/lib/internal/Magento/Framework/Api/SortOrderBuilder.php b/lib/internal/Magento/Framework/Api/SortOrderBuilder.php index c90e5a68bd165..22314d54b1203 100644 --- a/lib/internal/Magento/Framework/Api/SortOrderBuilder.php +++ b/lib/internal/Magento/Framework/Api/SortOrderBuilder.php @@ -6,7 +6,6 @@ namespace Magento\Framework\Api; - /** * Builder for sort order data object. * @method SortOrder create() diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php index 6bab696f580f4..4d707f25b856e 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Api/ImageProcessorTest.php @@ -65,7 +65,8 @@ protected function setUp() ->method('getDirectoryWrite') ->willReturn($this->directoryWriteMock); $this->contentValidatorMock = $this->getMockBuilder( - \Magento\Framework\Api\ImageContentValidatorInterface::class) + \Magento\Framework\Api\ImageContentValidatorInterface::class + ) ->disableOriginalConstructor() ->getMock(); $this->dataObjectHelperMock = $this->getMockBuilder(\Magento\Framework\Api\DataObjectHelper::class) diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php index 18d5195a46c6b..5de6b6494f38d 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/Code/Generator/GenerateSearchResultsTest.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\Api\Test\Unit\Code\Generator; - /** * Class SearchResultTest */ diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php index 9fa851f69e355..6d1ca38d72e70 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php @@ -142,7 +142,8 @@ public function testPopulateWithArrayWithSimpleAttributes() $this->dataObjectHelper->populateWithArray( $addressDataObject, - $data, \Magento\Customer\Api\Data\AddressInterface::class + $data, + \Magento\Customer\Api\Data\AddressInterface::class ); $this->assertEquals($id, $addressDataObject->getId()); @@ -196,7 +197,8 @@ public function testPopulateWithArrayWithCustomAttribute() ->willReturn($customAttribute); $this->dataObjectHelper->populateWithArray( $addressDataObject, - $data, \Magento\Customer\Api\Data\AddressInterface::class + $data, + \Magento\Customer\Api\Data\AddressInterface::class ); $this->assertEquals($id, $addressDataObject->getId()); @@ -258,7 +260,8 @@ public function testPopulateWithArrayWithCustomAttributes() ->willReturn($customAttribute); $this->dataObjectHelper->populateWithArray( $addressDataObject, - $data, \Magento\Customer\Api\Data\AddressInterface::class + $data, + \Magento\Customer\Api\Data\AddressInterface::class ); $this->assertEquals($id, $addressDataObject->getId()); diff --git a/lib/internal/Magento/Framework/Api/Uploader.php b/lib/internal/Magento/Framework/Api/Uploader.php index cd8912a470109..4f3a39c8c79c9 100644 --- a/lib/internal/Magento/Framework/Api/Uploader.php +++ b/lib/internal/Magento/Framework/Api/Uploader.php @@ -17,7 +17,6 @@ class Uploader extends \Magento\Framework\File\Uploader */ public function __construct() { - } /** diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php index ac1e5f6ecf897..c8457aadfc4c6 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php @@ -101,7 +101,6 @@ public function saveConfig(array $data, $override = false) foreach ($data as $fileKey => $config) { if (isset($paths[$fileKey])) { - if ($this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->isExist($paths[$fileKey])) { $currentData = $this->reader->load($fileKey); if ($override) { diff --git a/lib/internal/Magento/Framework/App/Response/HttpInterface.php b/lib/internal/Magento/Framework/App/Response/HttpInterface.php index a0b04b34a47f4..978ae4684e025 100644 --- a/lib/internal/Magento/Framework/App/Response/HttpInterface.php +++ b/lib/internal/Magento/Framework/App/Response/HttpInterface.php @@ -38,7 +38,7 @@ public function setHeader($name, $value, $replace = false); /** * Get header value by name - * + * * Returns first found header by passed name. * If header with specified name was not found returns false. * @@ -57,14 +57,14 @@ public function clearHeader($name); /** * Allow granular setting of HTTP response status code, version and phrase - * + * * For example, a HTTP response as the following: * HTTP 200 1.1 Your response has been served * Can be set with the arguments * $httpCode = 200 * $version = 1.1 * $phrase = 'Your response has been served' - * + * * @param int|string $httpCode * @param null|int|string $version * @param null|string $phrase @@ -74,7 +74,7 @@ public function setStatusHeader($httpCode, $version = null, $phrase = null); /** * Append the given string to the response body - * + * * @param string $value * @return self */ @@ -82,9 +82,9 @@ public function appendBody($value); /** * Set the response body to the given value - * + * * Any previously set contents will be replaced by the new content. - * + * * @param string $value * @return self */ diff --git a/lib/internal/Magento/Framework/App/SetupInfo.php b/lib/internal/Magento/Framework/App/SetupInfo.php index b52daaac333e8..89c93b07ea0d5 100644 --- a/lib/internal/Magento/Framework/App/SetupInfo.php +++ b/lib/internal/Magento/Framework/App/SetupInfo.php @@ -111,7 +111,7 @@ public function getProjectUrl() $isProjectInDocRoot = false !== strpos($this->projectRoot . '/', $this->docRoot . '/'); if (empty($this->server['HTTP_HOST'])) { return ''; - } else if (!$isProjectInDocRoot) { + } elseif (!$isProjectInDocRoot) { return 'http://' . $this->server['HTTP_HOST'] . '/'; } return 'http://' . $this->server['HTTP_HOST'] . substr($this->projectRoot . '/', strlen($this->docRoot)); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php index f42a4e4e353a6..5d97cd31b40ef 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php @@ -195,7 +195,8 @@ public function execute() ActionTest::ACTION_NAME, ActionTest::CONTROLLER_NAME, ActionTest::MODULE_NAME, - ActionTest::$actionParams); + ActionTest::$actionParams + ); $this->_redirect(ActionTest::FULL_ACTION_NAME, ActionTest::$actionParams); return; } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/AreaListTest.php b/lib/internal/Magento/Framework/App/Test/Unit/AreaListTest.php index 56a4518f100a7..b10a553959de2 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/AreaListTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/AreaListTest.php @@ -46,12 +46,12 @@ public function testGetCodeByFrontNameWhenAreaDoesNotContainFrontName() $this->_resolverFactory->expects( $this->any() )->method( - 'create' - )->with( - 'testValue' - )->will( - $this->returnValue($resolverMock) - ); + 'create' + )->with( + 'testValue' + )->will( + $this->returnValue($resolverMock) + ); $actual = $this->_model->getCodeByFrontName('testFrontName'); $this->assertEquals($expected, $actual); @@ -104,7 +104,10 @@ public function testGetCodes() { $areas = ['area1' => 'value1', 'area2' => 'value2']; $this->_model = new \Magento\Framework\App\AreaList( - $this->objectManagerMock, $this->_resolverFactory, $areas, '' + $this->objectManagerMock, + $this->_resolverFactory, + $areas, + '' ); $expected = array_keys($areas); @@ -116,7 +119,10 @@ public function testGetDefaultRouter() { $areas = ['area1' => ['router' => 'value1'], 'area2' => 'value2']; $this->_model = new \Magento\Framework\App\AreaList( - $this->objectManagerMock, $this->_resolverFactory, $areas, '' + $this->objectManagerMock, + $this->_resolverFactory, + $areas, + '' ); $this->assertEquals($this->_model->getDefaultRouter('area1'), $areas['area1']['router']); @@ -129,7 +135,10 @@ public function testGetArea() $objectManagerMock = $this->getObjectManagerMockGetArea(); $areas = ['area1' => ['router' => 'value1'], 'area2' => 'value2']; $this->_model = new AreaList( - $objectManagerMock, $this->_resolverFactory, $areas, '' + $objectManagerMock, + $this->_resolverFactory, + $areas, + '' ); $this->assertEquals($this->_model->getArea('testArea'), 'ok'); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Cache/FlushCacheByTagsTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Cache/FlushCacheByTagsTest.php index afc745f33c5a9..efb48fc4bd692 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Cache/FlushCacheByTagsTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Cache/FlushCacheByTagsTest.php @@ -40,7 +40,6 @@ protected function setUp() ['test'], $this->tagResolver ); - } public function testAroundSave() diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Cache/Frontend/FactoryTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Cache/Frontend/FactoryTest.php index 77a0d7e664e91..96b3c048999dd 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Cache/Frontend/FactoryTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Cache/Frontend/FactoryTest.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\App\Test\Unit\Cache\Frontend; - class FactoryTest extends \PHPUnit_Framework_TestCase { public static function setUpBeforeClass() diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/ConfigLoaderTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/ConfigLoaderTest.php index 7fb25813b5867..94fa0393e0b30 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/ConfigLoaderTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/ConfigLoaderTest.php @@ -56,7 +56,8 @@ protected function setUp() $this->_cacheMock = $this->getMock(\Magento\Framework\App\Cache\Type\Config::class, [], [], '', false); $this->_model = new \Magento\Framework\App\ObjectManager\ConfigLoader( - $this->_cacheMock, $this->_readerFactoryMock + $this->_cacheMock, + $this->_readerFactoryMock ); } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/FactoryStub.php b/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/FactoryStub.php index 808d7fbaa6deb..7c0d181a32385 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/FactoryStub.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ObjectManager/FactoryStub.php @@ -47,6 +47,5 @@ public function create($requestedType, array $arguments = []) */ public function setObjectManager(ObjectManagerInterface $objectManager) { - } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index 94e389178f85d..0d407c3f0f55b 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -97,7 +97,7 @@ private function getModel($uri = null, $appConfigMock = true) ); if ($appConfigMock) { - $configMock = $this->getMock(\Magento\Framework\App\Config::class, [], [], '' , false); + $configMock = $this->getMock(\Magento\Framework\App\Config::class, [], [], '', false); $this->objectManager->setBackwardCompatibleProperty($model, 'appConfig', $configMock); } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php index 8955fa5e2e6ea..77aa77b011e9c 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Response/HttpTest.php @@ -51,7 +51,8 @@ protected function setUp() )->disableOriginalConstructor()->getMock(); $this->cookieManagerMock = $this->getMock(\Magento\Framework\Stdlib\CookieManagerInterface::class); $this->contextMock = $this->getMockBuilder( - \Magento\Framework\App\Http\Context::class)->disableOriginalConstructor() + \Magento\Framework\App\Http\Context::class + )->disableOriginalConstructor() ->getMock(); $this->dateTimeMock = $this->getMockBuilder(\Magento\Framework\Stdlib\DateTime::class) @@ -86,7 +87,8 @@ public function testSendVary() $expectedCookieName = Http::COOKIE_VARY_STRING; $expectedCookieValue = sha1(serialize($data)); $sensitiveCookieMetadataMock = $this->getMockBuilder( - \Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata::class) + \Magento\Framework\Stdlib\Cookie\SensitiveCookieMetadata::class + ) ->disableOriginalConstructor() ->getMock(); $sensitiveCookieMetadataMock->expects($this->once()) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php index ace2f28c089c7..67a9baafaf0cf 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php @@ -75,7 +75,11 @@ protected function setUp() $this->objectManager = $this->getMockForAbstractClass(\Magento\Framework\ObjectManagerInterface::class); $this->logger = $this->getMockForAbstractClass(\Psr\Log\LoggerInterface::class); $this->configLoader = $this->getMock( - \Magento\Framework\App\ObjectManager\ConfigLoader::class, [], [], '', false + \Magento\Framework\App\ObjectManager\ConfigLoader::class, + [], + [], + '', + false ); $this->object = new \Magento\Framework\App\StaticResource( $this->state, diff --git a/lib/internal/Magento/Framework/App/Utility/Classes.php b/lib/internal/Magento/Framework/App/Utility/Classes.php index 5deac4a06e556..97afaba69a506 100644 --- a/lib/internal/Magento/Framework/App/Utility/Classes.php +++ b/lib/internal/Magento/Framework/App/Utility/Classes.php @@ -271,11 +271,10 @@ public static function resolveVirtualType($className) */ public static function isAutogenerated($className) { - if ( - preg_match( - '/.*\\\\[a-zA-Z0-9]{1,}(Factory|SearchResults|DataBuilder|Extension|ExtensionInterface)$/', - $className - ) + if (preg_match( + '/.*\\\\[a-zA-Z0-9]{1,}(Factory|SearchResults|DataBuilder|Extension|ExtensionInterface)$/', + $className + ) || preg_match('/Magento\\\\[\w]+\\\\(Test\\\\(Page|Fixture))\\\\/', $className) || preg_match('/.*\\\\[a-zA-Z0-9]{1,}\\\\Proxy$/', $className) ) { diff --git a/lib/internal/Magento/Framework/Archive/Helper/File.php b/lib/internal/Magento/Framework/Archive/Helper/File.php index ec39bb38d40fc..7882f315e7c94 100644 --- a/lib/internal/Magento/Framework/Archive/Helper/File.php +++ b/lib/internal/Magento/Framework/Archive/Helper/File.php @@ -5,8 +5,8 @@ */ /** -* Helper class that simplifies files stream reading and writing -*/ + * Helper class that simplifies files stream reading and writing + */ namespace Magento\Framework\Archive\Helper; use Magento\Framework\Exception\LocalizedException; diff --git a/lib/internal/Magento/Framework/Archive/Helper/File/Gz.php b/lib/internal/Magento/Framework/Archive/Helper/File/Gz.php index 3d2d1e73061c2..0e779410bb302 100644 --- a/lib/internal/Magento/Framework/Archive/Helper/File/Gz.php +++ b/lib/internal/Magento/Framework/Archive/Helper/File/Gz.php @@ -5,8 +5,8 @@ */ /** -* Helper class that simplifies gz files stream reading and writing -*/ + * Helper class that simplifies gz files stream reading and writing + */ namespace Magento\Framework\Archive\Helper\File; class Gz extends \Magento\Framework\Archive\Helper\File diff --git a/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php b/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php index 3ebb08f4b0988..e93ac77283c31 100644 --- a/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php +++ b/lib/internal/Magento/Framework/Autoload/Test/Unit/ClassLoaderWrapperTest.php @@ -30,7 +30,8 @@ class ClassLoaderWrapperTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->autoloaderMock = $this->getMock(\Composer\Autoload\ClassLoader::class); - $this->model = (new ObjectManager($this))->getObject(\Magento\Framework\Autoload\ClassLoaderWrapper::class, + $this->model = (new ObjectManager($this))->getObject( + \Magento\Framework\Autoload\ClassLoaderWrapper::class, [ 'autoloader' => $this->autoloaderMock ] diff --git a/lib/internal/Magento/Framework/Backup/Filesystem.php b/lib/internal/Magento/Framework/Backup/Filesystem.php index 309a22426bb92..6576cf5bcc03c 100644 --- a/lib/internal/Magento/Framework/Backup/Filesystem.php +++ b/lib/internal/Magento/Framework/Backup/Filesystem.php @@ -160,8 +160,8 @@ public function validateAvailableDiscSpace($backupDir, $size) if ($requiredSpace > $freeSpace) { throw new \Magento\Framework\Backup\Exception\NotEnoughFreeSpace( new \Magento\Framework\Phrase( - 'Warning: necessary space for backup is ' . (ceil($requiredSpace) / 1024) - . 'MB, but your free disc space is ' . (ceil($freeSpace) / 1024) . 'MB.' + 'Warning: necessary space for backup is ' . (ceil($requiredSpace) / 1024) + . 'MB, but your free disc space is ' . (ceil($freeSpace) / 1024) . 'MB.' ) ); } diff --git a/lib/internal/Magento/Framework/Backup/Media.php b/lib/internal/Magento/Framework/Backup/Media.php index c53f035408377..2240ceb664822 100644 --- a/lib/internal/Magento/Framework/Backup/Media.php +++ b/lib/internal/Magento/Framework/Backup/Media.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\Backup; - /** * Class to work media folder and database backups * diff --git a/lib/internal/Magento/Framework/Cache/Backend/Database.php b/lib/internal/Magento/Framework/Cache/Backend/Database.php index 3da59b78fdef9..494b9f69c253e 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/Database.php +++ b/lib/internal/Magento/Framework/Cache/Backend/Database.php @@ -24,7 +24,7 @@ KEY `IDX_CACHE_ID` (`cache_id`), CONSTRAINT `FK_CORE_CACHE_TAG` FOREIGN KEY (`cache_id`) REFERENCES `cache` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -*/ + */ /** * Database cache backend diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index 75d5ff4b4b73b..933c39f9359be 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -64,7 +64,6 @@ public function regenerate() public function cleanGeneratedFiles() { if ($this->write->isExist(self::REGENERATE_FLAG)) { - $enabledCacheTypes = []; //TODO: to be removed in scope of MAGETWO-53476 diff --git a/lib/internal/Magento/Framework/Code/Generator.php b/lib/internal/Magento/Framework/Code/Generator.php index 40f9ac671d765..742b517b25c1f 100644 --- a/lib/internal/Magento/Framework/Code/Generator.php +++ b/lib/internal/Magento/Framework/Code/Generator.php @@ -199,7 +199,7 @@ protected function shouldSkipGeneration($resultEntityType, $sourceClassName, $re { if (!$resultEntityType || !$sourceClassName) { return self::GENERATION_ERROR; - } else if ($this->definedClasses->isClassLoadableFromDisc($resultClass)) { + } elseif ($this->definedClasses->isClassLoadableFromDisc($resultClass)) { $generatedFileName = $this->_ioObject->generateResultFileName($resultClass); /** * Must handle two edge cases: a competing process has generated the class and written it to disc already, @@ -211,7 +211,7 @@ protected function shouldSkipGeneration($resultEntityType, $sourceClassName, $re $this->_ioObject->includeFile($generatedFileName); } return self::GENERATION_SKIP; - } else if (!isset($this->_generatedEntities[$resultEntityType])) { + } elseif (!isset($this->_generatedEntities[$resultEntityType])) { throw new \InvalidArgumentException('Unknown generation entity.'); } return false; diff --git a/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php b/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php index 9e5dff03a919f..ee143d40f49e9 100644 --- a/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php +++ b/lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php @@ -252,12 +252,7 @@ protected function _validateData() if (!$this->definedClasses->isClassLoadable($sourceClassName)) { $this->_addError('Source class ' . $sourceClassName . ' doesn\'t exist.'); return false; - } elseif ( - /** - * If makeResultFileDirectory only fails because the file is already created, - * a competing process has generated the file, no exception should be thrown. - */ - !$this->_ioObject->makeResultFileDirectory($resultClassName) + } elseif (!$this->_ioObject->makeResultFileDirectory($resultClassName) && !$this->_ioObject->fileExists($resultDir) ) { $this->_addError('Can\'t create directory ' . $resultDir . '.'); diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php index deb3175529d1b..7dcc920e8d03b 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Generator/IoTest.php @@ -93,7 +93,7 @@ public function testWriteResultFileAlreadyExists($resultFileName, $fileExists, $ if (!$exceptionDuringRename) { $renameMockEvent = $this->returnValue(true); - } else if ($fileExists) { + } elseif ($fileExists) { $renameMockEvent = $this->throwException(new FileSystemException(new Phrase('File already exists'))); } else { $exceptionMessage = 'Some error renaming file'; diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ConstructorArgumentTypesTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ConstructorArgumentTypesTest.php index fba2110b780ca..2476c3aa985b4 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ConstructorArgumentTypesTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ConstructorArgumentTypesTest.php @@ -72,5 +72,3 @@ public function testValidateWithException() $this->assertTrue($this->model->validate($className)); } } - - diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php index e5c30cd14aa95..f5668ce8153e1 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php @@ -27,7 +27,7 @@ interface SevenInterface extends \Magento\Framework\Code\Generator\CodeGenerator * @param array $data * @return TestThree */ - public static function testMethod1(array &$data = array()); + public static function testMethod1(array &$data = []); /** * Method short description @@ -41,6 +41,4 @@ public static function testMethod1(array &$data = array()); public function testMethod2($data = 'test_default', $flag = true); public function testMethod3(); - - } diff --git a/lib/internal/Magento/Framework/Communication/Config/Reader/EnvReader/Validator.php b/lib/internal/Magento/Framework/Communication/Config/Reader/EnvReader/Validator.php index 89275ac50886c..9aedbc14978da 100644 --- a/lib/internal/Magento/Framework/Communication/Config/Reader/EnvReader/Validator.php +++ b/lib/internal/Magento/Framework/Communication/Config/Reader/EnvReader/Validator.php @@ -178,8 +178,7 @@ private function validateTopicResponseHandler($configDataItem) ) ); } - if ( - $this->booleanUtils->toBoolean($configDataItem[ConfigInterface::TOPIC_IS_SYNCHRONOUS]) && + if ($this->booleanUtils->toBoolean($configDataItem[ConfigInterface::TOPIC_IS_SYNCHRONOUS]) && count($configDataItem[ConfigInterface::TOPIC_HANDLERS]) != 1 ) { throw new \LogicException( diff --git a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader/Converter.php b/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader/Converter.php index 0e2d25c09e783..affd1a13abde8 100644 --- a/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader/Converter.php +++ b/lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader/Converter.php @@ -133,7 +133,7 @@ protected function extractTopics($config) $serviceMethod[ConfigParser::METHOD_NAME], $handlers ); - } else if ($requestSchema && $responseSchema) { + } elseif ($requestSchema && $responseSchema) { $output[$topicName] = [ Config::TOPIC_NAME => $topicName, Config::TOPIC_IS_SYNCHRONOUS => true, @@ -142,7 +142,7 @@ protected function extractTopics($config) Config::TOPIC_RESPONSE => $responseSchema, Config::TOPIC_HANDLERS => $handlers ]; - } else if ($requestSchema) { + } elseif ($requestSchema) { $output[$topicName] = [ Config::TOPIC_NAME => $topicName, Config::TOPIC_IS_SYNCHRONOUS => false, diff --git a/lib/internal/Magento/Framework/Composer/BufferIoFactory.php b/lib/internal/Magento/Framework/Composer/BufferIoFactory.php index 6d080db55d0cc..2518f90bcbc73 100644 --- a/lib/internal/Magento/Framework/Composer/BufferIoFactory.php +++ b/lib/internal/Magento/Framework/Composer/BufferIoFactory.php @@ -15,7 +15,7 @@ class BufferIoFactory { /** * Creates BufferIO instance - * + * * @return BufferIO */ public function create() diff --git a/lib/internal/Magento/Framework/Config/ConverterInterface.php b/lib/internal/Magento/Framework/Config/ConverterInterface.php index 3ecc1ff70cf8c..287bcbc5635b3 100644 --- a/lib/internal/Magento/Framework/Config/ConverterInterface.php +++ b/lib/internal/Magento/Framework/Config/ConverterInterface.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\Config; - /** * Config DOM-to-array converter interface. * diff --git a/lib/internal/Magento/Framework/Config/Dom/UrnResolver.php b/lib/internal/Magento/Framework/Config/Dom/UrnResolver.php index 808154e95d171..a6679db5e3ce6 100644 --- a/lib/internal/Magento/Framework/Config/Dom/UrnResolver.php +++ b/lib/internal/Magento/Framework/Config/Dom/UrnResolver.php @@ -37,7 +37,7 @@ public function getRealPath($schema) //urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd $package = $componentRegistrar ->getPath(ComponentRegistrar::MODULE, $matches['module']); - } else if (preg_match($frameworkPattern, $schema, $matches)) { + } elseif (preg_match($frameworkPattern, $schema, $matches)) { //urn:magento:framework:Module/etc/module.xsd //urn:magento:framework-amqp:Module/etc/module.xsd $package = $componentRegistrar diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php index 16dce5df8bb23..e9ac12abed455 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php @@ -34,7 +34,9 @@ public function testGet() $this->reader->expects($this->once())->method('read')->will($this->returnValue($data)); $config = new \Magento\Framework\Config\Data( - $this->reader, $this->cache, $cacheid + $this->reader, + $this->cache, + $cacheid ); $this->assertEquals($data, $config->get()); $this->assertEquals('b', $config->get('a')); diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php index 281048686e822..d58fb082cf699 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php @@ -468,7 +468,10 @@ public function testAddColumn($options, $expectedQuery) { $connectionMock = $this->getMock( \Magento\Framework\DB\Adapter\Pdo\Mysql::class, - ['tableColumnExists', '_getTableName', 'rawQuery', 'resetDdlCache', 'quote'], [], '', false + ['tableColumnExists', '_getTableName', 'rawQuery', 'resetDdlCache', 'quote'], + [], + '', + false ); $connectionMock->expects($this->any())->method('_getTableName')->will($this->returnArgument(0)); diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/ExpressionConverterTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/ExpressionConverterTest.php index f8f94d8e49493..ffb9c64142ce6 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/ExpressionConverterTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/ExpressionConverterTest.php @@ -6,7 +6,6 @@ namespace Magento\Framework\DB\Test\Unit; - use Magento\Framework\DB\ExpressionConverter; class ExpressionConverterTest extends \PHPUnit_Framework_TestCase diff --git a/lib/internal/Magento/Framework/Data/AbstractSearchResult.php b/lib/internal/Magento/Framework/Data/AbstractSearchResult.php index 3323bf0315ee2..3fca8a6575a5e 100644 --- a/lib/internal/Magento/Framework/Data/AbstractSearchResult.php +++ b/lib/internal/Magento/Framework/Data/AbstractSearchResult.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\Data; - /** * Class AbstractSearchResult */ diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php b/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php index 5690c07b2f05b..2827f8273cf32 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php @@ -44,7 +44,7 @@ public function getElementHtml() $html .= ''; $widgetButton = $this->getForm()->getParent()->getLayout(); $buttonHtml = $widgetButton->createBlock( - \Magento\Backend\Block\Widget\Button::class + \Magento\Backend\Block\Widget\Button::class )->setData( ['label' => 'Add New Image', 'onclick' => 'addNewImg()', 'class' => 'add'] )->toHtml(); diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Radios.php b/lib/internal/Magento/Framework/Data/Form/Element/Radios.php index b35309ecf2ae0..c1e7ebb3356e0 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Radios.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Radios.php @@ -110,6 +110,5 @@ protected function getRadioButtonAttributes($option) } } return $html; - } } diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php index 60d14a11c052c..258433dab0e6c 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Collection/DbTest.php @@ -42,10 +42,18 @@ protected function setUp() { $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->fetchStrategyMock = $this->getMock( - \Magento\Framework\Data\Collection\Db\FetchStrategy\Query::class, ['fetchAll'], [], '', false + \Magento\Framework\Data\Collection\Db\FetchStrategy\Query::class, + ['fetchAll'], + [], + '', + false ); $this->entityFactoryMock = $this->getMock( - \Magento\Framework\Data\Collection\EntityFactory::class, ['create'], [], '', false + \Magento\Framework\Data\Collection\EntityFactory::class, + ['create'], + [], + '', + false ); $this->loggerMock = $this->getMock(\Psr\Log\LoggerInterface::class); $this->collection = new \Magento\Framework\Data\Test\Unit\Collection\DbCollection( @@ -373,7 +381,11 @@ public function testFetchItem() $adapterMock = $this->getMock( \Magento\Framework\DB\Adapter\Pdo\Mysql::class, - ['select', 'query'], [], '', false); + ['select', 'query'], + [], + '', + false + ); $selectMock = $this->getMock( \Magento\Framework\DB\Select::class, [], @@ -556,7 +568,11 @@ public function testToOptionHash() $data = [10 => 'test']; $adapterMock = $this->getMock( \Magento\Framework\DB\Adapter\Pdo\Mysql::class, - ['select', 'query'], [], '', false); + ['select', 'query'], + [], + '', + false + ); $selectMock = $this->getMock( \Magento\Framework\DB\Select::class, [], diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php index 8d826272ec261..bd68ac5c9ed35 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php @@ -34,19 +34,29 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_factoryMock = $this->getMock( - \Magento\Framework\Data\Form\Element\Factory::class, [], [], '', false + \Magento\Framework\Data\Form\Element\Factory::class, + [], + [], + '', + false ); $this->_collectionFactoryMock = $this->getMock( - \Magento\Framework\Data\Form\Element\CollectionFactory::class, [], [], '', false + \Magento\Framework\Data\Form\Element\CollectionFactory::class, + [], + [], + '', + false ); $this->_escaperMock = $this->getMock(\Magento\Framework\Escaper::class, [], [], '', false); $this->_model = $this->getMockForAbstractClass( - \Magento\Framework\Data\Form\Element\AbstractElement::class, [ + \Magento\Framework\Data\Form\Element\AbstractElement::class, + [ $this->_factoryMock, $this->_collectionFactoryMock, $this->_escaperMock - ]); + ] + ); } /** @@ -56,7 +66,13 @@ public function testAddElement() { $elementId = 11; $elementMock = $this->getMockForAbstractClass( - \Magento\Framework\Data\Form\Element\AbstractElement::class, [], '', false, true, true, ['getId'] + \Magento\Framework\Data\Form\Element\AbstractElement::class, + [], + '', + false, + true, + true, + ['getId'] ); $elementMock->expects($this->once()) ->method('getId') @@ -96,7 +112,11 @@ public function testGetHtmlId() $htmlId = 'some_id'; $formMock = $this->getMock( - \Magento\Framework\Data\Form\AbstractForm::class, ['getHtmlIdPrefix', 'getHtmlIdSuffix'], [], '', false + \Magento\Framework\Data\Form\AbstractForm::class, + ['getHtmlIdPrefix', 'getHtmlIdSuffix'], + [], + '', + false ); $formMock->expects($this->any()) ->method('getHtmlIdPrefix') @@ -166,14 +186,22 @@ public function testRemoveField() $elementId = 'element_id'; $formMock = $this->getMock( - \Magento\Framework\Data\Form\AbstractForm::class, ['removeField'], [], '', false + \Magento\Framework\Data\Form\AbstractForm::class, + ['removeField'], + [], + '', + false ); $formMock->expects($this->once()) ->method('removeField') ->with($elementId); $collectionMock = $this->getMock( - \Magento\Framework\Data\Form\Element\Collection::class, ['remove'], [], '', false + \Magento\Framework\Data\Form\Element\Collection::class, + ['remove'], + [], + '', + false ); $collectionMock->expects($this->once()) ->method('remove') @@ -248,7 +276,8 @@ public function testGetEscapedValueWithoutFilter() { $this->_model->setValue('my \'quoted\' string'); $this->assertEquals( - '<a href="#hash_tag">my \'quoted\' string</a>', $this->_model->getEscapedValue() + '<a href="#hash_tag">my \'quoted\' string</a>', + $this->_model->getEscapedValue() ); } @@ -405,7 +434,11 @@ public function testGetHtmlContainerIdWithFieldContainerIdPrefix() $id = 'id'; $prefix = 'prefix_'; $formMock = $this->getMock( - \Magento\Framework\Data\Form\AbstractForm::class, ['getFieldContainerIdPrefix'], [], '', false + \Magento\Framework\Data\Form\AbstractForm::class, + ['getFieldContainerIdPrefix'], + [], + '', + false ); $formMock->expects($this->once()) ->method('getFieldContainerIdPrefix') diff --git a/lib/internal/Magento/Framework/DataObject/Copy.php b/lib/internal/Magento/Framework/DataObject/Copy.php index 18b92dc2e15b6..3de2d176089f1 100644 --- a/lib/internal/Magento/Framework/DataObject/Copy.php +++ b/lib/internal/Magento/Framework/DataObject/Copy.php @@ -214,9 +214,9 @@ protected function _setFieldsetFieldValue($target, $targetCode, $value) if ($targetIsArray) { $target[$targetCode] = $value; - } else if ($target instanceof \Magento\Framework\DataObject) { + } elseif ($target instanceof \Magento\Framework\DataObject) { $target->setDataUsingMethod($targetCode, $value); - } else if ($target instanceof \Magento\Framework\Api\ExtensibleDataInterface) { + } elseif ($target instanceof \Magento\Framework\Api\ExtensibleDataInterface) { $this->setAttributeValueFromExtensibleDataObject($target, $targetCode, $value); } elseif ($target instanceof \Magento\Framework\Api\AbstractSimpleObject) { $target->setData($targetCode, $value); diff --git a/lib/internal/Magento/Framework/EntityManager/CallbackHandler.php b/lib/internal/Magento/Framework/EntityManager/CallbackHandler.php index 4f24b32844b8f..4af3228c4780d 100644 --- a/lib/internal/Magento/Framework/EntityManager/CallbackHandler.php +++ b/lib/internal/Magento/Framework/EntityManager/CallbackHandler.php @@ -58,7 +58,6 @@ public function process($entityType) $this->logger->error($e->getMessage(), $e->getTrace()); throw $e; } - } } diff --git a/lib/internal/Magento/Framework/EntityManager/MetadataPool.php b/lib/internal/Magento/Framework/EntityManager/MetadataPool.php index cf5c7383aad7c..0e22e2a6f2fc6 100644 --- a/lib/internal/Magento/Framework/EntityManager/MetadataPool.php +++ b/lib/internal/Magento/Framework/EntityManager/MetadataPool.php @@ -90,7 +90,6 @@ public function getMetadata($entityType) throw new \Exception(sprintf('Unknown entity type: %s requested', $entityType)); } if (!isset($this->registry[$entityType])) { - $this->registry[$entityType] = $this->createMetadata($entityType); } return $this->registry[$entityType]; diff --git a/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php b/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php index 1a2a702c5c8db..1f72f6fc84a28 100644 --- a/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php +++ b/lib/internal/Magento/Framework/Event/Invoker/InvokerDefault.php @@ -75,7 +75,8 @@ protected function _callObserverMethod($object, $observer) throw new \LogicException( sprintf( 'Observer "%s" must implement interface "%s"', - get_class($object), \Magento\Framework\Event\ObserverInterface::class + get_class($object), + \Magento\Framework\Event\ObserverInterface::class ) ); } diff --git a/lib/internal/Magento/Framework/Filesystem/Directory/Read.php b/lib/internal/Magento/Framework/Filesystem/Directory/Read.php index be1c5afe101de..311c6c43f1ed0 100644 --- a/lib/internal/Magento/Framework/Filesystem/Directory/Read.php +++ b/lib/internal/Magento/Framework/Filesystem/Directory/Read.php @@ -205,7 +205,6 @@ public function readFile($path, $flag = null, $context = null) { $absolutePath = $this->driver->getAbsolutePath($this->path, $path); return $this->driver->fileGetContents($absolutePath, $flag, $context); - } /** diff --git a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ExcludeFilterTest.php b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ExcludeFilterTest.php index 59e02387aa91a..984afb735b134 100644 --- a/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ExcludeFilterTest.php +++ b/lib/internal/Magento/Framework/Filesystem/Test/Unit/File/ExcludeFilterTest.php @@ -39,7 +39,7 @@ public function testExclusion() $this->assertTrue(!in_array(BP . '/var/session/', $result), 'Filtered path should not be in array'); } - private function getFilesIterator () + private function getFilesIterator() { $files = [ BP . '/var/', diff --git a/lib/internal/Magento/Framework/Filter/Template.php b/lib/internal/Magento/Framework/Filter/Template.php index 50a2c4e908c0d..dbe1c15e69d42 100644 --- a/lib/internal/Magento/Framework/Filter/Template.php +++ b/lib/internal/Magento/Framework/Filter/Template.php @@ -318,8 +318,7 @@ protected function getVariable($value, $default = '{no_value_defined}') if ($i == 0 && isset($this->templateVars[$stackVars[$i]['name']])) { // Getting of template value $stackVars[$i]['variable'] = & $this->templateVars[$stackVars[$i]['name']]; - } elseif ( - isset($stackVars[$i - 1]['variable']) + } elseif (isset($stackVars[$i - 1]['variable']) && $stackVars[$i - 1]['variable'] instanceof \Magento\Framework\DataObject ) { // If object calling methods or getting properties @@ -333,8 +332,7 @@ protected function getVariable($value, $default = '{no_value_defined}') ); } elseif ($stackVars[$i]['type'] == 'method') { // Calling of object method - if ( - method_exists($stackVars[$i - 1]['variable'], $stackVars[$i]['name']) + if (method_exists($stackVars[$i - 1]['variable'], $stackVars[$i]['name']) || substr($stackVars[$i]['name'], 0, 3) == 'get' ) { $stackVars[$i]['args'] = $this->getStackArgs($stackVars[$i]['args']); diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php index 64f8dd4564e65..623d421bf84d9 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php @@ -427,7 +427,6 @@ private function SslOffloadHeader() { // Lets read from db only one time okay. if ($this->sslOffloadHeader === null) { - // @todo: Untangle Config dependence on Scope, so that this class can be instantiated even if app is not // installed MAGETWO-31756 // Check if a proxy sent a header indicating an initial secure request @@ -725,7 +724,7 @@ public function getClientIp($checkProxy = true) { if ($checkProxy && $this->getServer('HTTP_CLIENT_IP') != null) { $ip = $this->getServer('HTTP_CLIENT_IP'); - } else if ($checkProxy && $this->getServer('HTTP_X_FORWARDED_FOR') != null) { + } elseif ($checkProxy && $this->getServer('HTTP_X_FORWARDED_FOR') != null) { $ip = $this->getServer('HTTP_X_FORWARDED_FOR'); } else { $ip = $this->getServer('REMOTE_ADDR'); diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php index f077635122afd..de940cfebb3ba 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php @@ -99,7 +99,7 @@ public function clearHeader($name) /** * Remove all headers - * + * * @return $this */ public function clearHeaders() diff --git a/lib/internal/Magento/Framework/HTTP/Test/Unit/Adapter/CurlTest.php b/lib/internal/Magento/Framework/HTTP/Test/Unit/Adapter/CurlTest.php index 255be0a5596a6..3626f4b882ba8 100644 --- a/lib/internal/Magento/Framework/HTTP/Test/Unit/Adapter/CurlTest.php +++ b/lib/internal/Magento/Framework/HTTP/Test/Unit/Adapter/CurlTest.php @@ -42,4 +42,3 @@ public function readDataProvider() ]; } } - diff --git a/lib/internal/Magento/Framework/Image/Factory.php b/lib/internal/Magento/Framework/Image/Factory.php index f6ac872ef9912..e80fca8992270 100644 --- a/lib/internal/Magento/Framework/Image/Factory.php +++ b/lib/internal/Magento/Framework/Image/Factory.php @@ -43,6 +43,8 @@ public function create($fileName = null, $adapterName = null) { $adapter = $this->adapterFactory->create($adapterName); return $this->objectManager->create( - \Magento\Framework\Image::class, ['adapter' => $adapter, 'fileName' => $fileName]); + \Magento\Framework\Image::class, + ['adapter' => $adapter, 'fileName' => $fileName] + ); } } diff --git a/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php index aa1e2ec5535f9..862e6b22b335f 100644 --- a/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php +++ b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php @@ -1,7 +1,7 @@ \IntlTimeZone::createTimeZone($code)->getDisplayName( - false, - \IntlTimeZone::DISPLAY_LONG, - $locale - ) . ' (' . $code . ')', + false, + \IntlTimeZone::DISPLAY_LONG, + $locale + ) . ' (' . $code . ')', 'value' => $code, ]; } diff --git a/lib/internal/Magento/Framework/Model/AbstractExtensibleModel.php b/lib/internal/Magento/Framework/Model/AbstractExtensibleModel.php index 947c526c919a6..16725a4837a3e 100644 --- a/lib/internal/Magento/Framework/Model/AbstractExtensibleModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractExtensibleModel.php @@ -184,7 +184,7 @@ public function setData($key, $value = null) { if (is_array($key)) { $key = $this->filterCustomAttributes($key); - } else if ($key == self::CUSTOM_ATTRIBUTES) { + } elseif ($key == self::CUSTOM_ATTRIBUTES) { $filteredData = $this->filterCustomAttributes([self::CUSTOM_ATTRIBUTES => $value]); $value = $filteredData[self::CUSTOM_ATTRIBUTES]; } diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php index b22494603a69e..e2a828dd3670a 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php @@ -5,14 +5,14 @@ */ namespace Magento\Framework\Model\ResourceModel\Db\Collection; + use Magento\Framework\App\ResourceConnection\SourceProviderInterface; /** * Abstract Resource Collection * @SuppressWarnings(PHPMD.NumberOfChildren) */ -abstract class AbstractCollection extends \Magento\Framework\Data\Collection\AbstractDb - implements SourceProviderInterface +abstract class AbstractCollection extends \Magento\Framework\Data\Collection\AbstractDb implements SourceProviderInterface { /** * Model name diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/CreateEntityRow.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/CreateEntityRow.php index 27d683b85835a..2303ef7f7622b 100755 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/CreateEntityRow.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/CreateEntityRow.php @@ -36,7 +36,6 @@ protected function prepareData(EntityMetadata $metadata, $data) { $output = []; foreach ($metadata->getEntityConnection()->describeTable($metadata->getEntityTable()) as $column) { - if ($column['DEFAULT'] == 'CURRENT_TIMESTAMP' /*|| $column['IDENTITY']*/) { continue; } diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php index e22e19ef0e1b5..c9aea954f7014 100755 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php @@ -37,7 +37,6 @@ protected function prepareData(EntityMetadata $metadata, $data) { $output = []; foreach ($metadata->getEntityConnection()->describeTable($metadata->getEntityTable()) as $column) { - if ($column['DEFAULT'] == 'CURRENT_TIMESTAMP' || $column['IDENTITY']) { continue; } diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/AbstractModelTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/AbstractModelTest.php index e4748e46ccdb4..1e29abf531c36 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/AbstractModelTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/AbstractModelTest.php @@ -6,7 +6,6 @@ namespace Magento\Framework\Model\Test\Unit; - class AbstractModelTest extends \PHPUnit_Framework_TestCase { /** @@ -93,7 +92,6 @@ protected function setUp() $this->resourceMock->expects($this->any()) ->method('getConnection') ->will($this->returnValue($this->connectionMock)); - } public function testDelete() diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php index 7ad907c22421b..999fbc0d0989f 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\Model\Test\Unit\ResourceModel\Db; + use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Adapter\DuplicateException; use Magento\Framework\Model\AbstractModel; @@ -136,7 +137,8 @@ public function testGetIdFieldname() { $data = 'MainTableName'; $idFieldNameProperty = new \ReflectionProperty( - AbstractDb::class, '_idFieldName' + AbstractDb::class, + '_idFieldName' ); $idFieldNameProperty->setAccessible(true); $idFieldNameProperty->setValue($this->_model, $data); @@ -168,8 +170,7 @@ public function testGetMainTable($tableName, $expectedResult) $this->_resourcesMock->expects($this->once()) ->method('getTableName') ->with($expectedResult) - ->will($this->returnValue($expectedResult) - ); + ->will($this->returnValue($expectedResult)); $this->assertEquals($expectedResult, $this->_model->getMainTable()); } @@ -309,8 +310,7 @@ public function testDelete() ); $this->_resourcesMock->expects($this->any()) ->method('getConnection') - ->will($this->returnValue($connectionInterfaceMock) - ); + ->will($this->returnValue($connectionInterfaceMock)); $abstractModelMock->expects($this->once())->method('getData')->willReturn(['data' => 'value']); $connectionMock = $this->getMock(AdapterInterface::class); @@ -413,8 +413,7 @@ public function testGetDataChanged($getOriginData, $expected) $this->_resourcesMock->expects($this->once()) ->method('getTableName') ->with('table') - ->will($this->returnValue('tableName') - ); + ->will($this->returnValue('tableName')); $abstractModelMock->expects($this->at(0))->method('getOrigData')->will($this->returnValue(true)); $abstractModelMock->expects($this->at(1))->method('getOrigData')->will($this->returnValue($getOriginData)); $connectionInterfaceMock->expects($this->any())->method('describeTable')->with('tableName')->will( @@ -470,8 +469,7 @@ public function testPrepareDataForUpdate() $data = 'tableName'; $this->_resourcesMock->expects($this->any()) ->method('getConnection') - ->will($this->returnValue($connectionMock) - ); + ->will($this->returnValue($connectionMock)); $this->_resourcesMock->expects($this->any())->method('getTableName')->with($data)->will( $this->returnValue('tableName') ); diff --git a/lib/internal/Magento/Framework/Module/DependencyChecker.php b/lib/internal/Magento/Framework/Module/DependencyChecker.php index 92adbd6fbb7bf..fa2c165a2928a 100644 --- a/lib/internal/Magento/Framework/Module/DependencyChecker.php +++ b/lib/internal/Magento/Framework/Module/DependencyChecker.php @@ -106,7 +106,7 @@ private function checkDependencyGraph($isEnable, $moduleNames, $enabledModules) if (isset($paths[$module])) { if ($isEnable && !in_array($module, $enabledModules)) { $dependenciesMissing[$module] = $paths[$module]; - } else if (!$isEnable && in_array($module, $enabledModules)) { + } elseif (!$isEnable && in_array($module, $enabledModules)) { $dependenciesMissing[$module] = array_reverse($paths[$module]); } } diff --git a/lib/internal/Magento/Framework/Module/Status.php b/lib/internal/Magento/Framework/Module/Status.php index 040067b2c8153..4fdc5c5325bda 100644 --- a/lib/internal/Magento/Framework/Module/Status.php +++ b/lib/internal/Magento/Framework/Module/Status.php @@ -81,7 +81,7 @@ public function __construct( * @param string[] $modulesToBeChanged * @param string[] $currentlyEnabledModules * @param bool $prettyMessage - * + * * @return string[] */ public function checkConstraints( diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/Config/Data/ProxyTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/Config/Data/ProxyTest.php index 2baa1b733aa3e..907bf9c5039c8 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/Config/Data/ProxyTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/Config/Data/ProxyTest.php @@ -29,7 +29,11 @@ protected function setUp() { $this->objectManagerMock = $this->getMock(\Magento\Framework\ObjectManagerInterface::class); $this->dataMock = $this->getMock( - \Magento\Framework\Mview\Config\Data::class, [], [], '', false + \Magento\Framework\Mview\Config\Data::class, + [], + [], + '', + false ); } @@ -44,7 +48,8 @@ public function testMergeShared() ->with(['some_config']); $this->model = new Proxy( - $this->objectManagerMock, \Magento\Framework\Mview\Config\Data::class, + $this->objectManagerMock, + \Magento\Framework\Mview\Config\Data::class, true ); @@ -62,7 +67,8 @@ public function testMergeNonShared() ->with(['some_config']); $this->model = new Proxy( - $this->objectManagerMock, \Magento\Framework\Mview\Config\Data::class, + $this->objectManagerMock, + \Magento\Framework\Mview\Config\Data::class, false ); @@ -81,7 +87,8 @@ public function testGetShared() ->will($this->returnValue('some_value')); $this->model = new Proxy( - $this->objectManagerMock, \Magento\Framework\Mview\Config\Data::class, + $this->objectManagerMock, + \Magento\Framework\Mview\Config\Data::class, true ); @@ -100,7 +107,8 @@ public function testGetNonShared() ->will($this->returnValue('some_value')); $this->model = new Proxy( - $this->objectManagerMock, \Magento\Framework\Mview\Config\Data::class, + $this->objectManagerMock, + \Magento\Framework\Mview\Config\Data::class, false ); diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/ConfigTest.php index 1dd5627d7d422..26105fef93c84 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/ConfigTest.php @@ -23,7 +23,11 @@ class ConfigTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->dataMock = $this->getMock( - \Magento\Framework\Mview\Config\Data::class, [], [], '', false + \Magento\Framework\Mview\Config\Data::class, + [], + [], + '', + false ); $this->model = new Config( $this->dataMock diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/CollectionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/CollectionTest.php index 231da97292922..7353353359473 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/CollectionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/CollectionTest.php @@ -34,7 +34,12 @@ public function testLoadDataAndGetViewsByStateMode() )->disableOriginalConstructor()->getMock(); $state = $this->getMockForAbstractClass( - \Magento\Framework\Mview\View\StateInterface::class, [], '', false, false, true, + \Magento\Framework\Mview\View\StateInterface::class, + [], + '', + false, + false, + true, ['getViewId', 'getMode', '__wakeup'] ); @@ -49,7 +54,12 @@ public function testLoadDataAndGetViewsByStateMode() ); $view = $this->getMockForAbstractClass( - \Magento\Framework\Mview\ViewInterface::class, [], '', false, false, true, + \Magento\Framework\Mview\ViewInterface::class, + [], + '', + false, + false, + true, ['load', 'setState', 'getState', '__wakeup'] ); diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionFactoryTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionFactoryTest.php index f27efd62b7321..7d809825a585b 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionFactoryTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionFactoryTest.php @@ -29,7 +29,10 @@ protected function setUp() public function testCreate() { $subscriptionInterfaceMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\View\SubscriptionInterface::class, [], '', false + \Magento\Framework\Mview\View\SubscriptionInterface::class, + [], + '', + false ); $this->objectManagerMock->expects($this->once()) ->method('create') diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php index 8085e73a7d0c2..f9b6392662a84 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/View/SubscriptionTest.php @@ -63,13 +63,30 @@ protected function setUp() ->willReturn($this->connectionMock); $this->triggerFactoryMock = $this->getMock( - \Magento\Framework\DB\Ddl\TriggerFactory::class, [], [], '', false, false + \Magento\Framework\DB\Ddl\TriggerFactory::class, + [], + [], + '', + false, + false ); $this->viewCollectionMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\View\CollectionInterface::class, [], '', false, false, true, [] + \Magento\Framework\Mview\View\CollectionInterface::class, + [], + '', + false, + false, + true, + [] ); $this->viewMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\ViewInterface::class, [], '', false, false, true, [] + \Magento\Framework\Mview\ViewInterface::class, + [], + '', + false, + false, + true, + [] ); $this->resourceMock->expects($this->any()) @@ -162,7 +179,13 @@ public function testCreate() ->will($this->returnSelf()); $changelogMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\View\ChangelogInterface::class, [], '', false, false, true, [] + \Magento\Framework\Mview\View\ChangelogInterface::class, + [], + '', + false, + false, + true, + [] ); $changelogMock->expects($this->exactly(3)) ->method('getName') @@ -180,7 +203,13 @@ public function testCreate() ->will($this->returnValue($triggerMock)); $otherChangelogMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\View\ChangelogInterface::class, [], '', false, false, true, [] + \Magento\Framework\Mview\View\ChangelogInterface::class, + [], + '', + false, + false, + true, + [] ); $otherChangelogMock->expects($this->exactly(3)) ->method('getName') @@ -190,7 +219,13 @@ public function testCreate() ->will($this->returnValue('entity_id')); $otherViewMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\ViewInterface::class, [], '', false, false, true, [] + \Magento\Framework\Mview\ViewInterface::class, + [], + '', + false, + false, + true, + [] ); $otherViewMock->expects($this->exactly(1)) ->method('getId') @@ -253,7 +288,13 @@ public function testRemove() ->will($this->returnValue($triggerMock)); $otherChangelogMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\View\ChangelogInterface::class, [], '', false, false, true, [] + \Magento\Framework\Mview\View\ChangelogInterface::class, + [], + '', + false, + false, + true, + [] ); $otherChangelogMock->expects($this->exactly(3)) ->method('getName') @@ -263,7 +304,13 @@ public function testRemove() ->will($this->returnValue('entity_id')); $otherViewMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\ViewInterface::class, [], '', false, false, true, [] + \Magento\Framework\Mview\ViewInterface::class, + [], + '', + false, + false, + true, + [] ); $otherViewMock->expects($this->exactly(1)) ->method('getId') diff --git a/lib/internal/Magento/Framework/Phrase/Test/Unit/Renderer/CompositeTest.php b/lib/internal/Magento/Framework/Phrase/Test/Unit/Renderer/CompositeTest.php index aeb586271a207..c4bfa678e5582 100644 --- a/lib/internal/Magento/Framework/Phrase/Test/Unit/Renderer/CompositeTest.php +++ b/lib/internal/Magento/Framework/Phrase/Test/Unit/Renderer/CompositeTest.php @@ -51,27 +51,27 @@ public function testRender() $this->rendererOne->expects( $this->once() )->method( - 'render' - )->with( - [$text], - $arguments - )->will( - $this->returnValue($resultAfterFirst) - ); + 'render' + )->with( + [$text], + $arguments + )->will( + $this->returnValue($resultAfterFirst) + ); $this->rendererTwo->expects( $this->once() )->method( - 'render' - )->with( - [ + 'render' + )->with( + [ $text, $resultAfterFirst, ], - $arguments - )->will( - $this->returnValue($resultAfterSecond) - ); + $arguments + )->will( + $this->returnValue($resultAfterSecond) + ); $this->assertEquals($resultAfterSecond, $this->object->render([$text], $arguments)); } diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/Stub.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/Stub.php index a082bdbdb3c0f..d4da63fe216f0 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/Stub.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Price/Stub.php @@ -6,7 +6,8 @@ namespace Magento\Framework\Pricing\Test\Unit\Price; -use Magento\Framework\Pricing\Price\AbstractPrice; +use Magento\Framework\Pricing\Price\AbstractPrice; + /** * Class Stub for testing abstract class AbstractPrice * diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php index 9a0dfcd7099ee..4e86bf2c869a3 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Render/PriceBoxTest.php @@ -133,7 +133,7 @@ public function toHtmlDataProvider() 'data' => ['css_classes' => 'some_css_class'], 'price_code' => 'test_price', 'css_classes' => 'some_css_class price-test_price' - ]]; + ]]; } public function testGetSaleableItem() diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Field/FieldFactory.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Field/FieldFactory.php index 66cbe02334fa1..f1fa918884f29 100644 --- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Field/FieldFactory.php +++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Field/FieldFactory.php @@ -6,7 +6,6 @@ namespace Magento\Framework\Search\Adapter\Mysql\Field; - class FieldFactory { /** diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Field/FieldInterface.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Field/FieldInterface.php index f069646d9fdaa..f81a3bb22f4e8 100644 --- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Field/FieldInterface.php +++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Field/FieldInterface.php @@ -6,7 +6,6 @@ namespace Magento\Framework\Search\Adapter\Mysql\Field; - interface FieldInterface { const TYPE_FLAT = 1; diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Query/MatchContainer.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Query/MatchContainer.php index ff216b2a39c11..76571529ad48b 100644 --- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Query/MatchContainer.php +++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Query/MatchContainer.php @@ -6,7 +6,6 @@ namespace Magento\Framework\Search\Adapter\Mysql\Query; - use Magento\Framework\Search\Request\QueryInterface; // @codeCoverageIgnore diff --git a/lib/internal/Magento/Framework/Session/Test/Unit/_files/mock_session_regenerate_id.php b/lib/internal/Magento/Framework/Session/Test/Unit/_files/mock_session_regenerate_id.php index 0988bc20ae8d2..8984eafbee30d 100644 --- a/lib/internal/Magento/Framework/Session/Test/Unit/_files/mock_session_regenerate_id.php +++ b/lib/internal/Magento/Framework/Session/Test/Unit/_files/mock_session_regenerate_id.php @@ -22,4 +22,4 @@ function session_regenerate_id($var) return true; } return call_user_func_array('\session_regenerate_id', func_get_args()); -} \ No newline at end of file +} diff --git a/lib/internal/Magento/Framework/Setup/SampleData/State.php b/lib/internal/Magento/Framework/Setup/SampleData/State.php index e222940f3f14b..006fde8140e26 100644 --- a/lib/internal/Magento/Framework/Setup/SampleData/State.php +++ b/lib/internal/Magento/Framework/Setup/SampleData/State.php @@ -123,7 +123,6 @@ protected function openStream($mode = 'w') $stream = $directoryWrite->openFile($fileName, $mode); } return $stream; - } /** diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php index a903fccc9f84b..2d456a7eeeecd 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/CookieScopeTest.php @@ -115,7 +115,8 @@ public function testGetSensitiveCookieMetadataDefaults() SensitiveCookieMetadata::KEY_HTTP_ONLY => true, SensitiveCookieMetadata::KEY_SECURE => true, ], - $cookieScope->getSensitiveCookieMetadata()->__toArray()); + $cookieScope->getSensitiveCookieMetadata()->__toArray() + ); } /** diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php index 3c5a2ba168d1b..15c8b44dddcb6 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php @@ -231,7 +231,7 @@ public function testSetSensitiveCookieNoMetadata($cookieName, $secure) [ 'request' => $this->requestMock ] - ); + ); $this->scopeMock->expects($this->once()) ->method('getSensitiveCookieMetadata') ->with() diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeFormatterTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeFormatterTest.php index af62ec1812943..48c9071568de1 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeFormatterTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/DateTime/DateTimeFormatterTest.php @@ -31,7 +31,6 @@ protected function setUp() $this->localeResolverMock->expects($this->any()) ->method('getLocale') ->willReturn('fr-FR'); - } /** diff --git a/lib/internal/Magento/Framework/Test/Unit/App/ResourceConnectionTest.php b/lib/internal/Magento/Framework/Test/Unit/App/ResourceConnectionTest.php index 9cbdea93cf4fc..d70714a83469e 100644 --- a/lib/internal/Magento/Framework/Test/Unit/App/ResourceConnectionTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/App/ResourceConnectionTest.php @@ -92,6 +92,5 @@ public function testCloseConnection() $this->configMock->expects(self::once())->method('getConnectionName')->with('default'); $this->unit->closeConnection('default'); - } } diff --git a/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php b/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php index e5103fee2c7c3..86687ba1d0bc8 100644 --- a/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/Message/PhraseFactoryTest.php @@ -52,5 +52,4 @@ public function dataProvider() ], ]; } - } diff --git a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php index 9eb8c1c339ee5..7fa1ebb0556dd 100644 --- a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php @@ -640,7 +640,8 @@ public function testGetConfigDataWithSecureIsForcedParam() ->method('getValue') ->with( 'web/secure/base_url_secure_forced', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $this->scopeMock + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + $this->scopeMock ) ->will($this->returnValue('http://localhost/')); $this->routeParamsResolverMock->expects($this->once())->method('hasData')->with('secure_is_forced') diff --git a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php index 4e0fcac1fdff2..f139ae88a997f 100644 --- a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php +++ b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/ExtensionGeneratorAutoloader.php @@ -57,7 +57,7 @@ public function load($className) if ($this->isExtension($className)) { $content = "namespace $namespace;\n\nclass $justTypeName implements " . "{$justTypeName}Interface\n{\n\n}"; - } else if ($this->isExtensionInterface($className)) { + } elseif ($this->isExtensionInterface($className)) { $content = "namespace $namespace;\n\ninterface $justTypeName extends " . "\\Magento\\Framework\\Api\\ExtensionAttributesInterface \n{\n\n}"; } diff --git a/lib/internal/Magento/Framework/Url.php b/lib/internal/Magento/Framework/Url.php index 6c9420536c490..fff8c9b3d781d 100644 --- a/lib/internal/Magento/Framework/Url.php +++ b/lib/internal/Magento/Framework/Url.php @@ -832,7 +832,7 @@ function ($item) use (&$isCached) { ); } - if(!$isCached) { + if (!$isCached) { return $this->getUrlModifier()->execute( $this->createUrl($routePath, $routeParams) ); diff --git a/lib/internal/Magento/Framework/Validator/Factory.php b/lib/internal/Magento/Framework/Validator/Factory.php index c79e4e9bedf3a..2938462aeba34 100644 --- a/lib/internal/Magento/Framework/Validator/Factory.php +++ b/lib/internal/Magento/Framework/Validator/Factory.php @@ -108,7 +108,9 @@ public function getValidatorConfig() $this->_initializeConfigList(); $this->_initializeDefaultTranslator(); return $this->_objectManager->create( - \Magento\Framework\Validator\Config::class, ['configFiles' => $this->_configFiles]); + \Magento\Framework\Validator\Config::class, + ['configFiles' => $this->_configFiles] + ); } /** diff --git a/lib/internal/Magento/Framework/View/Asset/LockerProcess.php b/lib/internal/Magento/Framework/View/Asset/LockerProcess.php index e8938211fecbf..f378a4286ea1f 100644 --- a/lib/internal/Magento/Framework/View/Asset/LockerProcess.php +++ b/lib/internal/Magento/Framework/View/Asset/LockerProcess.php @@ -105,7 +105,6 @@ private function isProcessLocked() return false; } } catch (FileSystemException $e) { - return false; } diff --git a/lib/internal/Magento/Framework/View/Asset/Minification.php b/lib/internal/Magento/Framework/View/Asset/Minification.php index 1e32e32b99676..3263a810936b2 100644 --- a/lib/internal/Magento/Framework/View/Asset/Minification.php +++ b/lib/internal/Magento/Framework/View/Asset/Minification.php @@ -79,8 +79,7 @@ public function addMinifiedSign($filename) { $extension = pathinfo($filename, PATHINFO_EXTENSION); - if ( - $this->isEnabled($extension) && + if ($this->isEnabled($extension) && !$this->isExcluded($filename) && !$this->isMinifiedFilename($filename) ) { @@ -99,8 +98,7 @@ public function removeMinifiedSign($filename) { $extension = pathinfo($filename, PATHINFO_EXTENSION); - if ( - $this->isEnabled($extension) && + if ($this->isEnabled($extension) && !$this->isExcluded($filename) && $this->isMinifiedFilename($filename) ) { diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php index b4fe2f0d1cd8f..ca9d15f0856a5 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php @@ -188,7 +188,6 @@ public function assertValid() { if ($this->contentType !== $this->targetContentType && empty($this->compatibleTypes[$this->targetContentType][$this->contentType])) { - throw new \LogicException( "The requested asset type was '{$this->targetContentType}', but ended up with '{$this->contentType}'" ); diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php index 7f0f1e53846cd..70f1f4cfe15f1 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php @@ -43,8 +43,7 @@ public function __construct(AdapterInterface $adapter, Minification $minificatio */ public function process(PreProcessor\Chain $chain) { - if ( - $this->minification->isEnabled(pathinfo($chain->getTargetAssetPath(), PATHINFO_EXTENSION)) && + if ($this->minification->isEnabled(pathinfo($chain->getTargetAssetPath(), PATHINFO_EXTENSION)) && $this->minification->isMinifiedFilename($chain->getTargetAssetPath()) && !$this->minification->isMinifiedFilename($chain->getOrigAssetPath()) ) { diff --git a/lib/internal/Magento/Framework/View/Element/Message/MessageConfigurationsPool.php b/lib/internal/Magento/Framework/View/Element/Message/MessageConfigurationsPool.php index dc262265984f5..d020e16779dc4 100644 --- a/lib/internal/Magento/Framework/View/Element/Message/MessageConfigurationsPool.php +++ b/lib/internal/Magento/Framework/View/Element/Message/MessageConfigurationsPool.php @@ -24,15 +24,13 @@ public function __construct( array_walk( $configurationsMap, function (array &$configuration) { - if ( - !isset($configuration['renderer']) + if (!isset($configuration['renderer']) || !is_string($configuration['renderer']) ) { throw new \InvalidArgumentException('Renderer should be defined.'); } - if ( - isset($configuration['data']) + if (isset($configuration['data']) && !is_array($configuration['data']) ) { throw new \InvalidArgumentException('Data should be of array type.'); diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php b/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php index ed8d4b3c461d5..d150c606777f1 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php @@ -208,7 +208,7 @@ protected function nestedMerge(\DOMXPath $rootDomXPath, \DOMNodeList $insertedNo if ($this->isMergeContext($insertedXPath)) { if ($this->isTextNode($insertedItem) && $this->isTextNode($rootItem)) { $rootItem->nodeValue = $insertedItem->nodeValue; - } else if (!$this->isContextXPath([$rootItemXPath, $insertedXPath]) + } elseif (!$this->isContextXPath([$rootItemXPath, $insertedXPath]) && !$this->hasIdAttribute($rootItem) && !$this->hasIdAttribute($insertedItem) ) { diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php b/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php index 8741f9a1267fa..69348cbdaf4fb 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponent/Context.php @@ -323,9 +323,9 @@ protected function setAcceptType() $rawAcceptType = $this->request->getHeader('Accept'); if (strpos($rawAcceptType, 'json') !== false) { $this->acceptType = 'json'; - } else if (strpos($rawAcceptType, 'html') !== false) { + } elseif (strpos($rawAcceptType, 'html') !== false) { $this->acceptType = 'html'; - } else if (strpos($rawAcceptType, 'xml') !== false) { + } elseif (strpos($rawAcceptType, 'xml') !== false) { $this->acceptType = 'xml'; } } diff --git a/lib/internal/Magento/Framework/View/Layout.php b/lib/internal/Magento/Framework/View/Layout.php index 3334967c8da83..db447bf96f145 100755 --- a/lib/internal/Magento/Framework/View/Layout.php +++ b/lib/internal/Magento/Framework/View/Layout.php @@ -495,7 +495,6 @@ protected function displayElement($name) $display = $this->structure->getAttribute($name, 'display'); if ($display === '' || $display === false || $display === null || filter_var($display, FILTER_VALIDATE_BOOLEAN)) { - return true; } return false; diff --git a/lib/internal/Magento/Framework/View/Layout/GeneratorPool.php b/lib/internal/Magento/Framework/View/Layout/GeneratorPool.php index 828f0584a2065..540684fe928ea 100644 --- a/lib/internal/Magento/Framework/View/Layout/GeneratorPool.php +++ b/lib/internal/Magento/Framework/View/Layout/GeneratorPool.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\View\Layout; - /** * Pool of generators for structural elements */ @@ -156,8 +155,7 @@ protected function reorderElements( $element[ScheduledStructure::ELEMENT_OFFSET_OR_SIBLING] ); - if ( - isset($siblingElement[ScheduledStructure::ELEMENT_NAME]) + if (isset($siblingElement[ScheduledStructure::ELEMENT_NAME]) && $structure->hasElement($siblingElement[ScheduledStructure::ELEMENT_NAME]) ) { $this->reorderElements( diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index 3ecd30b7e0bfa..651e5f8e3641b 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -361,7 +361,7 @@ protected function renderAssetHtml(\Magento\Framework\View\Asset\PropertyGroup $ /** * Get asset content type - * + * * @param \Magento\Framework\View\Asset\AssetInterface $asset * @return string */ diff --git a/lib/internal/Magento/Framework/View/Page/Config/Structure.php b/lib/internal/Magento/Framework/View/Page/Config/Structure.php index 4ab89319f6d82..15dd082ff18c3 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Structure.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Structure.php @@ -6,7 +6,6 @@ namespace Magento\Framework\View\Page\Config; - /** * Page config structure model */ diff --git a/lib/internal/Magento/Framework/View/TemplateEngine/Xhtml/Compiler.php b/lib/internal/Magento/Framework/View/TemplateEngine/Xhtml/Compiler.php index 137a9d36374cb..88c1a625bb56a 100644 --- a/lib/internal/Magento/Framework/View/TemplateEngine/Xhtml/Compiler.php +++ b/lib/internal/Magento/Framework/View/TemplateEngine/Xhtml/Compiler.php @@ -102,7 +102,7 @@ public function compile(\DOMNode $node, DataObject $processedObject, DataObject $compiler = $this->getElementCompiler($node->nodeName); if (null !== $compiler) { $compiler->compile($this, $node, $processedObject, $context); - } else if ($node->hasChildNodes()) { + } elseif ($node->hasChildNodes()) { foreach ($this->getChildNodes($node) as $child) { $this->compile($child, $processedObject, $context); } diff --git a/lib/internal/Magento/Framework/View/TemplateEnginePool.php b/lib/internal/Magento/Framework/View/TemplateEnginePool.php index 6b4305d7f2b46..c041d4d1bc557 100644 --- a/lib/internal/Magento/Framework/View/TemplateEnginePool.php +++ b/lib/internal/Magento/Framework/View/TemplateEnginePool.php @@ -5,7 +5,6 @@ */ namespace Magento\Framework\View; - class TemplateEnginePool { /** diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MinificationTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MinificationTest.php index 21a27f33cad18..f82eae75a3cf3 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MinificationTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MinificationTest.php @@ -53,7 +53,6 @@ protected function setUp() */ public function testIsEnabled() { - } /** diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/NotationResolver/ModuleTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/NotationResolver/ModuleTest.php index 9908b3806bfb7..8e7ad15bb0b2c 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/NotationResolver/ModuleTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/NotationResolver/ModuleTest.php @@ -49,7 +49,10 @@ public function testConvertModuleNotationToPathNoModularSeparator() * @dataProvider convertModuleNotationToPathModularSeparatorDataProvider */ public function testConvertModuleNotationToPathModularSeparator( - $assetRelPath, $relatedFieldId, $similarRelPath, $expectedResult + $assetRelPath, + $relatedFieldId, + $similarRelPath, + $expectedResult ) { $similarAsset = $this->getMock(\Magento\Framework\View\Asset\File::class, [], [], '', false); $similarAsset->expects($this->any()) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/SourceTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/SourceTest.php index 0b565a96d3c65..3aa5a8cd82b4b 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/SourceTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/SourceTest.php @@ -77,16 +77,25 @@ class SourceTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->preProcessorPool = $this->getMock( - \Magento\Framework\View\Asset\PreProcessor\Pool::class, [], [], '', false + \Magento\Framework\View\Asset\PreProcessor\Pool::class, + [], + [], + '', + false ); $this->viewFileResolution = $this->getMock( - \Magento\Framework\View\Design\FileResolution\Fallback\StaticFile::class, [], [], '', false + \Magento\Framework\View\Design\FileResolution\Fallback\StaticFile::class, + [], + [], + '', + false ); $this->theme = $this->getMockForAbstractClass(\Magento\Framework\View\Design\ThemeInterface::class); /** @var \Magento\Framework\App\Config\ScopeConfigInterface $config */ $this->chainFactory = $this->getMockBuilder( - \Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface::class) + \Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface::class + ) ->getMock(); $this->chain = $this->getMockBuilder(\Magento\Framework\View\Asset\PreProcessor\Chain::class) ->disableOriginalConstructor() diff --git a/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php index 1ed3d501dc1af..a65ee3f5ce1f2 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/DataSourcePoolTest.php @@ -31,9 +31,11 @@ protected function setUp() $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->dataSourcePool = $objectManager->getObject( - \Magento\Framework\View\DataSourcePool::class, [ + \Magento\Framework\View\DataSourcePool::class, + [ 'blockFactory' => $this->blockFactory - ]); + ] + ); } /** diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ImageTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ImageTest.php index bcb9144adf2b8..8da698e48a413 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ImageTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Theme/ImageTest.php @@ -68,7 +68,11 @@ protected function setUp() ); $this->_rootDirectoryMock = $this->getMock( \Magento\Framework\Filesystem\Directory\Write::class, - ['isExist', 'copyFile', 'getRelativePath', 'delete'], [], '', false, false + ['isExist', 'copyFile', 'getRelativePath', 'delete'], + [], + '', + false, + false ); $this->_filesystemMock = $this->getMock( \Magento\Framework\Filesystem::class, @@ -105,14 +109,16 @@ protected function setUp() $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->_model = $objectManager->getObject( - \Magento\Framework\View\Design\Theme\Image::class, [ + \Magento\Framework\View\Design\Theme\Image::class, + [ 'filesystem' => $this->_filesystemMock, 'imageFactory' => $imageFactory, 'uploader' => $this->_uploaderMock, 'themeImagePath' => $this->imagePathMock, 'logger' => $logger, 'theme' => $this->_themeMock - ]); + ] + ); } protected function tearDown() diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php index aa2b32ec36c7f..de1683618db16 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleDependencyTest.php @@ -31,7 +31,8 @@ protected function setUp() ->method('getNames') ->will($this->returnValue(['Fixture_ModuleB', 'Fixture_ModuleA'])); $this->_model = new \Magento\Framework\View\File\Collector\Decorator\ModuleDependency( - $this->_fileSource, $this->_moduleListMock + $this->_fileSource, + $this->_moduleListMock ); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleOutputTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleOutputTest.php index 713ad13660b9c..00f8bb8e615cc 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleOutputTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/Collector/Decorator/ModuleOutputTest.php @@ -35,7 +35,8 @@ protected function setUp() ['Module_OutputDisabled', false], ])); $this->_model = new \Magento\Framework\View\File\Collector\Decorator\ModuleOutput( - $this->_fileSource, $this->_moduleManager + $this->_fileSource, + $this->_moduleManager ); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/File/FileListTest.php b/lib/internal/Magento/Framework/View/Test/Unit/File/FileListTest.php index 4a251d7c55b1e..7d57917e3fb26 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/File/FileListTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/File/FileListTest.php @@ -105,8 +105,8 @@ public function testReplace() $this->equalTo($files), $this->equalTo([ $this->_baseFile->getFileIdentifier() => $this->_baseFile, - $this->_themeFile->getFileIdentifier() => $this->_themeFile, ] - )) + $this->_themeFile->getFileIdentifier() => $this->_themeFile, ]) + ) ->will($this->returnValue($result)); $this->assertNull($this->_model->replace($files)); $this->assertSame($result, $this->_model->getAll()); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php b/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php index 09694d11298d6..25cb0273d2a21 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php @@ -49,24 +49,46 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_fileResolution = $this->getMock( - \Magento\Framework\View\Design\FileResolution\Fallback\File::class, [], - [], '', false + \Magento\Framework\View\Design\FileResolution\Fallback\File::class, + [], + [], + '', + false ); $this->_templateFileResolution = $this->getMock( - \Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile::class, [], [], '', false + \Magento\Framework\View\Design\FileResolution\Fallback\TemplateFile::class, + [], + [], + '', + false ); $this->_localeFileResolution = $this->getMock( - \Magento\Framework\View\Design\FileResolution\Fallback\LocaleFile::class, [], [], '', false + \Magento\Framework\View\Design\FileResolution\Fallback\LocaleFile::class, + [], + [], + '', + false ); $this->_staticFileResolution = $this->getMock( - \Magento\Framework\View\Design\FileResolution\Fallback\StaticFile::class, [], [], '', false + \Magento\Framework\View\Design\FileResolution\Fallback\StaticFile::class, + [], + [], + '', + false ); $this->_emailTemplateFileResolution = $this->getMock( - \Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile::class, [], [], '', false + \Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile::class, + [], + [], + '', + false ); $this->_assetRepo = $this->getMock( \Magento\Framework\View\Asset\Repository::class, - ['extractScope', 'updateDesignParams', 'createAsset'], [], '', false + ['extractScope', 'updateDesignParams', 'createAsset'], + [], + '', + false ); $this->_model = new \Magento\Framework\View\FileSystem( @@ -84,8 +106,13 @@ public function testGetFilename() $params = [ 'area' => 'some_area', 'themeModel' => $this->getMock( - \Magento\Framework\View\Design\ThemeInterface::class, [], [], '', false, false - ), + \Magento\Framework\View\Design\ThemeInterface::class, + [], + [], + '', + false, + false + ), 'module' => 'Some_Module', //It should be set in \Magento\Framework\View\Asset\Repository::extractScope // but PHPUnit has troubles with passing arguments by reference ]; @@ -111,8 +138,13 @@ public function testGetTemplateFileName() $params = [ 'area' => 'some_area', 'themeModel' => $this->getMock( - \Magento\Framework\View\Design\ThemeInterface::class, [], [], '', false, false - ), + \Magento\Framework\View\Design\ThemeInterface::class, + [], + [], + '', + false, + false + ), 'module' => 'Some_Module', //It should be set in \Magento\Framework\View\Asset\Repository::extractScope // but PHPUnit has troubles with passing arguments by reference ]; @@ -262,7 +294,12 @@ public function testGetEmailTemplateFile() $params = [ 'area' => 'some_area', 'themeModel' => $this->getMock( - \Magento\Framework\View\Design\ThemeInterface::class, [], [], '', false, false + \Magento\Framework\View\Design\ThemeInterface::class, + [], + [], + '', + false, + false ), 'module' => 'Some_Module', 'locale' => $locale diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Generator/BlockTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Generator/BlockTest.php index 2dfe9f607dd32..84542fad2d592 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Generator/BlockTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Generator/BlockTest.php @@ -151,8 +151,7 @@ public function testProcess( ->with($testArgumentData['argument']) ->willReturn($argumentData['argument']); } else { - $argumentInterpreter->expects($this->never())->method('evaluate') - ; + $argumentInterpreter->expects($this->never())->method('evaluate'); } /** @var \Magento\Framework\View\Element\BlockFactory|\PHPUnit_Framework_MockObject_MockObject $blockFactory */ diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Result/LayoutTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Result/LayoutTest.php index c382f8f54cdf8..5fde3f3389c07 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Result/LayoutTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Result/LayoutTest.php @@ -103,7 +103,12 @@ public function testAddUpdate() * @dataProvider renderResultDataProvider */ public function testRenderResult( - $httpCode, $headerName, $headerValue, $replaceHeader, $setHttpResponseCodeCount, $setHeaderCount + $httpCode, + $headerName, + $headerValue, + $replaceHeader, + $setHttpResponseCodeCount, + $setHeaderCount ) { $layoutOutput = 'output'; diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/result.css b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/result.css index 0801b5a8cea1e..7d597feaebfd9 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/result.css +++ b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/result.css @@ -7,3 +7,4 @@ body {background: url(../two/another/body.gif);} a {background: url(data:image/png;)} li {background: url("https://example.com/absolute.gif");} ol.favicon {background: url(../two/another/Magento_Theme::favicon.ico)} /* base file */ + diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/resultImport.css b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/resultImport.css index 77aafa417e9c9..a945e71975ded 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/resultImport.css +++ b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/resultImport.css @@ -8,3 +8,4 @@ body {background: url(body.gif);} p {background: url(1.gif?param);} h1 {background: url('../h1.gif#param');} h2 {background: url(../images/h2.gif?test);} + diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/resultNormalized.css b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/resultNormalized.css index b63220a25bff6..cfc19e479b205 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/resultNormalized.css +++ b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/resultNormalized.css @@ -7,3 +7,4 @@ body {background: url(../two/another/body.gif);} a {background: url(data:image/png;)} li {background: url("https://example.com/absolute.gif");} ol.favicon {background: url(../two/another/Magento_Theme::favicon.ico)} /* base file */ + diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/source.css b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/source.css index 42b4c50c4efe8..e14240ea71017 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/source.css +++ b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/source.css @@ -7,3 +7,4 @@ body {background: url(body.gif);} a {background: url(data:image/png;)} li {background: url("https://example.com/absolute.gif");} ol.favicon {background: url(Magento_Theme::favicon.ico)} /* base file */ + diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/sourceImport.css b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/sourceImport.css index b1593c0b789a2..791e452811779 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/sourceImport.css +++ b/lib/internal/Magento/Framework/View/Test/Unit/Url/_files/sourceImport.css @@ -7,3 +7,4 @@ body {background: url(body.gif);} p {background: url(1.gif?param);} @import url("deep/recursive.css"); h1 {background: url('../h1.gif#param');} h2 {background: url(../images/h2.gif?test);} + diff --git a/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php b/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php index b3e01634347d2..6716eb4a1a1e6 100644 --- a/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php +++ b/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php @@ -165,8 +165,7 @@ public function maskException(\Exception $exception) */ public function renderException(\Exception $exception, $httpCode = self::DEFAULT_ERROR_HTTP_CODE) { - if ( - $this->_appState->getMode() == State::MODE_DEVELOPER || + if ($this->_appState->getMode() == State::MODE_DEVELOPER || $exception instanceof \Magento\Framework\Webapi\Exception ) { $this->renderErrorMessage($exception->getMessage(), $exception->getTraceAsString(), $httpCode); diff --git a/lib/internal/Magento/Framework/Webapi/Rest/Request.php b/lib/internal/Magento/Framework/Webapi/Rest/Request.php index 8de7a2c9ffd0d..9380ed4a8fe84 100644 --- a/lib/internal/Magento/Framework/Webapi/Rest/Request.php +++ b/lib/internal/Magento/Framework/Webapi/Rest/Request.php @@ -130,7 +130,6 @@ public function getBodyParams() if ($this->getContent()) { $this->_bodyParams = (array)$this->_getDeserializer()->deserialize((string)$this->getContent()); } - } return $this->_bodyParams; } diff --git a/lib/internal/Magento/Framework/Webapi/Rest/Request/ParamOverriderInterface.php b/lib/internal/Magento/Framework/Webapi/Rest/Request/ParamOverriderInterface.php index e19f8e14d7d05..f0f25bff26cf0 100644 --- a/lib/internal/Magento/Framework/Webapi/Rest/Request/ParamOverriderInterface.php +++ b/lib/internal/Magento/Framework/Webapi/Rest/Request/ParamOverriderInterface.php @@ -15,7 +15,7 @@ * invoked could have a signature of "getAddresses($customerId)", but in the webapi.xml, the $customerId parameter * would be forced to be the customer id of the current authenticated user. * - * The forced override parameter configuration is in the webapi.xml. + * The forced override parameter configuration is in the webapi.xml. * * * %customer_id% diff --git a/lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php b/lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php index 9e1d50ec7ed29..4f3235f50e35f 100644 --- a/lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php +++ b/lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php @@ -258,9 +258,9 @@ private function processCustomAttribute($customAttribute) if (!$customAttributeCode && !isset($customAttribute[AttributeValue::VALUE])) { throw new SerializationException(new Phrase('There is an empty custom attribute specified.')); - } else if (!$customAttributeCode) { + } elseif (!$customAttributeCode) { throw new SerializationException(new Phrase('A custom attribute is specified without an attribute code.')); - } else if (!isset($customAttribute[AttributeValue::VALUE])) { + } elseif (!isset($customAttribute[AttributeValue::VALUE])) { throw new SerializationException( new Phrase('Value is not set for attribute code "' . $customAttributeCode . '"') ); diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php index b52f1cc849b4a..0f2fc6cef4b9d 100644 --- a/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php +++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/ServiceInputProcessorTest.php @@ -65,7 +65,8 @@ function ($className) use ($objectManager) { $cache->expects($this->any())->method('load')->willReturn(false); $this->customAttributeTypeLocator = $this->getMockBuilder( - \Magento\Eav\Model\EavCustomAttributeTypeLocator::class) + \Magento\Eav\Model\EavCustomAttributeTypeLocator::class + ) ->disableOriginalConstructor() ->getMock(); @@ -458,7 +459,7 @@ protected function getObjectWithCustomAttributes($type, $value = []) { $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $customAttributeValue = null; - switch($type) { + switch ($type) { case 'integer': $customAttributeValue = $value; break; From 8fe8e79f3ba3a22f173ad7bd6837f09e299164cb Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Mon, 24 Oct 2016 23:24:21 +0200 Subject: [PATCH 03/92] - Changed sample repository because it gave errors on the double slash in the codesniffer. --- .../Framework/ObjectManager/Code/Generator/Repository.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php index 9aa3123b7db73..71c1995d92b0d 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php +++ b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php @@ -22,9 +22,9 @@ class Repository extends \Magento\Framework\Code\Generator\EntityAbstract /** * No Such Entity Exception */ - const NO_SUCH_ENTITY_EXCEPTION = '\\Magento\Framework\Exception\NoSuchEntityException'; - const INPUT_EXCEPTION = '\\Magento\Framework\Exception\InputException'; - const SEARCH_CRITERIA = '\\Magento\Framework\Api\SearchCriteria'; + const NO_SUCH_ENTITY_EXCEPTION = '\Magento\Framework\Exception\NoSuchEntityException'; + const INPUT_EXCEPTION = '\Magento\Framework\Exception\InputException'; + const SEARCH_CRITERIA = '\Magento\Framework\Api\SearchCriteria'; /** * Retrieve class properties From e3f3688b75035c6007616b28872d93cfb960ee1d Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Mon, 24 Oct 2016 23:46:52 +0200 Subject: [PATCH 04/92] Fixed coding standard error: No space found after comma in function call --- .../Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php index 999fbc0d0989f..08deba9b6ccd8 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php @@ -567,7 +567,7 @@ public function testSaveNewObject($pkIncrement) ->willReturn($connectionMock); $idFieldName = 'id_field_name'; - $model->expects($this->once())->method('_prepareDataForSave')->willReturn([$idFieldName => 'id',]); + $model->expects($this->once())->method('_prepareDataForSave')->willReturn([$idFieldName => 'id']); // Test expectations From ab2e947bb1cfb7a44bdb6fa18e79b9b81ab63ec6 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Mon, 24 Oct 2016 23:51:12 +0200 Subject: [PATCH 05/92] Fixed coding standard error: Line exceeds maximum limit of 120 characters; contains 123 characters --- .../Data/Test/Unit/Form/Element/AbstractElementTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php index bd68ac5c9ed35..de0f9d256c3e8 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/AbstractElementTest.php @@ -356,8 +356,10 @@ public function testGetHtmlWithoutRenderer() $this->_model->setForm( $this->getMock(\Magento\Framework\Data\Form\AbstractForm::class, [], [], '', false) ); - $expectedHtml = '
' . "\n" - . '
' . "\n"; + $expectedHtml = '
' + . "\n" + . '
' + . "\n"; $this->assertEquals($expectedHtml, $this->_model->getHtml()); $this->assertEquals(' required-entry _required', $this->_model->getClass()); From d71e4317dbfb2d86e156e71661bdd1a040f10ebb Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Mon, 24 Oct 2016 23:56:40 +0200 Subject: [PATCH 06/92] Fixed coding standard error: Only one argument is allowed per line in a multi-line function call --- .../Test/Unit/PreProcessor/Instruction/MagentoImportTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/MagentoImportTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/MagentoImportTest.php index 507c059671f9d..2937e0e348afe 100644 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/MagentoImportTest.php +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/MagentoImportTest.php @@ -179,7 +179,10 @@ public function testProcessNoImport() public function testProcessException() { $chain = new \Magento\Framework\View\Asset\PreProcessor\Chain( - $this->asset, '//@magento_import "some/file.css";', 'css', 'path' + $this->asset, + '//@magento_import "some/file.css";', + 'css', + 'path' ); $exception = new \LogicException('Error happened'); $this->assetRepo->expects($this->once()) From 11d271a0f4db460bd887ddfc44363c07e61f330c Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Mon, 24 Oct 2016 23:58:19 +0200 Subject: [PATCH 07/92] Fixed coding standard error: Use ::class notation instead. --- .../Magento/Framework/App/Test/Unit/StaticResourceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php index 67a9baafaf0cf..a665fabcf5c2b 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/StaticResourceTest.php @@ -206,7 +206,7 @@ public function testCatchExceptionDeveloperMode() { $this->objectManager->expects($this->once()) ->method('get') - ->with('Psr\Log\LoggerInterface') + ->with(\Psr\Log\LoggerInterface::class) ->willReturn($this->logger); $this->logger->expects($this->once()) ->method('critical'); From 10131b496bc6427f932a7a9194eda0030a74b1d1 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 00:00:51 +0200 Subject: [PATCH 08/92] Fixed coding standard error: Empty line missed --- lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php index e9ac12abed455..d9b556567a66c 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/DataTest.php @@ -10,8 +10,10 @@ class DataTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\Framework\Config\ReaderInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $reader; + /** @var \Magento\Framework\Config\CacheInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $cache; + /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ protected $objectManagerHelper; From 74275769db3f9fa9b8f2538835176f44ab7739a7 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 00:02:29 +0200 Subject: [PATCH 09/92] Fixed coding standard error: Doc comment for "$locale" missing --- lib/internal/Magento/Framework/Locale/TranslatedLists.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Locale/TranslatedLists.php b/lib/internal/Magento/Framework/Locale/TranslatedLists.php index 6301adaf99857..2993025e1162e 100644 --- a/lib/internal/Magento/Framework/Locale/TranslatedLists.php +++ b/lib/internal/Magento/Framework/Locale/TranslatedLists.php @@ -24,6 +24,7 @@ class TranslatedLists implements ListsInterface protected $localeResolver; /** + * @param \Magento\Framework\Locale\ConfigInterface $config * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param string $locale */ From b6238d214783917f9eed067057036abb8de36bc9 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 00:09:23 +0200 Subject: [PATCH 10/92] Fixed coding standard error: Line exceeds maximum limit of 120 characters; contains 134 characters --- .../Magento/Framework/Validator/Constraint/Property.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Validator/Constraint/Property.php b/lib/internal/Magento/Framework/Validator/Constraint/Property.php index dc96b9bc3899c..a56abebca8392 100644 --- a/lib/internal/Magento/Framework/Validator/Constraint/Property.php +++ b/lib/internal/Magento/Framework/Validator/Constraint/Property.php @@ -31,8 +31,8 @@ public function __construct(\Magento\Framework\Validator\ValidatorInterface $val } /** - * Get value that should be validated. Tries to extract value's property if \Magento\Framework\DataObject or \ArrayAccess or array - * is passed + * Get value that should be validated. Tries to extract value's property if \Magento\Framework\DataObject or + * \ArrayAccess or array is passed * * @param mixed $value * @return mixed From 7dd25488faae76483550364bb986ea5a54739bec Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 00:11:06 +0200 Subject: [PATCH 11/92] Fixed coding standard error: Line exceeds maximum limit of 120 characters; contains 125 characters --- .../ResourceModel/Db/Collection/AbstractCollectionTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php index a2555f13898ae..82a743f6a12fc 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php @@ -213,7 +213,11 @@ public function testGetSelect($idFieldNameRet, $getPartRet, $expected) ->method('getPart') ->will($this->returnValue($getPartRet)); - $this->selectMock->expects($this->once())->method('setPart')->with(\Magento\Framework\DB\Select::COLUMNS, $expected); + $this->selectMock + ->expects($this->once()) + ->method('setPart') + ->with(\Magento\Framework\DB\Select::COLUMNS, $expected); + $this->assertTrue($this->uut->getSelect() instanceof Select); } From 08db17dee9211ca65eb9d6449756b26dbe4a4f6d Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 19:42:54 +0200 Subject: [PATCH 12/92] Fixed coding standard violation: Line exceeds maximum limit of 120 characters; contains 121 characters --- .../ItemPlugin/IncompatibleArgumentsType.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsType.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsType.php index cb4bf15710f42..81e55a433ac24 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsType.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/IncompatibleArgumentsType.php @@ -6,17 +6,19 @@ namespace Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin; +use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments; + class IncompatibleArgumentsType { /** - * @param \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject + * @param ItemWithArguments $subject * @param array $names * @return int * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeGetItem( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, + ItemWithArguments $subject, array $names ) { return count($names); From 8ec994a124434bd0636a0c9b1de9d8b3358f58c3 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 19:58:12 +0200 Subject: [PATCH 13/92] Fixed coding standard error: Line exceeds maximum limit of 120 characters; contains 128 characters --- lib/internal/Magento/Framework/Message/Factory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Message/Factory.php b/lib/internal/Magento/Framework/Message/Factory.php index ccd71fce91222..33ea925ae4768 100644 --- a/lib/internal/Magento/Framework/Message/Factory.php +++ b/lib/internal/Magento/Framework/Message/Factory.php @@ -61,7 +61,9 @@ public function create($type, $text = null) $message = $this->objectManager->create($className, $text === null ? [] : ['text' => $text]); if (!$message instanceof MessageInterface) { - throw new \InvalidArgumentException($className . ' doesn\'t implement \Magento\Framework\Message\MessageInterface'); + throw new \InvalidArgumentException( + $className . ' doesn\'t implement \Magento\Framework\Message\MessageInterface' + ); } return $message; From efa9c545ed4666206a9e22b70a5d5f1b236751e7 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 19:59:57 +0200 Subject: [PATCH 14/92] Fixed coding standard violation: Var type missing for @var tag in variable comment --- .../Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php index 202633a27d27e..26e24607c828d 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php @@ -29,7 +29,7 @@ class Mysql extends \Magento\Framework\Model\ResourceModel\Type\Db implements Co protected $connectionConfig; /** - * @var + * @var SelectFactory */ protected $selectFactory; From 0538366c202bbbef9af3a69304b3b62b209bde92 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:27:14 +0200 Subject: [PATCH 15/92] Fixed coding standard violation: Use ::class notation instead. --- .../Framework/Interception/Code/Generator/Interceptor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php b/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php index f0edfa49eb980..f89eea1530898 100644 --- a/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php +++ b/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php @@ -157,8 +157,8 @@ protected function _generateCode() } else { $this->_classGenerator->setExtendedClass($typeName); } - $this->_classGenerator->addTrait('\Magento\Framework\Interception\Interceptor'); - $interfaces[] = '\Magento\Framework\Interception\InterceptorInterface'; + $this->_classGenerator->addTrait(\Magento\Framework\Interception\Interceptor::class); + $interfaces[] = \Magento\Framework\Interception\InterceptorInterface::class; $this->_classGenerator->setImplementedInterfaces($interfaces); return parent::_generateCode(); } From 2880731f0ef64249da239a04f9b070035e08afca Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:31:46 +0200 Subject: [PATCH 16/92] Fixed coding standard violation: Code must not contain multiple empty lines in a row; found 2 empty lines --- lib/internal/Magento/Framework/Api/SortOrder.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Api/SortOrder.php b/lib/internal/Magento/Framework/Api/SortOrder.php index f9eb2cc63e94a..d6c465e34002c 100644 --- a/lib/internal/Magento/Framework/Api/SortOrder.php +++ b/lib/internal/Magento/Framework/Api/SortOrder.php @@ -31,8 +31,7 @@ public function __construct(array $data = []) $this->validateDirection($this->getDirection()); } } - - + /** * Get sorting field. * From bc0d31a59b6e138b215602a08e9e848a572b1809 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:34:07 +0200 Subject: [PATCH 17/92] Fixed coding standard violations: - Code must not contain multiple empty lines in a row; found 2 empty lines - Line exceeds maximum limit of 120 characters; contains 124 characters --- .../Magento/Framework/App/Test/Unit/Request/HttpTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index 0d407c3f0f55b..00dd7fdefcd94 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -281,7 +281,6 @@ public function getDistroBaseUrlPathDataProvider() ]; } - public function serverVariablesProvider() { $returnValue = []; @@ -349,8 +348,10 @@ public function testIsSecure($isSecure, $serverHttps, $headerOffloadKey, $header ->getMock(); $configMock->expects($this->exactly($configCall)) ->method('getValue') - ->with(\Magento\Framework\App\Request\Http::XML_PATH_OFFLOADER_HEADER, ScopeConfigInterface::SCOPE_TYPE_DEFAULT) - ->willReturn($configOffloadHeader); + ->with( + \Magento\Framework\App\Request\Http::XML_PATH_OFFLOADER_HEADER, + ScopeConfigInterface::SCOPE_TYPE_DEFAULT + )->willReturn($configOffloadHeader); $this->objectManager->setBackwardCompatibleProperty($this->_model, 'appConfig', $configMock); $this->objectManager->setBackwardCompatibleProperty($this->_model, 'sslOffloadHeader', null); From af5343d3839c188d727976d68cf0a91d96c8f325 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:36:31 +0200 Subject: [PATCH 18/92] Fixed coding standard violation: Line indented incorrectly; expected at least 8 spaces, found 0 --- .../Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php index d58fb082cf699..c6054bc2329df 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php @@ -52,12 +52,7 @@ protected function setUp() $selectFactory = $this->getMockBuilder(\Magento\Framework\DB\SelectFactory::class) ->disableOriginalConstructor() ->getMock(); - -// StringUtils $string, -// DateTime $dateTime, -// LoggerInterface $logger, -// SelectFactory $selectFactory, -// array $config = [] + $this->_mockAdapter = $this->getMock( \Magento\Framework\DB\Adapter\Pdo\Mysql::class, ['beginTransaction', 'getTransactionLevel'], From 809a685a4bb8e193ec3391b14600fd11f317e706 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:40:41 +0200 Subject: [PATCH 19/92] Fixed coding standard violations: - Missing function doc comment - Code must not contain multiple empty lines in a row; found 2 empty lines --- .../Magento/Framework/HTTP/PhpEnvironment/Request.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php index 623d421bf84d9..11cf55d8c8429 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php @@ -418,7 +418,7 @@ public function isSecure() return $this->initialRequestSecure($this->SslOffloadHeader()); } - /*** + /** * Get value of SSL offload http header from configuration - defaults to X-Forwarded-Proto * * @return string @@ -564,7 +564,6 @@ public function getPostValue($name = null, $default = null) return $post; } - /** * Set POST parameters * @@ -780,7 +779,6 @@ public function setRequestUri($requestUri = null) return $this; } - /** * Get base url * From 824561e27a07481ac66b033fc8ddeb3edf9ba211 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:41:43 +0200 Subject: [PATCH 20/92] Fixed coding standard violation: Empty line missed --- .../Framework/Search/Adapter/Mysql/Query/MatchContainer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Query/MatchContainer.php b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Query/MatchContainer.php index 76571529ad48b..3a044dabb75bc 100644 --- a/lib/internal/Magento/Framework/Search/Adapter/Mysql/Query/MatchContainer.php +++ b/lib/internal/Magento/Framework/Search/Adapter/Mysql/Query/MatchContainer.php @@ -16,6 +16,7 @@ class MatchContainer * @var QueryInterface */ private $request; + /** * @var string */ From aa821a2ced8add0d05877f25393a76fa1a9a049e Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:42:54 +0200 Subject: [PATCH 21/92] Fixed coding standard violation: Empty line missed --- .../Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php index 15c8b44dddcb6..68b7295b8a800 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php @@ -73,6 +73,7 @@ class PhpCookieManagerTest extends \PHPUnit_Framework_TestCase * @var \Magento\Framework\Stdlib\Cookie\PhpCookieManager */ protected $cookieManager; + /** * @var \PHPUnit_Framework_MockObject_MockObject|CookieScopeInterface */ From 21af3cb223b73d28892f9099a9b98c65e35784e0 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:46:07 +0200 Subject: [PATCH 22/92] Fixed coding standard violation: Use ::class notation instead. --- lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php b/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php index 13a3cfb04ad2a..342bd58e7f23e 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/BootstrapTest.php @@ -91,7 +91,7 @@ protected function setUp() [\Magento\Framework\App\MaintenanceMode::class, $this->maintenanceMode], [\Magento\Framework\Filesystem::class, $filesystem], [\Magento\Framework\App\DeploymentConfig::class, $this->deploymentConfig], - ['Psr\Log\LoggerInterface', $this->logger], + [\Psr\Log\LoggerInterface::class, $this->logger], ]; $this->objectManager->expects($this->any())->method('get') From 3f16a5dfe3f5aa2d38902077226dbf6b810b3307 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:49:30 +0200 Subject: [PATCH 23/92] Fixed coding standard violations: - Variable "value_hrs" is not in valid camel caps format - Variable "value_min" is not in valid camel caps format - Variable "value_sec" is not in valid camel caps format --- .../Framework/Data/Form/Element/Time.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Time.php b/lib/internal/Magento/Framework/Data/Form/Element/Time.php index e0a400d41a9a9..ed40ad84ec125 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Time.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Time.php @@ -52,16 +52,16 @@ public function getElementHtml() { $this->addClass('select admin__control-select'); - $value_hrs = 0; - $value_min = 0; - $value_sec = 0; + $valueHrs = 0; + $valueMin = 0; + $valueSec = 0; if ($value = $this->getValue()) { $values = explode(',', $value); if (is_array($values) && count($values) == 3) { - $value_hrs = $values[0]; - $value_min = $values[1]; - $value_sec = $values[2]; + $valueHrs = $values[0]; + $valueMin = $values[1]; + $valueSec = $values[2]; } } @@ -73,7 +73,7 @@ public function getElementHtml() ) . '>' . "\n"; for ($i = 0; $i < 24; $i++) { $hour = str_pad($i, 2, '0', STR_PAD_LEFT); - $html .= ''; } $html .= '' . "\n"; @@ -85,7 +85,7 @@ public function getElementHtml() ) . '>' . "\n"; for ($i = 0; $i < 60; $i++) { $hour = str_pad($i, 2, '0', STR_PAD_LEFT); - $html .= ''; } $html .= '' . "\n"; @@ -97,7 +97,7 @@ public function getElementHtml() ) . '>' . "\n"; for ($i = 0; $i < 60; $i++) { $hour = str_pad($i, 2, '0', STR_PAD_LEFT); - $html .= ''; } $html .= '' . "\n"; From 659ab34df850a093bc1018c85cfa890d8d945394 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 22:54:08 +0200 Subject: [PATCH 24/92] Fixed coding standard violation: Only one argument is allowed per line in a multi-line function call --- .../Css/Test/Unit/PreProcessor/Instruction/ImportTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php index 20c0dbb293584..ead00135bd574 100644 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/ImportTest.php @@ -36,9 +36,12 @@ class ImportTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->notationResolver = $this->getMock( - \Magento\Framework\View\Asset\NotationResolver\Module::class, [], [], '', false + \Magento\Framework\View\Asset\NotationResolver\Module::class, + [], + [], + '', + false ); $this->asset = $this->getMock(\Magento\Framework\View\Asset\File::class, [], [], '', false); $this->asset->expects($this->any())->method('getContentType')->will($this->returnValue('css')); From 68519e01ca5f97f2f4351bde60827f75b21d482c Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 23:03:53 +0200 Subject: [PATCH 25/92] Fixed coding standard violations: - Code must not contain multiple empty lines in a row; found 2 empty lines - Missing parameter name at position 1 --- lib/internal/Magento/Framework/Code/GeneratedFiles.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/GeneratedFiles.php b/lib/internal/Magento/Framework/Code/GeneratedFiles.php index 933c39f9359be..20839a2b4b2a7 100644 --- a/lib/internal/Magento/Framework/Code/GeneratedFiles.php +++ b/lib/internal/Magento/Framework/Code/GeneratedFiles.php @@ -132,7 +132,6 @@ private function getEnabledCacheTypes() return $enabledCacheTypes; } - /** * Returns path to env.php file * @@ -182,8 +181,7 @@ private function disableAllCacheTypes() * Enables apppropriate cache types in app/etc/env.php based on the passed in $cacheTypes array * TODO: to be removed in scope of MAGETWO-53476 * - * @param string[] - * + * @param string[] $cacheTypes * @return void */ private function enableCacheTypes($cacheTypes) From 4703ad27d114e77428bbf2124c8c5f238b343188 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 23:05:04 +0200 Subject: [PATCH 26/92] Fixed coding standard violation: Missing @return tag in function comment --- lib/internal/Magento/Framework/Validator/Factory.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/Validator/Factory.php b/lib/internal/Magento/Framework/Validator/Factory.php index 2938462aeba34..3fc93eeabe191 100644 --- a/lib/internal/Magento/Framework/Validator/Factory.php +++ b/lib/internal/Magento/Framework/Validator/Factory.php @@ -61,6 +61,8 @@ public function __construct( /** * Init cached list of validation files + * + * @return void */ protected function _initializeConfigList() { From 487bac35404f818834932b689dff405d8d6b4c9b Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 25 Oct 2016 23:09:05 +0200 Subject: [PATCH 27/92] Fixed coding violations: - Variable "no_errors" is not in valid camel caps format - Variable "dir_item" is not in valid camel caps format - is_null must be avoided. Use strict comparison instead. --- .../Magento/Framework/Filesystem/Io/Sftp.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php b/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php index 630a9eb3082bf..c5580461f8990 100644 --- a/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php +++ b/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php @@ -79,15 +79,15 @@ public function close() public function mkdir($dir, $mode = 0777, $recursive = true) { if ($recursive) { - $no_errors = true; + $noErrors = true; $dirList = explode('/', $dir); reset($dirList); $currentWorkingDir = $this->_connection->pwd(); - while ($no_errors && ($dir_item = next($dirList))) { - $no_errors = $this->_connection->mkdir($dir_item) && $this->_connection->chdir($dir_item); + while ($noErrors && ($dirItem = next($dirList))) { + $noErrors = $this->_connection->mkdir($dirItem) && $this->_connection->chdir($dirItem); } $this->_connection->chdir($currentWorkingDir); - return $no_errors; + return $noErrors; } else { return $this->_connection->mkdir($dir); } @@ -105,7 +105,7 @@ public function mkdir($dir, $mode = 0777, $recursive = true) public function rmdir($dir, $recursive = false) { if ($recursive) { - $no_errors = true; + $noErrors = true; $currentWorkingDir = $this->pwd(); if (!$this->_connection->chdir($dir)) { throw new \Exception("chdir(): {$dir}: Not a directory"); @@ -120,18 +120,18 @@ public function rmdir($dir, $recursive = false) if ($this->_connection->chdir($filename)) { // This is a directory $this->_connection->chdir('..'); - $no_errors = $no_errors && $this->rmdir($filename, $recursive); + $noErrors = $noErrors && $this->rmdir($filename, $recursive); } else { - $no_errors = $no_errors && $this->rm($filename); + $noErrors = $noErrors && $this->rm($filename); } } } - $no_errors = $no_errors && ($this->_connection->chdir( + $noErrors = $noErrors && ($this->_connection->chdir( $currentWorkingDir ) && $this->_connection->rmdir( $dir )); - return $no_errors; + return $noErrors; } else { return $this->_connection->rmdir($dir); } @@ -168,7 +168,7 @@ public function cd($dir) */ public function read($filename, $destination = null) { - if (is_null($destination)) { + if ($destination === null) { $destination = false; } return $this->_connection->get($filename, $destination); From abf7856b01f7e3bf7b53ebdd5c48a915fd790b02 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Wed, 26 Oct 2016 15:26:16 +0200 Subject: [PATCH 28/92] Fixed coding standard violations: - Line exceeds maximum limit of 120 characters; contains 121 characters - is_null must be avoided. Use strict comparison instead. --- .../Framework/Pricing/Render/RendererPool.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Pricing/Render/RendererPool.php b/lib/internal/Magento/Framework/Pricing/Render/RendererPool.php index 84ce0084e6a1a..fd10890422b0e 100644 --- a/lib/internal/Magento/Framework/Pricing/Render/RendererPool.php +++ b/lib/internal/Magento/Framework/Pricing/Render/RendererPool.php @@ -77,7 +77,9 @@ public function createPriceRender( $renderBlock = $this->getLayout()->createBlock($renderClassName, '', $arguments); if (!$renderBlock instanceof PriceBoxRenderInterface) { throw new \InvalidArgumentException( - 'Block "' . $renderClassName . '" must implement \Magento\Framework\Pricing\Render\PriceBoxRenderInterface' + 'Block "' . + $renderClassName . + '" must implement \Magento\Framework\Pricing\Render\PriceBoxRenderInterface' ); } $renderBlock->setTemplate($this->getRenderBlockTemplate($type, $priceCode)); @@ -140,7 +142,9 @@ public function createAmountRender( $amountBlock = $this->getLayout()->createBlock($renderClassName, '', $arguments); if (!$amountBlock instanceof AmountRenderInterface) { throw new \InvalidArgumentException( - 'Block "' . $renderClassName . '" must implement \Magento\Framework\Pricing\Render\AmountRenderInterface' + 'Block "' . + $renderClassName . + '" must implement \Magento\Framework\Pricing\Render\AmountRenderInterface' ); } $amountBlock->setTemplate($this->getAmountRenderBlockTemplate($type, $priceCode)); @@ -154,8 +158,8 @@ public function createAmountRender( */ public function getAdjustmentRenders(SaleableInterface $saleableItem = null, PriceInterface $price = null) { - $itemType = is_null($saleableItem) ? 'default' : $saleableItem->getTypeId(); - $priceType = is_null($price) ? 'default' : $price->getPriceCode(); + $itemType = $saleableItem === null ? 'default' : $saleableItem->getTypeId(); + $priceType = $price === null ? 'default' : $price->getPriceCode(); $fallbackPattern = [ "{$itemType}/adjustments/{$priceType}", From e8b1acb39346746a0edce76266070f23b341b18e Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Wed, 26 Oct 2016 15:29:10 +0200 Subject: [PATCH 29/92] Fixed coding standard violation: is_null must be avoided. Use strict comparison instead. --- lib/internal/Magento/Framework/HTTP/Adapter/Curl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php index be113354cc57c..8d3f9c25b1118 100644 --- a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php @@ -215,7 +215,7 @@ public function close() */ protected function _getResource() { - if (is_null($this->_resource)) { + if ($this->_resource === null) { $this->_resource = curl_init(); } return $this->_resource; From 210afe6ce81573c0971fb85cdfe7700d9655631f Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Wed, 26 Oct 2016 15:36:31 +0200 Subject: [PATCH 30/92] Fixed coding standard violation: is_null must be avoided. Use strict comparison instead. --- lib/internal/Magento/Framework/Config/Dom.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Config/Dom.php b/lib/internal/Magento/Framework/Config/Dom.php index 691241adfeac3..82429a33b2a61 100644 --- a/lib/internal/Magento/Framework/Config/Dom.php +++ b/lib/internal/Magento/Framework/Config/Dom.php @@ -240,7 +240,7 @@ protected function _mergeAttributes($baseNode, $mergeNode) */ protected function _getNodePathByParent(\DOMElement $node, $parentPath) { - $prefix = is_null($this->rootNamespace) ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; + $prefix = $this->rootNamespace === null ? '' : self::ROOT_NAMESPACE_PREFIX . ':'; $path = $parentPath . '/' . $prefix . $node->tagName; $idAttribute = $this->nodeMergingConfig->getIdAttribute($path); if (is_array($idAttribute)) { @@ -430,7 +430,7 @@ public function setSchemaFile($schemaFile) */ private function _getAttributeName($attribute) { - if (!is_null($attribute->prefix) && !empty($attribute->prefix)) { + if ($attribute->prefix !== null && !empty($attribute->prefix)) { $attributeName = $attribute->prefix . ':' . $attribute->name; } else { $attributeName = $attribute->name; From 3fdb62534df5a85db8673bbbe5f24c2309620fec Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Wed, 26 Oct 2016 15:39:06 +0200 Subject: [PATCH 31/92] Fixed coding standard violations: is_null must be avoided. Use strict comparison instead. --- lib/internal/Magento/Framework/Url.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/Url.php b/lib/internal/Magento/Framework/Url.php index fff8c9b3d781d..627c3f7b1a06d 100644 --- a/lib/internal/Magento/Framework/Url.php +++ b/lib/internal/Magento/Framework/Url.php @@ -138,6 +138,7 @@ class Url extends \Magento\Framework\DataObject implements \Magento\Framework\Ur /** * @var \Magento\Framework\Url\RouteParamsResolverFactory */ + private $_routeParamsResolverFactory; /** * @var \Magento\Framework\Url\ScopeResolverInterface @@ -267,7 +268,7 @@ public function setUseSession($useSession) */ public function getUseSession() { - if (is_null($this->_useSession)) { + if ($this->_useSession === null) { $this->_useSession = $this->_sidResolver->getUseSessionInUrl(); } return $this->_useSession; @@ -282,7 +283,7 @@ public function getUseSession() */ public function getConfigData($key, $prefix = null) { - if (is_null($prefix)) { + if ($prefix === null) { $prefix = 'web/' . ($this->_isSecure() ? 'secure' : 'unsecure') . '/'; } $path = $prefix . $key; @@ -560,7 +561,7 @@ protected function _getRoutePath($routeParams = []) $routePath = $this->_getActionPath(); if ($this->_getRouteParams()) { foreach ($this->_getRouteParams() as $key => $value) { - if (is_null($value) || false === $value || '' === $value || !is_scalar($value)) { + if ($value === null || false === $value || '' === $value || !is_scalar($value)) { continue; } $routePath .= $key . '/' . $value . '/'; @@ -930,7 +931,7 @@ private function createUrl($routePath = null, array $routeParams = null) $this->_queryParamsResolver->unsetData('query_params'); } - if (!is_null($fragment)) { + if ($fragment !== null) { $url .= '#' . $this->getEscaper()->encodeUrlParam($fragment); } $this->getRouteParamsResolver()->unsetData('secure'); @@ -1064,7 +1065,7 @@ function ($match) { public function useSessionIdForUrl($secure = false) { $key = 'use_session_id_for_url_' . (int)$secure; - if (is_null($this->getData($key))) { + if ($this->getData($key) === null) { $httpHost = $this->_request->getHttpHost(); $urlHost = parse_url( $this->_getScope()->getBaseUrl(UrlInterface::URL_TYPE_LINK, $secure), From 9681a7345c96fb6b6d8e11f5fd20b926a443c640 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Fri, 18 Nov 2016 22:19:26 +0100 Subject: [PATCH 32/92] - Fixed coding standard error Use ::class notation instead. - Fixed coding standard error Empty line missed - Fixed coding standard error Line indented incorrectly; expected at least 8 spaces, found 0 --- .../ObjectManager/Code/Generator/Repository.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php index 71c1995d92b0d..09ec376377fb9 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php +++ b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php @@ -22,9 +22,9 @@ class Repository extends \Magento\Framework\Code\Generator\EntityAbstract /** * No Such Entity Exception */ - const NO_SUCH_ENTITY_EXCEPTION = '\Magento\Framework\Exception\NoSuchEntityException'; - const INPUT_EXCEPTION = '\Magento\Framework\Exception\InputException'; - const SEARCH_CRITERIA = '\Magento\Framework\Api\SearchCriteria'; + const NO_SUCH_ENTITY_EXCEPTION = \Magento\Framework\Exception\NoSuchEntityException::class; + const INPUT_EXCEPTION = \Magento\Framework\Exception\InputException::class; + const SEARCH_CRITERIA = \Magento\Framework\Api\SearchCriteria::class; /** * Retrieve class properties @@ -135,6 +135,7 @@ protected function _getCollectionFactoryClassName() return str_replace('Interface', '', $this->getSourceClassName()) . 'SearchResultInterfaceFactory'; } + /** * Returns source persistor class name * @@ -143,9 +144,9 @@ protected function _getCollectionFactoryClassName() protected function _getPersistorClassName() { $target = $this->getSourceClassName(); -// if (substr($target, -9) == 'Interface') { -// $target = substr($target, 1, strlen($target) -9); -// } + // if (substr($target, -9) == 'Interface') { + // $target = substr($target, 1, strlen($target) -9); + // } return $target . 'Persistor'; } From 5d87dbdfe9f991130c23eb4e90936714738b2170 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Fri, 18 Nov 2016 22:31:08 +0100 Subject: [PATCH 33/92] Fixed coding standard error: Missing parameter name at position 1 --- lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php b/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php index 87c76ea518b4b..863492196debb 100644 --- a/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php +++ b/lib/internal/Magento/Framework/File/Transfer/Adapter/Http.php @@ -19,7 +19,7 @@ class Http private $mime; /** - * @param \Magento\Framework\App\Response\Http + * @param \Magento\Framework\App\Response\Http $response * @param \Magento\Framework\File\Mime $mime */ public function __construct( From 482ce96efe25b114c02ef1307e65010939800589 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Fri, 18 Nov 2016 22:36:12 +0100 Subject: [PATCH 34/92] - Fixed coding standard error Line exceeds maximum limit of 120 characters; contains characters - Fixed coding standard error Code must not contain multiple empty lines in a row; found 2 empty lines - Fixed coding standard error is_null must be avoided. Use strict comparison instead. --- .../Magento/Framework/DB/Adapter/Pdo/Mysql.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index 6f04a2a7c38d8..a9b238a13ad36 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -497,7 +497,9 @@ protected function _query($sql, $bind = []) $pdoException = null; if ($e instanceof \PDOException) { $pdoException = $e; - } elseif (($e instanceof \Zend_Db_Statement_Exception) && ($e->getPrevious() instanceof \PDOException)) { + } elseif (($e instanceof \Zend_Db_Statement_Exception) + && ($e->getPrevious() instanceof \PDOException) + ) { $pdoException = $e->getPrevious(); } @@ -527,7 +529,6 @@ protected function _query($sql, $bind = []) } while ($retry); } - /** * Special handling for PDO query(). * All bind parameter names must begin with ':'. @@ -1616,7 +1617,7 @@ public function getColumnCreateByDescribe($columnData) if ($columnData['PRIMARY'] === true) { $options['primary'] = true; } - if (!is_null($columnData['DEFAULT']) + if ($columnData['DEFAULT'] !== null) && $type != Table::TYPE_TEXT ) { $options['default'] = $this->quote($columnData['DEFAULT']); @@ -1723,7 +1724,7 @@ public function modifyColumnByDdl($tableName, $columnName, $definition, $flushDa { $definition = array_change_key_case($definition, CASE_UPPER); $definition['COLUMN_TYPE'] = $this->_getColumnTypeByDdl($definition); - if (array_key_exists('DEFAULT', $definition) && is_null($definition['DEFAULT'])) { + if (array_key_exists('DEFAULT', $definition) && $definition['DEFAULT'] === null) { unset($definition['DEFAULT']); } @@ -2412,7 +2413,7 @@ protected function _getColumnDefinition($options, $ddlType = null) } else { $cDefault = false; } - } elseif (is_null($cDefault) && $cNullable) { + } elseif ($cDefault === null && $cNullable) { $cDefault = new \Zend_Db_Expr('NULL'); } @@ -2908,7 +2909,7 @@ public function prepareColumnValue(array $column, $value) } // return null - if (is_null($value) && $column['NULLABLE']) { + if ($value === null && $column['NULLABLE']) { return null; } @@ -3173,7 +3174,7 @@ public function getDatePartSql($date) */ public function getSubstringSql($stringExpression, $pos, $len = null) { - if (is_null($len)) { + if ($len === null) { return new \Zend_Db_Expr(sprintf('SUBSTRING(%s, %s)', $stringExpression, $pos)); } return new \Zend_Db_Expr(sprintf('SUBSTRING(%s, %s, %s)', $stringExpression, $pos, $len)); @@ -3798,7 +3799,7 @@ public function __destruct() */ public function getTables($likeCondition = null) { - $sql = is_null($likeCondition) ? 'SHOW TABLES' : sprintf("SHOW TABLES LIKE '%s'", $likeCondition); + $sql = $likeCondition === null ? 'SHOW TABLES' : sprintf("SHOW TABLES LIKE '%s'", $likeCondition); $result = $this->query($sql); $tables = []; while ($row = $result->fetchColumn()) { From df42723b07512adf4f5434b7d16496f690a263fb Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Fri, 18 Nov 2016 22:39:09 +0100 Subject: [PATCH 35/92] Fixed typo mistake fixing error. --- lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index a9b238a13ad36..806685d4d29ea 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -1617,9 +1617,7 @@ public function getColumnCreateByDescribe($columnData) if ($columnData['PRIMARY'] === true) { $options['primary'] = true; } - if ($columnData['DEFAULT'] !== null) - && $type != Table::TYPE_TEXT - ) { + if ($columnData['DEFAULT'] !== null && $type != Table::TYPE_TEXT) { $options['default'] = $this->quote($columnData['DEFAULT']); } if (strlen($columnData['SCALE']) > 0) { From 7d9ccb63dd4573e072abe5a5f65302ef6536e9ae Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Fri, 18 Nov 2016 22:42:42 +0100 Subject: [PATCH 36/92] Fixed coding standard error: Opening parenthesis of a multi-line function call must be the last content on the line --- .../View/Test/Unit/Layout/Reader/MoveTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/MoveTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/MoveTest.php index 04308256a00f5..95591f194f46e 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/MoveTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Reader/MoveTest.php @@ -75,9 +75,9 @@ public function processDataProvider() { return [ 'move_before' => [ - 'element' => new \Magento\Framework\View\Layout\Element(' - - '), + 'element' => new \Magento\Framework\View\Layout\Element( + '' + ), 'destination' => 'product.info', 'siblingName' => 'before.block', 'isAfter' => false, @@ -85,9 +85,9 @@ public function processDataProvider() 'parentElement' => new \Magento\Framework\View\Layout\Element(''), ], 'move_after' => [ - 'element' => new \Magento\Framework\View\Layout\Element(' - - '), + 'element' => new \Magento\Framework\View\Layout\Element( + '' + ), 'destination' => 'product.info', 'siblingName' => 'after.block', 'isAfter' => true, From 8c6bcc709da212819b4962ab3ed3793b631937d3 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Fri, 18 Nov 2016 22:56:24 +0100 Subject: [PATCH 37/92] - Fixed coding standard error: Expected 1 space(s) before asterisk; 0 found - Fixed coding standard error: Line exceeds maximum limit of 120 characters; - Fixed coding standard error: Missing parameter name at position 1 --- .../Framework/Cache/Backend/Database.php | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/lib/internal/Magento/Framework/Cache/Backend/Database.php b/lib/internal/Magento/Framework/Cache/Backend/Database.php index 494b9f69c253e..c7a8269109860 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/Database.php +++ b/lib/internal/Magento/Framework/Cache/Backend/Database.php @@ -5,25 +5,26 @@ */ /** -Tables declaration: - -CREATE TABLE IF NOT EXISTS `cache` ( - `id` VARCHAR(255) NOT NULL, - `data` mediumblob, - `create_time` int(11), - `update_time` int(11), - `expire_time` int(11), - PRIMARY KEY (`id`), - KEY `IDX_EXPIRE_TIME` (`expire_time`) -)ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `cache_tag` ( - `tag` VARCHAR(255) NOT NULL, - `cache_id` VARCHAR(255) NOT NULL, - KEY `IDX_TAG` (`tag`), - KEY `IDX_CACHE_ID` (`cache_id`), - CONSTRAINT `FK_CORE_CACHE_TAG` FOREIGN KEY (`cache_id`) REFERENCES `cache` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * Tables declaration: + * + * CREATE TABLE IF NOT EXISTS `cache` ( + * `id` VARCHAR(255) NOT NULL, + * `data` mediumblob, + * `create_time` int(11), + * `update_time` int(11), + * `expire_time` int(11), + * PRIMARY KEY (`id`), + * KEY `IDX_EXPIRE_TIME` (`expire_time`) + * )ENGINE=InnoDB DEFAULT CHARSET=utf8; + * + * CREATE TABLE IF NOT EXISTS `cache_tag` ( + * `tag` VARCHAR(255) NOT NULL, + * `cache_id` VARCHAR(255) NOT NULL, + * KEY `IDX_TAG` (`tag`), + * KEY `IDX_CACHE_ID` (`cache_id`), + * CONSTRAINT `FK_CORE_CACHE_TAG` FOREIGN KEY (`cache_id`) + * REFERENCES `cache` (`id`) ON DELETE CASCADE ON UPDATE CASCADE + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; */ /** @@ -198,7 +199,7 @@ public function test($id) * @param string $data Datas to cache * @param string $id Cache id * @param string[] $tags Array of strings, the cache record will be tagged by each string entry - * @param int|bool $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime) + * @param int|bool $specificLifetime Integer to set a specific lifetime or null for infinite lifetime * @return bool true if no problem */ public function save($data, $id, $tags = [], $specificLifetime = false) @@ -223,7 +224,8 @@ public function save($data, $id, $tags = [], $specificLifetime = false) 'create_time' )},\n {$connection->quoteIdentifier( 'update_time' - )},\n {$expireCol})\n VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE\n {$dataCol}=VALUES({$dataCol}),\n {$expireCol}=VALUES({$expireCol})"; + )},\n {$expireCol})\n VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE\n + {$dataCol}=VALUES({$dataCol}),\n {$expireCol}=VALUES({$expireCol})"; $result = $connection->query($query, [$id, $data, $time, $time, $expire])->rowCount(); } @@ -555,10 +557,10 @@ protected function _cleanByTags($mode, $tags) /** * Clean all cache entries * - * @param $connection + * @param \Magento\Framework\DB\Adapter\AdapterInterface $connection * @return bool */ - private function cleanAll($connection) + private function cleanAll(\Magento\Framework\DB\Adapter\AdapterInterface $connection) { if ($this->_options['store_data']) { $result = $connection->query('TRUNCATE TABLE ' . $this->_getDataTable()); @@ -572,10 +574,10 @@ private function cleanAll($connection) /** * Clean old cache entries * - * @param $connection + * @param \Magento\Framework\DB\Adapter\AdapterInterface $connection * @return bool */ - private function cleanOld($connection) + private function cleanOld(\Magento\Framework\DB\Adapter\AdapterInterface $connection) { if ($this->_options['store_data']) { $result = $connection->delete( From 9933c46a4744cf0b964aec4c9a5151dc98339dff Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Fri, 18 Nov 2016 23:02:57 +0100 Subject: [PATCH 38/92] - Fixed coding standard error: Variable "line_number" is not in valid camel caps format - Fixed coding standard error: Line exceeds maximum limit of 120 characters; - Fixed coding standard error: Variable "tmp_value" is not in valid camel caps format - Fixed coding standard error: Variable "tmp_line" is not in valid camel caps format --- .../Magento/Framework/File/CsvMulty.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/internal/Magento/Framework/File/CsvMulty.php b/lib/internal/Magento/Framework/File/CsvMulty.php index 5f6e2de205763..2308bd8d632e1 100644 --- a/lib/internal/Magento/Framework/File/CsvMulty.php +++ b/lib/internal/Magento/Framework/File/CsvMulty.php @@ -25,25 +25,23 @@ public function getDataPairs($file, $keyIndex = 0, $valueIndex = 1) { $data = []; $csvData = $this->getData($file); - $line_number = 0; + $lineNumber = 0; foreach ($csvData as $rowData) { - $line_number++; + $lineNumber++; if (isset($rowData[$keyIndex])) { if (isset($data[$rowData[$keyIndex]])) { if (isset($data[$rowData[$keyIndex]]['duplicate'])) { - #array_push($data[$rowData[$keyIndex]]['duplicate'],array('line' => $line_number,'value' => isset($rowData[$valueIndex]) ? $rowData[$valueIndex] : null)); - $data[$rowData[$keyIndex]]['duplicate']['line'] .= ', ' . $line_number; + $data[$rowData[$keyIndex]]['duplicate']['line'] .= ', ' . $lineNumber; } else { - $tmp_value = $data[$rowData[$keyIndex]]['value']; - $tmp_line = $data[$rowData[$keyIndex]]['line']; + $tmpValue = $data[$rowData[$keyIndex]]['value']; + $tmpLine = $data[$rowData[$keyIndex]]['line']; $data[$rowData[$keyIndex]]['duplicate'] = []; - #array_push($data[$rowData[$keyIndex]]['duplicate'],array('line' => $tmp_line.' ,'.$line_number,'value' => $tmp_value)); - $data[$rowData[$keyIndex]]['duplicate']['line'] = $tmp_line . ' ,' . $line_number; - $data[$rowData[$keyIndex]]['duplicate']['value'] = $tmp_value; + $data[$rowData[$keyIndex]]['duplicate']['line'] = $tmpLine . ' ,' . $lineNumber; + $data[$rowData[$keyIndex]]['duplicate']['value'] = $tmpValue; } } else { $data[$rowData[$keyIndex]] = []; - $data[$rowData[$keyIndex]]['line'] = $line_number; + $data[$rowData[$keyIndex]]['line'] = $lineNumber; $data[$rowData[$keyIndex]]['value'] = isset($rowData[$valueIndex]) ? $rowData[$valueIndex] : null; } } From a9be415dc649f9292a1e1f90f69faaca8ed8da0e Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sat, 19 Nov 2016 23:47:44 +0100 Subject: [PATCH 39/92] Fixed coding standard errors: - Line exceeds maximum limit of 120 characters; - is_null must be avoided. Use strict comparison instead. --- .../Magento/Framework/Module/ModuleResource.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Module/ModuleResource.php b/lib/internal/Magento/Framework/Module/ModuleResource.php index 325420f4b12df..acedd79548d67 100644 --- a/lib/internal/Magento/Framework/Module/ModuleResource.php +++ b/lib/internal/Magento/Framework/Module/ModuleResource.php @@ -6,10 +6,12 @@ namespace Magento\Framework\Module; +use \Magento\Framework\Model\ResourceModel\Db\AbstractDb; + /** * Resource Model */ -class ModuleResource extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb implements \Magento\Framework\Module\ResourceInterface +class ModuleResource extends AbstractDb implements ResourceInterface { /** * Database versions @@ -47,7 +49,9 @@ protected function _construct() */ protected function _loadVersion($needType) { - if ($needType == 'db' && is_null(self::$schemaVersions) || $needType == 'data' && is_null(self::$dataVersions)) { + if ($needType == 'db' && self::$schemaVersions === null || + $needType == 'data' && self::$dataVersions === null + ) { self::$schemaVersions = []; // Db version column always exists self::$dataVersions = null; @@ -59,7 +63,7 @@ protected function _loadVersion($needType) foreach ($rowset as $row) { self::$schemaVersions[$row['module']] = $row['schema_version']; if (array_key_exists('data_version', $row)) { - if (is_null(self::$dataVersions)) { + if (self::$dataVersions === null) { self::$dataVersions = []; } self::$dataVersions[$row['module']] = $row['data_version']; From c1935f1178777a6f4150ef0cd38e91f5ca17b2e2 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sat, 19 Nov 2016 23:59:55 +0100 Subject: [PATCH 40/92] Fixed coding standard error: Line exceeds maximum limit of 120 characters; --- .../Framework/Interception/Test/Unit/Config/ConfigTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php index db449c0f4030b..c5796325e5b89 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php @@ -120,12 +120,15 @@ public function testHasPluginsWhenDataIsNotCached($expectedResult, $type, $entit \Magento\Framework\Interception\Custom\Module\Model\Backslash\ItemProxy::class ], [ - 'virtual_custom_item', \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, + 'virtual_custom_item', + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, ], ] )); $this->definitionMock->expects($this->any())->method('getClasses')->will($this->returnValue( - [\Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, \Magento\Framework\Interception\Custom\Module\Model\Backslash\ItemProxy::class, + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, + \Magento\Framework\Interception\Custom\Module\Model\Backslash\ItemProxy::class, ] )); $this->relationsMock->expects($this->any())->method('has')->will($this->returnValue($expectedResult)); From 8b937d95106c7fa308b5620ce47d5d00dce1b53f Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 00:10:16 +0100 Subject: [PATCH 41/92] - Changed type, removed extra space from comment - Fixed coding standard error: Line exceeds maximum limit of 120 characters; --- lib/internal/Magento/Framework/Cache/Backend/Database.php | 2 +- .../Magento/Framework/Cache/Backend/Eaccelerator.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Cache/Backend/Database.php b/lib/internal/Magento/Framework/Cache/Backend/Database.php index c7a8269109860..d4409d6bd15f0 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/Database.php +++ b/lib/internal/Magento/Framework/Cache/Backend/Database.php @@ -199,7 +199,7 @@ public function test($id) * @param string $data Datas to cache * @param string $id Cache id * @param string[] $tags Array of strings, the cache record will be tagged by each string entry - * @param int|bool $specificLifetime Integer to set a specific lifetime or null for infinite lifetime + * @param int|bool $specificLifetime Integer to set a specific lifetime or null for infinite lifetime * @return bool true if no problem */ public function save($data, $id, $tags = [], $specificLifetime = false) diff --git a/lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php b/lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php index cf5e1aefbe1d6..5a4a91c18aa11 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php +++ b/lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php @@ -74,7 +74,7 @@ public function test($id) * @param string $data datas to cache * @param string $id cache id * @param string[] $tags array of strings, the cache record will be tagged by each string entry - * @param int|bool $specificLifetime if != false, set a specific lifetime for this cache record (null => infinite lifetime) + * @param int|bool $specificLifetime Integer to set a specific lifetime or null for infinite lifetime * @return bool true if no problem */ public function save($data, $id, $tags = [], $specificLifetime = false) @@ -122,7 +122,8 @@ public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = []) break; case \Zend_Cache::CLEANING_MODE_OLD: $this->_log( - "Magento\Framework\Cache\Backend\Eaccelerator::clean() : CLEANING_MODE_OLD is unsupported by the Eaccelerator backend" + "Magento\Framework\Cache\Backend\Eaccelerator::clean() : ". + "CLEANING_MODE_OLD is unsupported by the Eaccelerator backend" ); break; case \Zend_Cache::CLEANING_MODE_MATCHING_TAG: From bf2ef2579ca00b69bcbf6424a91b64746732d93b Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 00:14:09 +0100 Subject: [PATCH 42/92] Fixed coding standard error: Line exceeds maximum limit of 120 characters --- .../InterfaceValidator/ItemPlugin/ValidPlugin.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ValidPlugin.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ValidPlugin.php index 2d589c8678c0e..3a3d8ea4591b0 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ValidPlugin.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Custom/Module/Model/InterfaceValidator/ItemPlugin/ValidPlugin.php @@ -6,38 +6,40 @@ namespace Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin; +use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments; + class ValidPlugin { /** - * @param \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject + * @param ItemWithArguments $subject * @param string $result * @return string * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetItem( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, + ItemWithArguments $subject, $result ) { return $result . '!'; } /** - * @param \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject + * @param ItemWithArguments $subject * @param $name * @return string * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeGetItem( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, + ItemWithArguments $subject, $name ) { return '|' . $name; } /** - * @param \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject + * @param ItemWithArguments $subject * @param Closure $proceed * @param string $name * @return string @@ -45,7 +47,7 @@ public function beforeGetItem( * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundGetItem( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, + ItemWithArguments $subject, \Closure $proceed, $name ) { From 44c4b077a2a486474593084773178082dd9360e6 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 00:15:50 +0100 Subject: [PATCH 43/92] Trimmed whitespaces at the end of the line in order to fix coding standards: Line exceeds maximum limit of 120 characters --- lib/internal/Magento/Framework/Cache/Backend/Database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Cache/Backend/Database.php b/lib/internal/Magento/Framework/Cache/Backend/Database.php index d4409d6bd15f0..03af912a330bd 100644 --- a/lib/internal/Magento/Framework/Cache/Backend/Database.php +++ b/lib/internal/Magento/Framework/Cache/Backend/Database.php @@ -224,7 +224,7 @@ public function save($data, $id, $tags = [], $specificLifetime = false) 'create_time' )},\n {$connection->quoteIdentifier( 'update_time' - )},\n {$expireCol})\n VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE\n + )},\n {$expireCol})\n VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE\n {$dataCol}=VALUES({$dataCol}),\n {$expireCol}=VALUES({$expireCol})"; $result = $connection->query($query, [$id, $data, $time, $time, $expire])->rowCount(); From 6ea3f9aa9a4c90f8ee14e89453204f4139b0b96f Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 11:49:42 +0100 Subject: [PATCH 44/92] Corrected coding standard errors: - Multi-line function call not indented correctly - Line exceeds maximum limit of 120 characters --- .../Test/Unit/Code/InterfaceValidatorTest.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php index 95752d0dbbf81..2cb2c6a5d7783 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php @@ -7,6 +7,10 @@ namespace Magento\Framework\Interception\Test\Unit\Code; use \Magento\Framework\Interception\Code\InterfaceValidator; +use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\ValidPlugin; +use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\IncompatibleInterface; +use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\IncorrectSubject; +use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\ExtraParameters; class InterfaceValidatorTest extends \PHPUnit_Framework_TestCase { @@ -49,7 +53,7 @@ protected function setUp() public function testValidate() { $this->model->validate( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\ValidPlugin::class, + ValidPlugin::class, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments::class ); } @@ -62,7 +66,7 @@ public function testValidate() public function testValidateIncorrectInterface() { $this->model->validate( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\IncompatibleInterface::class, + IncompatibleInterface::class, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\Item::class ); } @@ -75,7 +79,7 @@ public function testValidateIncorrectInterface() public function testValidateIncorrectSubjectType() { $this->model->validate( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\IncorrectSubject::class, + IncorrectSubject::class, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\Item::class ); } @@ -89,8 +93,8 @@ public function testValidateIncorrectSubjectType() public function testValidateIncompatibleMethodArgumentsCount() { $this->model->validate( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model::class - . '\InterfaceValidator\ItemPlugin\IncompatibleArgumentsCount', + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model::class . + '\InterfaceValidator\ItemPlugin\IncompatibleArgumentsCount', \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\Item::class ); } @@ -104,8 +108,8 @@ public function testValidateIncompatibleMethodArgumentsCount() public function testValidateIncompatibleMethodArgumentsType() { $this->model->validate( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model::class - . '\InterfaceValidator\ItemPlugin\IncompatibleArgumentsType', + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model::class . + '\InterfaceValidator\ItemPlugin\IncompatibleArgumentsType', \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments::class ); } @@ -118,7 +122,7 @@ public function testValidateIncompatibleMethodArgumentsType() public function testValidateExtraParameters() { $this->model->validate( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\ExtraParameters::class, + ExtraParameters::class, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\Item::class ); } From 4ac5bb19038c33e7cadc738174573ffff56e3b17 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 11:53:54 +0100 Subject: [PATCH 45/92] Fixed coding standard error: Line exceeds maximum limit of 120 characters --- lib/internal/Magento/Framework/Backup/Filesystem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Backup/Filesystem.php b/lib/internal/Magento/Framework/Backup/Filesystem.php index 6576cf5bcc03c..49db0b1c579b6 100644 --- a/lib/internal/Magento/Framework/Backup/Filesystem.php +++ b/lib/internal/Magento/Framework/Backup/Filesystem.php @@ -106,7 +106,8 @@ public function create() $filesInfo = $fsHelper->getInfo( $this->getRootDir(), - \Magento\Framework\Backup\Filesystem\Helper::INFO_READABLE | \Magento\Framework\Backup\Filesystem\Helper::INFO_SIZE, + \Magento\Framework\Backup\Filesystem\Helper::INFO_READABLE | + \Magento\Framework\Backup\Filesystem\Helper::INFO_SIZE, $this->getIgnorePaths() ); From 705375ec9823867c71d3a00e4da17980a0f25b3c Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 11:57:38 +0100 Subject: [PATCH 46/92] Fixed coding standard errors: - Line exceeds maximum limit of 120 characters - Code must not contain multiple empty lines in a row --- .../Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php index 08deba9b6ccd8..7e4721c1c5c2a 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php @@ -498,7 +498,9 @@ public function testPrepareDataForUpdate() $abstractModelMock->afterLoad(); $this->assertEquals($abstractModelMock->getData(), $abstractModelMock->getStoredData()); $newData = ['value' => 'Test Value New']; - $this->_model->expects($this->atLeastOnce())->method('_prepareDataForTable')->will($this->returnValue($newData)); + $this->_model->expects($this->atLeastOnce()) + ->method('_prepareDataForTable') + ->will($this->returnValue($newData)); $abstractModelMock->addData($newData); $this->assertNotEquals($abstractModelMock->getData(), $abstractModelMock->getStoredData()); $abstractModelMock->isObjectNew(false); @@ -569,7 +571,6 @@ public function testSaveNewObject($pkIncrement) $idFieldName = 'id_field_name'; $model->expects($this->once())->method('_prepareDataForSave')->willReturn([$idFieldName => 'id']); - // Test expectations // Only get object's id field name if not PK autoincrement $getIdFieldNameInvokedCount = $pkIncrement ? 1 : 0; From ee131c90a8b1ce3ba660c0bba2a0e796e398ca32 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 12:39:51 +0100 Subject: [PATCH 47/92] Fixed coding standard error: Line exceeds maximum limit of 120 characters --- .../Magento/Framework/Data/Form/Element/Gallery.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php b/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php index 2827f8273cf32..ea7eebdc92d85 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Gallery.php @@ -41,7 +41,15 @@ public function getElementHtml() $gallery = $this->getValue(); $html = '
'; - $html .= ''; + $html .= '' . + '' . + '' . + '' . + '' . + '' . + '' . + ''. + ''; $widgetButton = $this->getForm()->getParent()->getLayout(); $buttonHtml = $widgetButton->createBlock( \Magento\Backend\Block\Widget\Button::class From e27f3e306d07b6480b53470aa542d6f776f62b76 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 12:44:22 +0100 Subject: [PATCH 48/92] Fixed coding standard errors: - is_null must be avoided. Use strict comparison instead - Line exceeds maximum limit of 120 characters --- .../Magento/Framework/Data/Form/Element/Editor.php | 10 +++++++++- .../Magento/Framework/Data/Form/Element/Gallery.php | 12 ++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php index 3792badf61a0a..298c456d7ecdc 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php @@ -121,7 +121,15 @@ public function getElementHtml() ' '; + $html .= ''; } $html .= ''; From c061f6552f978c3b98ea6d4f02416d1a374b3d79 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 12:46:08 +0100 Subject: [PATCH 49/92] Fixed coding standard error: Missing parameter name at position 1 --- lib/internal/Magento/Framework/Config/Dom.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Config/Dom.php b/lib/internal/Magento/Framework/Config/Dom.php index 82429a33b2a61..45afa71eb556c 100644 --- a/lib/internal/Magento/Framework/Config/Dom.php +++ b/lib/internal/Magento/Framework/Config/Dom.php @@ -113,7 +113,7 @@ public function __construct( /** * Retrieve array of xml errors * - * @param $errorFormat + * @param string $errorFormat * @return string[] */ private static function getXmlErrors($errorFormat) From e7e4213ee8939713311ccccf9a65ccab736b39f1 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 13:41:45 +0100 Subject: [PATCH 50/92] Fixed coding standard error: There must be one blank line after the namespace declaration --- lib/internal/Magento/Framework/Test/Unit/UrlTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php index 48c4c1dfcded3..8aad9675f9a8e 100644 --- a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\Test\Unit; + use Magento\Framework\Url\HostChecker; /** From 281c74c1c9295b679cded3f8398d6ab82f75fb4f Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 13:49:42 +0100 Subject: [PATCH 51/92] Surpressing coupling between objects for PHP MD --- lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php index c8457aadfc4c6..e6f1727a1e428 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer.php @@ -15,6 +15,8 @@ /** * Deployment configuration writer + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Writer { From fa476acec2038a9bd6103d2e72281b4e5933298d Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 13:51:32 +0100 Subject: [PATCH 52/92] Surpressing coupling between objects for PHP MD --- .../Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php index c6054bc2329df..f9d8ae7165eea 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php @@ -15,6 +15,11 @@ use Magento\Framework\Model\ResourceModel\Type\Db\Pdo\Mysql; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +/** + * Mysql test + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class MysqlTest extends \PHPUnit_Framework_TestCase { /** From 763a2c8d7288f802d301a76914f9c2e372e8f06c Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 13:53:05 +0100 Subject: [PATCH 53/92] Surpressing coupling between objects for PHP MD --- .../Magento/Framework/HTTP/PhpEnvironment/Request.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php index 11cf55d8c8429..1558ee912254b 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php @@ -13,6 +13,11 @@ use Zend\Uri\UriFactory; use Zend\Uri\UriInterface; +/** + * HTTP Request + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class Request extends \Zend\Http\PhpEnvironment\Request { /**#@+ From d9da868a84ef626e881d1450c56338125eb5c2ae Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 13:55:28 +0100 Subject: [PATCH 54/92] Surpressing coupling between objects for PHP MD --- .../Magento/Framework/View/TemplateEngine/Xhtml/Compiler.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/View/TemplateEngine/Xhtml/Compiler.php b/lib/internal/Magento/Framework/View/TemplateEngine/Xhtml/Compiler.php index 88c1a625bb56a..fba22cf997207 100644 --- a/lib/internal/Magento/Framework/View/TemplateEngine/Xhtml/Compiler.php +++ b/lib/internal/Magento/Framework/View/TemplateEngine/Xhtml/Compiler.php @@ -14,6 +14,8 @@ /** * Class Compiler + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Compiler implements CompilerInterface { From a422e7dc297905d13e9b227334fe865868fcd725 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 13:56:29 +0100 Subject: [PATCH 55/92] Fixed coding standard errors: - Line exceeds maximum limit of 120 characters - Surpressed: Avoid unused parameters such as '$skipRoot'. --- lib/internal/Magento/Framework/Backup/Archive/Tar.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Backup/Archive/Tar.php b/lib/internal/Magento/Framework/Backup/Archive/Tar.php index 3abd3b0347d40..9f741a924ae05 100644 --- a/lib/internal/Magento/Framework/Backup/Archive/Tar.php +++ b/lib/internal/Magento/Framework/Backup/Archive/Tar.php @@ -21,14 +21,15 @@ class Tar extends \Magento\Framework\Archive\Tar protected $_skipFiles = []; /** - * Overridden \Magento\Framework\Archive\Tar::_createTar method that does the same actions as it's parent but filters - * files using \Magento\Framework\Backup\Filesystem\Iterator\Filter + * Overridden \Magento\Framework\Archive\Tar::_createTar method that does the same actions as it's parent but + * filters files using \Magento\Framework\Backup\Filesystem\Iterator\Filter * * @param bool $skipRoot * @param bool $finalize * @return void * * @see \Magento\Framework\Archive\Tar::_createTar() + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _createTar($skipRoot = false, $finalize = false) { From 87869d26957bb612f5055b49caa13c4bcac0ae7f Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 15:09:42 +0100 Subject: [PATCH 56/92] Fixed PHP MD error: Surpress npath complexity --- lib/internal/Magento/Framework/Api/DataObjectHelper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Api/DataObjectHelper.php b/lib/internal/Magento/Framework/Api/DataObjectHelper.php index 6139338996529..d455040eee7ff 100644 --- a/lib/internal/Magento/Framework/Api/DataObjectHelper.php +++ b/lib/internal/Magento/Framework/Api/DataObjectHelper.php @@ -144,6 +144,7 @@ protected function _setDataValues($dataObject, array $data, $interfaceName) * @param string $interfaceName * @return $this * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function setComplexValue( $dataObject, From 0a114557b27a7679406131e23a78a5fda8e47c66 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 15:11:37 +0100 Subject: [PATCH 57/92] Fixed PHP MD error: Suppress Excessive method length --- .../Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php index 7e4721c1c5c2a..0539392441b19 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php @@ -430,6 +430,9 @@ public function hasDataChangedDataProvider() ]; } + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ public function testPrepareDataForUpdate() { $connectionMock = $this->getMock(AdapterInterface::class, [], [], '', false); From f062a2a67c67ad2b50fd894bf62d8c3d65457c31 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 15:14:14 +0100 Subject: [PATCH 58/92] Fixed PHP MD error: Surpressed warning for excessive class complexity. --- lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php index 1558ee912254b..dc73bcfa35b44 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php @@ -17,6 +17,7 @@ * HTTP Request * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class Request extends \Zend\Http\PhpEnvironment\Request { From b36b01b1bfe181cc1ccbb96f52df791367a8ced7 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 15:56:48 +0100 Subject: [PATCH 59/92] Fixed coding standard violation --- lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php b/lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php index 11479c9b79885..22fc95bf44068 100644 --- a/lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php +++ b/lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php @@ -27,7 +27,8 @@ class MaliciousCode implements \Zend_Filter_Interface //js in the style attribute '/style=[^<]*((expression\s*?\([^<]*?\))|(behavior\s*:))[^<]*(?=\/*\>)/Uis', //js attributes - '/(ondblclick|onclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onload|onunload|onerror)=[^<]*(?=\/*\>)/Uis', + '/(ondblclick|onclick|onkeydown|onkeypress|onkeyup|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|'. + 'onload|onunload|onerror)=[^<]*(?=\/*\>)/Uis', //tags '/<\/?(script|meta|link|frame|iframe|object).*>/Uis', //base64 usage From 1f914d50ce3ba4c129943bff5c03c3443a6db318 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 16:01:10 +0100 Subject: [PATCH 60/92] Fixed coding standard violation: Line exceeds maximum limit of 120 characters --- .../Magento/Framework/View/Test/Unit/FileSystemTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php b/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php index 25cb0273d2a21..e62c2d1d1c93e 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/FileSystemTest.php @@ -9,6 +9,8 @@ */ namespace Magento\Framework\View\Test\Unit; +use \Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile; + class FileSystemTest extends \PHPUnit_Framework_TestCase { /** @@ -37,7 +39,7 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase protected $_staticFileResolution; /** - * @var \Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile|\PHPUnit_Framework_MockObject_MockObject + * @var EmailTemplateFile|\PHPUnit_Framework_MockObject_MockObject */ protected $_emailTemplateFileResolution; @@ -77,7 +79,7 @@ protected function setUp() false ); $this->_emailTemplateFileResolution = $this->getMock( - \Magento\Framework\View\Design\FileResolution\Fallback\EmailTemplateFile::class, + EmailTemplateFile::class, [], [], '', From 4884f4783f4beafce5cecc96f0e0fb9a2f4a37b1 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 16:05:34 +0100 Subject: [PATCH 61/92] Fixed coding standard violation: Line exceeds maximum limit of 120 characters --- .../ResourceModel/Db/Collection/AbstractCollection.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php index e2a828dd3670a..f33116af065fd 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php @@ -6,13 +6,14 @@ namespace Magento\Framework\Model\ResourceModel\Db\Collection; -use Magento\Framework\App\ResourceConnection\SourceProviderInterface; +use \Magento\Framework\App\ResourceConnection\SourceProviderInterface; +use \Magento\Framework\Data\Collection\AbstractDb; /** * Abstract Resource Collection * @SuppressWarnings(PHPMD.NumberOfChildren) */ -abstract class AbstractCollection extends \Magento\Framework\Data\Collection\AbstractDb implements SourceProviderInterface +abstract class AbstractCollection extends AbstractDb implements SourceProviderInterface { /** * Model name @@ -456,7 +457,9 @@ public function getResourceModelName() public function getResource() { if (empty($this->_resource)) { - $this->_resource = \Magento\Framework\App\ObjectManager::getInstance()->create($this->getResourceModelName()); + $this->_resource = \Magento\Framework\App\ObjectManager::getInstance()->create( + $this->getResourceModelName() + ); } return $this->_resource; } From 2727cfa28db9dba3b93cf6d6656175369cbf7fa6 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 16:08:47 +0100 Subject: [PATCH 62/92] Fixed coding standard violations: - Changed position of the @codingStandardsIgnoreEnd - Fixed Visibility must be declared on property --- .../Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php index 68b7295b8a800..255b2ebc5100f 100644 --- a/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php +++ b/lib/internal/Magento/Framework/Stdlib/Test/Unit/Cookie/PhpCookieManagerTest.php @@ -9,12 +9,13 @@ $mockTranslateSetCookie = false; } -namespace Magento\Framework\Stdlib\Test\Unit\Cookie { - // @codingStandardsIgnoreEnd +namespace Magento\Framework\Stdlib\Test\Unit\Cookie +{ use Magento\Framework\Stdlib\Cookie\PhpCookieManager; use Magento\Framework\Exception\InputException; use Magento\Framework\Stdlib\Cookie\FailureToSendException; use Magento\Framework\Stdlib\Cookie\CookieSizeLimitReachedException; + // @codingStandardsIgnoreEnd /** * Test PhpCookieManager @@ -47,7 +48,7 @@ class PhpCookieManagerTest extends \PHPUnit_Framework_TestCase /** * Mapping from constant names to functions that handle the assertions. */ - static $functionTestAssertionMapping = [ + protected static $functionTestAssertionMapping = [ self::DELETE_COOKIE_NAME => 'self::assertDeleteCookie', self::DELETE_COOKIE_NAME_NO_METADATA => 'self::assertDeleteCookieWithNoMetadata', self::SENSITIVE_COOKIE_NAME_NO_METADATA_HTTPS => 'self::assertSensitiveCookieWithNoMetaDataHttps', From 304ace32d91b47dd58609528fcc781e2d6caf093 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 16:35:31 +0100 Subject: [PATCH 63/92] - Changed Code Sniffer rule set in order to exclude all _files for class declaration coding standard errors. These files should be exclused since they are mostly stub classes which are used for unit testing. Creating seperate files for them should not be necessary. --- .../testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml index 89a7d56539ce3..a27b07af79f4f 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml @@ -19,7 +19,9 @@ - + + */_files/* + From 119254eba91ac21a3c89c71251b8f4737d4a80a9 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 17:12:15 +0100 Subject: [PATCH 64/92] Fixed coding standard violations: - Ignored line exceeds maximum limit of 120 characters - Fixed Empty line missed --- lib/internal/Magento/Framework/Url.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Url.php b/lib/internal/Magento/Framework/Url.php index b2eabc1036b82..8f989d7e3e31c 100644 --- a/lib/internal/Magento/Framework/Url.php +++ b/lib/internal/Magento/Framework/Url.php @@ -41,7 +41,8 @@ * * URL structure: * - * https://user:password@host:443/base_path/[base_script][scopeview_path]route_name/controller_name/action_name/param1/value1?query_param=query_value#fragment + * @codingStandardsIgnoreLine + * https://user:password@host:443/base_path/[base_script][scopeview_path]route_name/controller_name/action_name/param1/value1?query_param=query_value#fragment @ * \__________A___________/\____________________________________B_____________________________________/ * \__________________C___________________/ \__________________D_________________/ \_____E_____/ * \_____________F______________/ \___________________________G______________________/ @@ -145,6 +146,7 @@ class Url extends \Magento\Framework\DataObject implements \Magento\Framework\Ur /** * @var \Magento\Framework\Url\ScopeResolverInterface */ + protected $_scopeResolver; /** From dd5164fe0c041a9562769333b17cf36946340404 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 17:36:40 +0100 Subject: [PATCH 65/92] Fixed coding standard violations: - Interface should have name that ends with "Interface" suffix. --- .../_files/ClassesForContextAggregation.php | 38 +++++++++---------- .../DB/Test/Unit/AbstractMapperTest.php | 6 ++- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php index 08d10b401a52d..2926640058dc0 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php @@ -17,16 +17,16 @@ class ClassThird class ClassD { } -interface InterfaceFirst +interface FirstInterface { } -class ImplementationOfInterfaceFirst implements InterfaceFirst +class ImplementationOfFirstInterface implements FirstInterface { } -interface InterfaceSecond +interface SecondInterface { } -class ImplementationOfInterfaceSecond implements InterfaceSecond +class ImplementationOfSecondInterface implements SecondInterface { } class ContextFirst implements \Magento\Framework\ObjectManager\ContextInterface @@ -47,12 +47,12 @@ class ContextFirst implements \Magento\Framework\ObjectManager\ContextInterface protected $_exC; /** - * @var InterfaceFirst + * @var FirstInterface */ protected $_interfaceA; /** - * @var ImplementationOfInterfaceSecond + * @var ImplementationOfSecondInterface */ protected $_implOfBInterface; @@ -60,15 +60,15 @@ class ContextFirst implements \Magento\Framework\ObjectManager\ContextInterface * @param ClassFirst $exA * @param ClassSecond $exB * @param ClassThird $exC - * @param InterfaceFirst $interfaceA - * @param ImplementationOfInterfaceSecond $implOfBInterface + * @param FirstInterface $interfaceA + * @param ImplementationOfSecondInterface $implOfBInterface */ public function __construct( \ClassFirst $exA, \ClassSecond $exB, \ClassThird $exC, - \InterfaceFirst $interfaceA, - \ImplementationOfInterfaceSecond $implOfBInterface + \FirstInterface $interfaceA, + \ImplementationOfSecondInterface $implOfBInterface ) { $this->_exA = $exA; $this->_exB = $exB; @@ -107,15 +107,15 @@ class ClassArgumentWithInterfaceImplementation protected $_context; /** - * @var ImplementationOfInterfaceFirst + * @var ImplementationOfFirstInterface */ protected $_exA; /** * @param ContextFirst $context - * @param ImplementationOfInterfaceFirst $exA + * @param ImplementationOfFirstInterface $exA */ - public function __construct(\ContextFirst $context, \ImplementationOfInterfaceFirst $exA) + public function __construct(\ContextFirst $context, \ImplementationOfFirstInterface $exA) { $this->_context = $context; $this->_exA = $exA; @@ -129,15 +129,15 @@ class ClassArgumentWithInterface protected $_context; /** - * @var InterfaceSecond + * @var SecondInterface */ protected $_exB; /** * @param ContextFirst $context - * @param InterfaceSecond $exB + * @param SecondInterface $exB */ - public function __construct(\ContextFirst $context, \InterfaceSecond $exB) + public function __construct(\ContextFirst $context, \SecondInterface $exB) { $this->_context = $context; $this->_exB = $exB; @@ -151,15 +151,15 @@ class ClassArgumentWithAlreadyInjectedInterface protected $_context; /** - * @var InterfaceFirst + * @var FirstInterface */ protected $_exA; /** * @param ContextFirst $context - * @param InterfaceFirst $exA + * @param FirstInterface $exA */ - public function __construct(\ContextFirst $context, \InterfaceFirst $exA) + public function __construct(\ContextFirst $context, \FirstInterface $exA) { $this->_context = $context; $this->_exA = $exA; diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php index d66b209368132..7b4652d946e8d 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php @@ -245,8 +245,10 @@ public function testAddFieldToFilter($field, $condition) ->will($this->returnValue($resultCondition)); if (is_array($field)) { - $resultCondition = '(' . implode(') ' . \Magento\Framework\DB\Select::SQL_OR - . ' (', array_fill(0, count($field), $resultCondition)) . ')'; + $resultCondition = '(' . implode( + ') ' . \Magento\Framework\DB\Select::SQL_OR . ' (', + array_fill(0, count($field), $resultCondition) + ) . ')'; } $this->selectMock->expects($this->once()) From f22f978d4b8a4b8c4e990daba76681d0c1dff46e Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 17:36:54 +0100 Subject: [PATCH 66/92] Fixed coding standard violations: - Interface should have name that ends with "Interface" suffix. --- .../_files/ClassesForConstructorIntegrity.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php index 8878bf49fdecd..14101213125e9 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForConstructorIntegrity.php @@ -14,16 +14,16 @@ class ClassB class ClassC { } -interface InterfaceA +interface FirstInterface { } -class ImplementationOfInterfaceA implements InterfaceA +class ImplementationOfFirstInterface implements FirstInterface { } -interface InterfaceB +interface SecondInterface { } -class ImplementationOfInterfaceB implements InterfaceB +class ImplementationOfSecondInterface implements SecondInterface { } class Context implements \Magento\Framework\ObjectManager\ContextInterface @@ -44,12 +44,12 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface protected $_exC; /** - * @var InterfaceA + * @var FirstInterface */ protected $_interfaceA; /** - * @var ImplementationOfInterfaceB + * @var ImplementationOfSecondInterface */ protected $_implOfBInterface; @@ -57,8 +57,8 @@ public function __construct( \ClassA $exA, \ClassB $exB, \ClassC $exC, - \InterfaceA $interfaceA, - \ImplementationOfInterfaceB $implOfBInterface + \FirstInterface $interfaceA, + \ImplementationOfSecondInterface $implOfBInterface ) { $this->_exA = $exA; $this->_exB = $exB; From f8f68f6f1079155fa0aac44c282e8c6a98c5695e Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 22:06:21 +0100 Subject: [PATCH 67/92] Removed dubble class names --- .../_files/ClassesForContextAggregation.php | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php index 2926640058dc0..27113dec39edb 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/_files/ClassesForContextAggregation.php @@ -17,16 +17,16 @@ class ClassThird class ClassD { } -interface FirstInterface +interface ThirdInterface { } -class ImplementationOfFirstInterface implements FirstInterface +class ImplementationOfThirdInterface implements ThirdInterface { } -interface SecondInterface +interface FourthInterface { } -class ImplementationOfSecondInterface implements SecondInterface +class ImplementationOfFourthInterface implements FourthInterface { } class ContextFirst implements \Magento\Framework\ObjectManager\ContextInterface @@ -47,12 +47,12 @@ class ContextFirst implements \Magento\Framework\ObjectManager\ContextInterface protected $_exC; /** - * @var FirstInterface + * @var ThirdInterface */ protected $_interfaceA; /** - * @var ImplementationOfSecondInterface + * @var ImplementationOfFourthInterface */ protected $_implOfBInterface; @@ -60,15 +60,15 @@ class ContextFirst implements \Magento\Framework\ObjectManager\ContextInterface * @param ClassFirst $exA * @param ClassSecond $exB * @param ClassThird $exC - * @param FirstInterface $interfaceA - * @param ImplementationOfSecondInterface $implOfBInterface + * @param ThirdInterface $interfaceA + * @param ImplementationOfFourthInterface $implOfBInterface */ public function __construct( \ClassFirst $exA, \ClassSecond $exB, \ClassThird $exC, - \FirstInterface $interfaceA, - \ImplementationOfSecondInterface $implOfBInterface + \ThirdInterface $interfaceA, + \ImplementationOfFourthInterface $implOfBInterface ) { $this->_exA = $exA; $this->_exB = $exB; @@ -107,15 +107,15 @@ class ClassArgumentWithInterfaceImplementation protected $_context; /** - * @var ImplementationOfFirstInterface + * @var ImplementationOfThirdInterface */ protected $_exA; /** * @param ContextFirst $context - * @param ImplementationOfFirstInterface $exA + * @param ImplementationOfThirdInterface $exA */ - public function __construct(\ContextFirst $context, \ImplementationOfFirstInterface $exA) + public function __construct(\ContextFirst $context, \ImplementationOfThirdInterface $exA) { $this->_context = $context; $this->_exA = $exA; @@ -129,15 +129,15 @@ class ClassArgumentWithInterface protected $_context; /** - * @var SecondInterface + * @var FourthInterface */ protected $_exB; /** * @param ContextFirst $context - * @param SecondInterface $exB + * @param FourthInterface $exB */ - public function __construct(\ContextFirst $context, \SecondInterface $exB) + public function __construct(\ContextFirst $context, \FourthInterface $exB) { $this->_context = $context; $this->_exB = $exB; @@ -151,15 +151,15 @@ class ClassArgumentWithAlreadyInjectedInterface protected $_context; /** - * @var FirstInterface + * @var ThirdInterface */ protected $_exA; /** * @param ContextFirst $context - * @param FirstInterface $exA + * @param ThirdInterface $exA */ - public function __construct(\ContextFirst $context, \FirstInterface $exA) + public function __construct(\ContextFirst $context, \ThirdInterface $exA) { $this->_context = $context; $this->_exA = $exA; From 0992f8885abe2e30c67896394ff023ec32b7bc56 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 22:09:42 +0100 Subject: [PATCH 68/92] Fixed coding standard violation: Line exceeds maximum limit of 120 characters --- .../Interception/Test/Unit/Code/InterfaceValidatorTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php index 2cb2c6a5d7783..019ce0cb4cc70 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php @@ -11,6 +11,7 @@ use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\IncompatibleInterface; use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\IncorrectSubject; use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\ExtraParameters; +use \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\InvalidProceed; class InterfaceValidatorTest extends \PHPUnit_Framework_TestCase { @@ -135,7 +136,7 @@ public function testValidateExtraParameters() public function testValidateInvalidProceed() { $this->model->validate( - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin\InvalidProceed::class, + InvalidProceed::class, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\Item::class ); } From fb4abaf667389c7ad8e570d14d123aa5118238af Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 22:12:24 +0100 Subject: [PATCH 69/92] Fixed coding standard violations: - Expected 5 space(s) before asterisk; 0 found - Line indented incorrectly; expected at least 8 spaces, found 0 --- lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index f57da9caf2972..063a8e8536395 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -735,7 +735,6 @@ public function setQueryHook($hook) * @return array * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) - * @deprecated */ protected function _splitMultiQuery($sql) @@ -1386,7 +1385,7 @@ protected function _removeDuplicateEntry($table, $fields, $ids) */ public function select() { -// return new Select($this); + // return new Select($this); return $this->selectFactory->create($this); } From 8824b293a9cf07c6ed8e312074aafa8e8f891f3c Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 22:42:05 +0100 Subject: [PATCH 70/92] Added PSR2 ref to Magento PHP Codesniffer ruleset. --- .../testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml index a27b07af79f4f..862ee98d073ae 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml @@ -7,6 +7,7 @@ --> Magento coding standard. + @@ -19,9 +20,7 @@ - - */_files/* - + From 3fbdf2c5db68f87ddeddb7f2dd59fcecded13e79 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 22:59:47 +0100 Subject: [PATCH 71/92] - Combined testCodeStylePsr2() with the testCodeStyle() function. - Core Magento team mentioned to combine these 2 functions in the comments. - Excluded _files/* from the PSR2 standards because these are stub files for tests and multiple classes per file throws PSR2 errors for these files. --- .../Magento/Test/Php/LiveCodeTest.php | 37 +++---------------- .../Magento/Test/Php/_files/phpcs/ruleset.xml | 3 ++ 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index 68fac7bf5f372..70063dea8d6d3 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -114,37 +114,6 @@ function ($path) use ($directoriesToCheck, $fileTypes) { return $changedFiles; } - /** - * Run the PSR2 code sniffs on the code - * - * @TODO: combine with testCodeStyle - * @return void - */ - public function testCodeStylePsr2() - { - $reportFile = self::$reportDir . '/phpcs_psr2_report.txt'; - $wrapper = new Wrapper(); - $codeSniffer = new CodeSniffer('PSR2', $reportFile, $wrapper); - if (!$codeSniffer->canRun()) { - $this->markTestSkipped('PHP Code Sniffer is not installed.'); - } - if (version_compare($wrapper->version(), '1.4.7') === -1) { - $this->markTestSkipped('PHP Code Sniffer Build Too Old.'); - } - - $result = $codeSniffer->run(self::getWhitelist()); - - $output = ""; - if (file_exists($reportFile)) { - $output = file_get_contents($reportFile); - } - $this->assertEquals( - 0, - $result, - "PHP Code Sniffer has found {$result} error(s): " . PHP_EOL . $output - ); - } - /** * Run the magento specific coding standards on the code * @@ -155,9 +124,15 @@ public function testCodeStyle() $reportFile = self::$reportDir . '/phpcs_report.txt'; $wrapper = new Wrapper(); $codeSniffer = new CodeSniffer(realpath(__DIR__ . '/_files/phpcs'), $reportFile, $wrapper); + if (!$codeSniffer->canRun()) { $this->markTestSkipped('PHP Code Sniffer is not installed.'); } + + if (version_compare($wrapper->version(), '1.4.7') === -1) { + $this->markTestSkipped('PHP Code Sniffer Build Too Old.'); + } + $codeSniffer->setExtensions(['php', 'phtml']); $result = $codeSniffer->run(self::getWhitelist(['php', 'phtml'])); diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml index 89a7d56539ce3..c62a2937f9921 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml @@ -7,6 +7,9 @@ --> Magento coding standard. + + */_files/* + From 77dd5d5e43e135f8acfd467e2dd067909bad2a32 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sun, 20 Nov 2016 23:38:38 +0100 Subject: [PATCH 72/92] Changed the exclude pattern to be located under the ruleset node instead of the rule (which is not working according to PHP Codesniffer documentation). --- .../testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml index c62a2937f9921..00d3affcda7c8 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/ruleset.xml @@ -7,9 +7,9 @@ --> Magento coding standard. - - */_files/* - + + */_files/* + From 1ac6ed4f8e31ae6a3c043348d7e36f098de4aa58 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 22 Nov 2016 21:32:02 +0100 Subject: [PATCH 73/92] Fixed coding standard error: - Line exceeds maximum limit of 120 characters - Expected message can be a partial of the complete exception string. Changed this in order to be below 120 chars on the line. --- .../Interception/Test/Unit/Code/InterfaceValidatorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php index 019ce0cb4cc70..b4a604b06977a 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Code/InterfaceValidatorTest.php @@ -74,7 +74,7 @@ public function testValidateIncorrectInterface() /** * @expectedException \Magento\Framework\Exception\ValidatorException - * @expectedExceptionMessage Invalid [\Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item] $subject type + * @expectedExceptionMessage $subject type * @covers \Magento\Framework\Interception\Code\InterfaceValidator::validate */ public function testValidateIncorrectSubjectType() From 17727391f3416e5882f395658e2f738354c39773 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 22 Nov 2016 21:37:37 +0100 Subject: [PATCH 74/92] Fixed coding standard error: - Fixed empty line typo - Added codingstandardignore to comment which could not become 120 chars or less. --- lib/internal/Magento/Framework/Url.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Url.php b/lib/internal/Magento/Framework/Url.php index 8f989d7e3e31c..48c191dae8ae5 100644 --- a/lib/internal/Magento/Framework/Url.php +++ b/lib/internal/Magento/Framework/Url.php @@ -39,14 +39,15 @@ * - query_array: array('param1'=>'value1', 'param2'=>'value2') * - fragment: (#)'fragment-anchor' * + * @codingStandardsIgnoreStart * URL structure: * - * @codingStandardsIgnoreLine - * https://user:password@host:443/base_path/[base_script][scopeview_path]route_name/controller_name/action_name/param1/value1?query_param=query_value#fragment @ + * https://user:password@host:443/base_path/[base_script][scopeview_path]route_name/controller_name/action_name/param1/value1?query_param=query_value#fragment * \__________A___________/\____________________________________B_____________________________________/ * \__________________C___________________/ \__________________D_________________/ \_____E_____/ * \_____________F______________/ \___________________________G______________________/ * \___________________________________________________H____________________________________________________/ + * @codingStandardsIgnoreEnd * * - A: authority * - B: path @@ -141,12 +142,11 @@ class Url extends \Magento\Framework\DataObject implements \Magento\Framework\Ur /** * @var \Magento\Framework\Url\RouteParamsResolverFactory */ - private $_routeParamsResolverFactory; + /** * @var \Magento\Framework\Url\ScopeResolverInterface */ - protected $_scopeResolver; /** From 42936284a31a936de7a3b210bf43f33493f3cefc Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 22 Nov 2016 21:42:33 +0100 Subject: [PATCH 75/92] Added ignoring coding standard --- lib/internal/Magento/Framework/Translate/Adapter.php | 1 + lib/internal/Magento/Framework/Translate/AdapterInterface.php | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/Translate/Adapter.php b/lib/internal/Magento/Framework/Translate/Adapter.php index b883f756165aa..4d2e844a1eb4c 100644 --- a/lib/internal/Magento/Framework/Translate/Adapter.php +++ b/lib/internal/Magento/Framework/Translate/Adapter.php @@ -33,6 +33,7 @@ public function translate($messageId, $locale = null) * Translate message string. * * @SuppressWarnings(PHPMD.ShortMethodName) + * @codingStandardsIgnoreLine * @return string */ public function __() diff --git a/lib/internal/Magento/Framework/Translate/AdapterInterface.php b/lib/internal/Magento/Framework/Translate/AdapterInterface.php index fe7bbf39521b2..07939de4110ac 100644 --- a/lib/internal/Magento/Framework/Translate/AdapterInterface.php +++ b/lib/internal/Magento/Framework/Translate/AdapterInterface.php @@ -27,6 +27,7 @@ public function translate($messageId, $locale = null); * * @return string * @SuppressWarnings(PHPMD.ShortMethodName) + * @codingStandardsIgnoreLine */ public function __(); } From 0e68759294161b17f4a57e2273e85a61982166e8 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 22 Nov 2016 22:08:34 +0100 Subject: [PATCH 76/92] Fixed coding standard error: - Method name "Request::SslOffloadHeader" is not in camel caps format --- .../Magento/Framework/HTTP/PhpEnvironment/Request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php index dc73bcfa35b44..2c5f76b8f54a5 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php @@ -421,7 +421,7 @@ public function isSecure() return true; } - return $this->initialRequestSecure($this->SslOffloadHeader()); + return $this->initialRequestSecure($this->sslOffloadHeader()); } /** @@ -429,7 +429,7 @@ public function isSecure() * * @return string */ - private function SslOffloadHeader() + private function sslOffloadHeader() { // Lets read from db only one time okay. if ($this->sslOffloadHeader === null) { From f5317d27ce43fa13461a2e2989a0ab60e40e0d7a Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 22 Nov 2016 22:12:10 +0100 Subject: [PATCH 77/92] Added Ignoring coding standard error --- lib/internal/Magento/Framework/HTTP/Adapter/Curl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php index 1db153d6def28..4564f24bfaa6a 100644 --- a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php @@ -159,6 +159,7 @@ public function connect($host, $port = 80, $secure = false) * @param string $body * @return string Request as text * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @codingStandardsIgnoreLine */ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '') { From 6390a7db89963b0bb6b3937f1bddc3da79f7bd29 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Tue, 22 Nov 2016 22:52:43 +0100 Subject: [PATCH 78/92] Fixed coding standard error, typo's in indenting --- .../Magento/Framework/DB/Test/Unit/AbstractMapperTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php index 7b4652d946e8d..efcc5c81785b4 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/AbstractMapperTest.php @@ -246,9 +246,9 @@ public function testAddFieldToFilter($field, $condition) if (is_array($field)) { $resultCondition = '(' . implode( - ') ' . \Magento\Framework\DB\Select::SQL_OR . ' (', - array_fill(0, count($field), $resultCondition) - ) . ')'; + ') ' . \Magento\Framework\DB\Select::SQL_OR . ' (', + array_fill(0, count($field), $resultCondition) + ) . ')'; } $this->selectMock->expects($this->once()) From 6cb43fc47a489bebb3c6e85652f176012d39991e Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 24 Nov 2016 15:58:21 +0100 Subject: [PATCH 79/92] Print the codesniffer version number to check which version is being used by the builds --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a82e42481c4e7..f2d971eb72b5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,8 @@ matrix: before_install: ./dev/travis/before_install.sh install: composer install --no-interaction --prefer-dist before_script: ./dev/travis/before_script.sh -script: +script: + - composer show -i | grep -i codesniff - cd dev/tests/$TEST_SUITE - test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true - phpunit $TEST_FILTER From 1c0def9baf13326c5829646a5e609192db7800c7 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 24 Nov 2016 16:05:32 +0100 Subject: [PATCH 80/92] Revert "Print the codesniffer version number to check which version is being used by the builds" This reverts commit 6cb43fc47a489bebb3c6e85652f176012d39991e. --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f2d971eb72b5f..a82e42481c4e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,8 +31,7 @@ matrix: before_install: ./dev/travis/before_install.sh install: composer install --no-interaction --prefer-dist before_script: ./dev/travis/before_script.sh -script: - - composer show -i | grep -i codesniff +script: - cd dev/tests/$TEST_SUITE - test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true - phpunit $TEST_FILTER From 2f2351b18c4a7154f2e323955a372f89a4efe8b2 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 24 Nov 2016 16:06:55 +0100 Subject: [PATCH 81/92] Checking PHP Codesniffer versions --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a82e42481c4e7..9535582c33cf3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,9 @@ matrix: before_install: ./dev/travis/before_install.sh install: composer install --no-interaction --prefer-dist before_script: ./dev/travis/before_script.sh -script: +script: + - phpcs --version + - ./vendor/bin/phpcs --version - cd dev/tests/$TEST_SUITE - test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true - phpunit $TEST_FILTER From 1d1a5b458cbb7ed2c7faac6e7075c8bb6dd165c1 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 24 Nov 2016 16:37:39 +0100 Subject: [PATCH 82/92] Revert "Checking PHP Codesniffer versions" This reverts commit 2f2351b18c4a7154f2e323955a372f89a4efe8b2. --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9535582c33cf3..a82e42481c4e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,9 +31,7 @@ matrix: before_install: ./dev/travis/before_install.sh install: composer install --no-interaction --prefer-dist before_script: ./dev/travis/before_script.sh -script: - - phpcs --version - - ./vendor/bin/phpcs --version +script: - cd dev/tests/$TEST_SUITE - test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true - phpunit $TEST_FILTER From 1b6a7476038cfbe9f8044fabeb83b5e81213ba5b Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 24 Nov 2016 16:44:51 +0100 Subject: [PATCH 83/92] @codingStandardIgnoreLine doesn't work correctly in docblocks. So commented out the complete sections with the @codingStandardsIgnoreStart and @codingStandardsIgnoreEnd annotations. --- lib/internal/Magento/Framework/HTTP/Adapter/Curl.php | 3 ++- lib/internal/Magento/Framework/Translate/Adapter.php | 3 ++- lib/internal/Magento/Framework/Translate/AdapterInterface.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php index 4564f24bfaa6a..0560be9fde9c4 100644 --- a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php @@ -149,6 +149,7 @@ public function connect($host, $port = 80, $secure = false) return $this->_applyConfig(); } + // @codingStandardsIgnoreStart /** * Send request to the remote server * @@ -159,7 +160,6 @@ public function connect($host, $port = 80, $secure = false) * @param string $body * @return string Request as text * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * @codingStandardsIgnoreLine */ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '') { @@ -190,6 +190,7 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = ' return $body; } + // @codingStandardsIgnoreEnd /** * Read response from server diff --git a/lib/internal/Magento/Framework/Translate/Adapter.php b/lib/internal/Magento/Framework/Translate/Adapter.php index 4d2e844a1eb4c..f4229ff77d851 100644 --- a/lib/internal/Magento/Framework/Translate/Adapter.php +++ b/lib/internal/Magento/Framework/Translate/Adapter.php @@ -29,11 +29,11 @@ public function translate($messageId, $locale = null) } } + // @codingStandardsIgnoreStart /** * Translate message string. * * @SuppressWarnings(PHPMD.ShortMethodName) - * @codingStandardsIgnoreLine * @return string */ public function __() @@ -46,4 +46,5 @@ public function __() } return $string; } + // @codingStandardsIgnoreEnd } diff --git a/lib/internal/Magento/Framework/Translate/AdapterInterface.php b/lib/internal/Magento/Framework/Translate/AdapterInterface.php index 07939de4110ac..bfff761cd7827 100644 --- a/lib/internal/Magento/Framework/Translate/AdapterInterface.php +++ b/lib/internal/Magento/Framework/Translate/AdapterInterface.php @@ -22,12 +22,13 @@ interface AdapterInterface */ public function translate($messageId, $locale = null); + // @codingStandardsIgnoreStart /** * Translate string * * @return string * @SuppressWarnings(PHPMD.ShortMethodName) - * @codingStandardsIgnoreLine */ public function __(); + // @codingStandardsIgnoreEnd } From c3be4cddb66e6af6590a18352f346c0561472355 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 24 Nov 2016 17:02:43 +0100 Subject: [PATCH 84/92] Fixed coding standard error: Each class must be in a file by itself --- .../App/Test/Unit/Action/ActionFake.php | 27 +++++++++++++ .../App/Test/Unit/Action/ActionTest.php | 18 --------- .../Db/Collection/AbstractCollectionTest.php | 32 --------------- .../Unit/ResourceModel/Db/Collection/Uut.php | 40 +++++++++++++++++++ 4 files changed, 67 insertions(+), 50 deletions(-) create mode 100644 lib/internal/Magento/Framework/App/Test/Unit/Action/ActionFake.php create mode 100644 lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/Uut.php diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionFake.php b/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionFake.php new file mode 100644 index 0000000000000..672bf49ffc6bf --- /dev/null +++ b/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionFake.php @@ -0,0 +1,27 @@ +_forward( + ActionTest::ACTION_NAME, + ActionTest::CONTROLLER_NAME, + ActionTest::MODULE_NAME, + ActionTest::$actionParams + ); + $this->_redirect(ActionTest::FULL_ACTION_NAME, ActionTest::$actionParams); + return; + } +} diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php index 5d97cd31b40ef..8bb280cbef377 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Action/ActionTest.php @@ -183,21 +183,3 @@ public function testDispatchPostDispatch() $this->assertEquals($this->_responseMock, $this->action->dispatch($this->_requestMock)); } } - -class ActionFake extends Action -{ - /** - * Fake action to check a method call from a parent - */ - public function execute() - { - $this->_forward( - ActionTest::ACTION_NAME, - ActionTest::CONTROLLER_NAME, - ActionTest::MODULE_NAME, - ActionTest::$actionParams - ); - $this->_redirect(ActionTest::FULL_ACTION_NAME, ActionTest::$actionParams); - return; - } -} diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php index 82a743f6a12fc..34fb92fc815f4 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/AbstractCollectionTest.php @@ -7,7 +7,6 @@ namespace Magento\Framework\Model\Test\Unit\ResourceModel\Db\Collection; use Magento\Framework\DB\Select; -use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; use Magento\Framework\DataObject as MagentoObject; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Framework\ObjectManagerInterface; @@ -412,34 +411,3 @@ public function testSave() $this->assertTrue($this->uut->save() instanceof Uut); } } - -/** - * Pattern type: Public Morozov - */ -class Uut extends AbstractCollection -{ - public function wereFieldsToSelectChanged() - { - return $this->_fieldsToSelectChanged; - } - - public function getFieldsToSelect() - { - return $this->_fieldsToSelect; - } - - public function setFieldsToSelect(array $fields) - { - $this->_fieldsToSelect = $fields; - } - - public function setResource($resource) - { - $this->_resource = $resource; - } - - public function getJoinedTables() - { - return $this->_joinedTables; - } -} diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/Uut.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/Uut.php new file mode 100644 index 0000000000000..de64f93747cd5 --- /dev/null +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/Collection/Uut.php @@ -0,0 +1,40 @@ +_fieldsToSelectChanged; + } + + public function getFieldsToSelect() + { + return $this->_fieldsToSelect; + } + + public function setFieldsToSelect(array $fields) + { + $this->_fieldsToSelect = $fields; + } + + public function setResource($resource) + { + $this->_resource = $resource; + } + + public function getJoinedTables() + { + return $this->_joinedTables; + } +} From 091f5e932851cf6c933f1a0ea2874666d311421c Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 24 Nov 2016 17:11:38 +0100 Subject: [PATCH 85/92] Enabling static tests for PHP 7.0 images. --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a82e42481c4e7..98b8e238afd89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,10 +24,6 @@ env: cache: apt: true directories: $HOME/.composer/cache -matrix: - exclude: - - php: 7.0 - 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 From 40f97295e65e9ea9f3a4103f1ea065275249d496 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 24 Nov 2016 19:55:07 +0100 Subject: [PATCH 86/92] Revert "Enabling static tests for PHP 7.0 images." This reverts commit 091f5e932851cf6c933f1a0ea2874666d311421c. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 98b8e238afd89..a82e42481c4e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,10 @@ env: cache: apt: true directories: $HOME/.composer/cache +matrix: + exclude: + - php: 7.0 + 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 From 76eed97bc33274e9cdbad8e312a585ab382927ce Mon Sep 17 00:00:00 2001 From: dverkade Date: Thu, 24 Nov 2016 21:58:45 +0100 Subject: [PATCH 87/92] Travis should run the static tests against PHP 7 Travis should be changed so that static tests will be runned against PHP 7 as well. See for instance this build: https://travis-ci.org/magento/magento2/builds/178637640 Static tests pass against PHP 7 but fail against PHP 5.6. So there is difference between the two versions and we should build en pass static test for both PHP versions. --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a82e42481c4e7..98b8e238afd89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,10 +24,6 @@ env: cache: apt: true directories: $HOME/.composer/cache -matrix: - exclude: - - php: 7.0 - 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 From 17b54a7febcedea966c317d44f32d7b9560837fc Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sat, 26 Nov 2016 14:01:58 +0100 Subject: [PATCH 88/92] Fixed coding standard error: Function mysql() has been deprecated This is due to codesniffer bug where MySQL class name is processed as a function. So for now ignored coding standards for class definition. Could be changed later on when this bug is fixed in Codesniffer. --- lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php | 3 +++ lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php | 3 +++ .../Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php | 3 +++ 3 files changed, 9 insertions(+) diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index 063a8e8536395..7d9b32bd8358e 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -27,6 +27,7 @@ use Magento\Framework\Stdlib\StringUtils; use Magento\Framework\DB\Query\Generator as QueryGenerator; +// @codingStandardsIgnoreStart /** * @SuppressWarnings(PHPMD.ExcessivePublicCount) * @SuppressWarnings(PHPMD.TooManyFields) @@ -35,6 +36,8 @@ */ class Mysql extends \Zend_Db_Adapter_Pdo_Mysql implements AdapterInterface { + // @codingStandardsIgnoreEnd + const TIMESTAMP_FORMAT = 'Y-m-d H:i:s'; const DATETIME_FORMAT = 'Y-m-d H:i:s'; const DATE_FORMAT = 'Y-m-d'; diff --git a/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php index 5b7cccf11388a..390404232d1f3 100644 --- a/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php @@ -13,8 +13,11 @@ use Magento\Framework\DB\Statement\Parameter; +// @codingStandardsIgnoreStart class Mysql extends \Zend_Db_Statement_Pdo { + // @codingStandardsIgnoreEnd + /** * Executes statement with binding values to it. * Allows transferring specific options to DB driver. diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php index 26e24607c828d..529e709a158ff 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php @@ -11,8 +11,11 @@ use Magento\Framework\DB\SelectFactory; use Magento\Framework\Stdlib; +// @codingStandardsIgnoreStart class Mysql extends \Magento\Framework\Model\ResourceModel\Type\Db implements ConnectionAdapterInterface { + // @codingStandardsIgnoreEnd + /** * @var Stdlib\StringUtils */ From ac4591cd1e741a0a98f479c6ceab2bf83b5a143d Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sat, 26 Nov 2016 14:46:10 +0100 Subject: [PATCH 89/92] - Changed SevenInterface to use "array()" instead of []. Code generation of Magento generates "array()" so this should be the same. - Removed extra empty line after interface generating, because and empty line is already present from the methods generating. So only one empty line is between the last method and class closure instead of two. --- .../Framework/Code/Generator/InterfaceGenerator.php | 2 +- .../code/Magento/SomeModule/Model/SevenInterface.php | 3 ++- pub/test.php | 11 +++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 pub/test.php diff --git a/lib/internal/Magento/Framework/Code/Generator/InterfaceGenerator.php b/lib/internal/Magento/Framework/Code/Generator/InterfaceGenerator.php index 13698393353f5..924b7fdd449ec 100644 --- a/lib/internal/Magento/Framework/Code/Generator/InterfaceGenerator.php +++ b/lib/internal/Magento/Framework/Code/Generator/InterfaceGenerator.php @@ -37,7 +37,7 @@ public function generate() } $output .= self::LINE_FEED . '{' . self::LINE_FEED . self::LINE_FEED - . $this->generateMethods() . self::LINE_FEED . '}' . self::LINE_FEED; + . $this->generateMethods() . '}' . self::LINE_FEED; return $output; } diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php index f5668ce8153e1..e6bf1e9683c99 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/_files/app/code/Magento/SomeModule/Model/SevenInterface.php @@ -27,7 +27,7 @@ interface SevenInterface extends \Magento\Framework\Code\Generator\CodeGenerator * @param array $data * @return TestThree */ - public static function testMethod1(array &$data = []); + public static function testMethod1(array &$data = array()); /** * Method short description @@ -41,4 +41,5 @@ public static function testMethod1(array &$data = []); public function testMethod2($data = 'test_default', $flag = true); public function testMethod3(); + } diff --git a/pub/test.php b/pub/test.php new file mode 100644 index 0000000000000..c0e02c04c699b --- /dev/null +++ b/pub/test.php @@ -0,0 +1,11 @@ + Date: Sat, 26 Nov 2016 15:35:34 +0100 Subject: [PATCH 90/92] Changed back interface definition to check if this resolved broken build. --- .../Framework/Interception/Code/Generator/Interceptor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php b/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php index f89eea1530898..f0d0e59d7b2a0 100644 --- a/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php +++ b/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php @@ -158,7 +158,8 @@ protected function _generateCode() $this->_classGenerator->setExtendedClass($typeName); } $this->_classGenerator->addTrait(\Magento\Framework\Interception\Interceptor::class); - $interfaces[] = \Magento\Framework\Interception\InterceptorInterface::class; + //$interfaces[] = \Magento\Framework\Interception\InterceptorInterface::class; + $interfaces[] = '\Magento\Framework\Interception\InterceptorInterface'; $this->_classGenerator->setImplementedInterfaces($interfaces); return parent::_generateCode(); } From 9fe4d39455a98c60dceefdd664b79ef295c63ab5 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sat, 26 Nov 2016 15:41:14 +0100 Subject: [PATCH 91/92] Added a global \ to setting the addTrait and Interfaces because the ::class does give you a fully qualified class name, but not with the \ at the beginning. This resultated in the class not starting from the global namespace and breaking the build. --- .../Framework/Interception/Code/Generator/Interceptor.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php b/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php index f0d0e59d7b2a0..60379c41a40e7 100644 --- a/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php +++ b/lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php @@ -157,9 +157,8 @@ protected function _generateCode() } else { $this->_classGenerator->setExtendedClass($typeName); } - $this->_classGenerator->addTrait(\Magento\Framework\Interception\Interceptor::class); - //$interfaces[] = \Magento\Framework\Interception\InterceptorInterface::class; - $interfaces[] = '\Magento\Framework\Interception\InterceptorInterface'; + $this->_classGenerator->addTrait('\\'. \Magento\Framework\Interception\Interceptor::class); + $interfaces[] = '\\'. \Magento\Framework\Interception\InterceptorInterface::class; $this->_classGenerator->setImplementedInterfaces($interfaces); return parent::_generateCode(); } From 40f89f9bd24f555012b22c1bec675ec76b22ac58 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sat, 26 Nov 2016 16:08:18 +0100 Subject: [PATCH 92/92] Changed test to check for the correct changed interface name. --- .../Code/Test/Unit/Validator/ContextAggregationTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ContextAggregationTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ContextAggregationTest.php index 53ce41bdef761..bdcea87670e73 100644 --- a/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ContextAggregationTest.php +++ b/lib/internal/Magento/Framework/Code/Test/Unit/Validator/ContextAggregationTest.php @@ -51,7 +51,7 @@ public function testClassArgumentWithAlreadyInjectedInterface() $message = 'Incorrect dependency in class ClassArgumentWithAlreadyInjectedInterface in ' . $this->_fixturePath . PHP_EOL . - '\\InterfaceFirst already exists in context object'; + '\\ThirdInterface already exists in context object'; $this->setExpectedException(\Magento\Framework\Exception\ValidatorException::class, $message); $this->_model->validate('ClassArgumentWithAlreadyInjectedInterface');