diff --git a/.ddev/commands/web/php-cs-fixer b/.ddev/commands/web/php-cs-fixer new file mode 100755 index 000000000..b891a13dd --- /dev/null +++ b/.ddev/commands/web/php-cs-fixer @@ -0,0 +1,7 @@ +#!/bin/bash + +## Description: run PHP-CS-Fixer +## Usage: php-cs-fixer +## Example: ddev php-cs-fixer + +php vendor/bin/php-cs-fixer fix "$@" diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 47e046ab1..69928c7a3 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,17 +1,32 @@ in('.'); - -return (new Config()) +$config = new PhpCsFixer\Config(); +return $config ->setRiskyAllowed(true) - ->setFinder($finder) ->setRules([ - 'array_syntax' => ['syntax' => 'short'], - 'modernize_types_casting' => true, + // see https://cs.symfony.com/doc/ruleSets/PER-CS2.0.html + '@PER-CS2.0' => true, + // RISKY: Use && and || logical operators instead of and or. 'logical_operators' => true, + // RISKY: Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator. + 'modernize_types_casting' => true, + // PHP84: Adds or removes ? before single type declarations or |null at the end of union types when parameters have a default null value. + 'nullable_type_declaration_for_default_null_value' => true, + // Convert double quotes to single quotes for simple strings. 'single_quote' => true, - ]); + // Arguments lists, array destructuring lists, arrays that are multi-line, match-lines and parameters lists must have a trailing comma. + // removed "match" and "parameters" for PHP7 + // see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8308 + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'array_destructuring', 'arrays']], + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in([ + __DIR__, + ]) + ->name('*.php') + ->ignoreDotFiles(true) + ->ignoreVCS(true) + ); diff --git a/build/phar/_cli_stub.php b/build/phar/_cli_stub.php index d84751eb1..d255bdbb3 100644 --- a/build/phar/_cli_stub.php +++ b/build/phar/_cli_stub.php @@ -10,8 +10,8 @@ fwrite(STDERR, implode(PHP_EOL, [ 'The suhosin.executor.include.whitelist setting is incorrect.', 'Add the following to the end of your `php.ini` or suhosin.ini (Example path [for Debian]: /etc/php5/cli/conf.d/suhosin.ini):', - ' suhosin.executor.include.whitelist = phar '.$suhosin, - '' + ' suhosin.executor.include.whitelist = phar ' . $suhosin, + '', ])); exit(1); } diff --git a/build/phar/phar-timestamp.php b/build/phar/phar-timestamp.php index b52b26280..53fadf7c5 100644 --- a/build/phar/phar-timestamp.php +++ b/build/phar/phar-timestamp.php @@ -31,7 +31,7 @@ $threshold = 1343826993; # 2012-08-01T15:14:33Z if ($timestamp < $threshold) { throw new RuntimeException( - sprintf('Timestamp older than %d (%s).', $threshold, date(DATE_RFC3339, $threshold)) + sprintf('Timestamp older than %d (%s).', $threshold, date(DATE_RFC3339, $threshold)), ); } @@ -43,7 +43,7 @@ if (!rename($pharFilepath, $tmp)) { throw new RuntimeException( - sprintf('Failed to move phar %s to %s', var_export($pharFilepath, true), var_export($tmp, true)) + sprintf('Failed to move phar %s to %s', var_export($pharFilepath, true), var_export($tmp, true)), ); } diff --git a/build/phar/tasks/PatchedPharPackageTask.php b/build/phar/tasks/PatchedPharPackageTask.php index 8c114f712..c83ec5b9b 100644 --- a/build/phar/tasks/PatchedPharPackageTask.php +++ b/build/phar/tasks/PatchedPharPackageTask.php @@ -16,8 +16,7 @@ * @since 2.4.0 * @see PharPackageTask */ -class PatchedPharPackageTask - extends MatchingTask +class PatchedPharPackageTask extends MatchingTask { /** * @var PhingFile @@ -270,7 +269,7 @@ public function main() try { $this->log( 'Building package: ' . $this->destinationFile->__toString(), - Project::MSG_INFO + Project::MSG_INFO, ); $baseDirectory = realpath($this->baseDirectory->getPath()); @@ -285,7 +284,7 @@ public function main() throw new BuildException( 'Problem creating package: ' . $e->getMessage(), $e, - $this->getLocation() + $this->getLocation(), ); } } @@ -297,7 +296,7 @@ private function checkPreconditions() { if (!extension_loaded('phar')) { throw new BuildException( - "PharPackageTask require either PHP 5.3 or better or the PECL's Phar extension" + "PharPackageTask require either PHP 5.3 or better or the PECL's Phar extension", ); } @@ -315,7 +314,8 @@ private function checkPreconditions() if (!is_null($this->baseDirectory)) { if (!$this->baseDirectory->exists()) { throw new BuildException( - "basedir '" . (string) $this->baseDirectory . "' does not exist!", $this->getLocation() + "basedir '" . (string) $this->baseDirectory . "' does not exist!", + $this->getLocation(), ); } } @@ -323,7 +323,8 @@ private function checkPreconditions() if (!extension_loaded('openssl')) { throw new BuildException( - 'PHP OpenSSL extension is required for OpenSSL signing of Phars!', $this->getLocation() + 'PHP OpenSSL extension is required for OpenSSL signing of Phars!', + $this->getLocation(), ); } @@ -429,7 +430,7 @@ private function compressEachFile(Phar $phar, $baseDirectory) foreach ($this->filesets as $fileset) { $this->log( 'Adding specified files in ' . $fileset->getDir($this->project) . ' to package', - Project::MSG_VERBOSE + Project::MSG_VERBOSE, ); $sortedFiles = $this->getSortedFilesFromFileSet($fileset); diff --git a/composer.json b/composer.json index 65a0f4183..357b032c0 100644 --- a/composer.json +++ b/composer.json @@ -79,5 +79,21 @@ "php": "7.4.0" }, "sort-packages": true + }, + "scripts": { + "php-cs-fixer:test": "vendor/bin/php-cs-fixer fix --dry-run --diff", + "php-cs-fixer:fix": "vendor/bin/php-cs-fixer fix", + "phpstan": "XDEBUG_MODE=off php vendor/bin/phpstan analyze", + "phpstan:baseline": "XDEBUG_MODE=off php vendor/bin/phpstan analyze -b .phpstan.dist.baseline.neon", + "rector:test": "vendor/bin/rector process --config .rector.php --dry-run", + "rector:fix": "vendor/bin/rector --config .rector.php process" + }, + "scripts-descriptions": { + "php-cs-fixer:test": "Run php-cs-fixer", + "php-cs-fixer:fix": "Run php-cs-fixer and fix issues", + "phpstan": "Run phpstan", + "phpstan:baseline": "Run phpstan and update baseline", + "rector:test": "Run rector", + "rector:fix": "Run rector and fix issues" } } diff --git a/src/N98/Magento/Application.php b/src/N98/Magento/Application.php index ce620a446..375a99440 100644 --- a/src/N98/Magento/Application.php +++ b/src/N98/Magento/Application.php @@ -137,7 +137,7 @@ protected function getDefaultInputDefinition(): InputDefinition '--root-dir', '', InputOption::VALUE_OPTIONAL, - 'Force magento root dir. No auto detection' + 'Force magento root dir. No auto detection', ); $inputDefinition->addOption($rootDirOption); @@ -148,7 +148,7 @@ protected function getDefaultInputDefinition(): InputDefinition '--skip-config', '', InputOption::VALUE_NONE, - 'Do not load any custom config.' + 'Do not load any custom config.', ); $inputDefinition->addOption($skipExternalConfig); @@ -159,7 +159,7 @@ protected function getDefaultInputDefinition(): InputDefinition '--skip-root-check', '', InputOption::VALUE_NONE, - 'Do not check if n98-magerun runs as root' + 'Do not check if n98-magerun runs as root', ); $inputDefinition->addOption($skipExternalConfig); @@ -170,7 +170,7 @@ protected function getDefaultInputDefinition(): InputDefinition '--developer-mode', '', InputOption::VALUE_NONE, - 'Instantiate Magento in Developer Mode' + 'Instantiate Magento in Developer Mode', ); $inputDefinition->addOption($rootDirOption); @@ -231,7 +231,7 @@ protected function registerHelpers(): void foreach ($config['helpers'] as $helperName => $helperClass) { if (!class_exists($helperClass)) { throw new RuntimeException( - sprintf('Nonexistent helper class: "%s", check helpers configuration', $helperClass) + sprintf('Nonexistent helper class: "%s", check helpers configuration', $helperClass), ); } @@ -524,7 +524,7 @@ public function run(?InputInterface $input = null, ?OutputInterface $output = nu return $return; } - private function init(array $initConfig = [], ?InputInterface $input = null, ?OutputInterface $output = null): void + public function init(array $initConfig = [], ?InputInterface $input = null, ?OutputInterface $output = null): void { if ($this->_isInitialized) { return; @@ -596,7 +596,7 @@ protected function _checkSkipConfigOption(InputInterface $input): bool { trigger_error( __METHOD__ . ' removed, use $input->hasParameterOption(\'--skip-config\') instead', - E_USER_DEPRECATED + E_USER_DEPRECATED, ); return $input->hasParameterOption('--skip-config'); diff --git a/src/N98/Magento/Application/Config.php b/src/N98/Magento/Application/Config.php index 4d176e557..2a15d6984 100644 --- a/src/N98/Magento/Application/Config.php +++ b/src/N98/Magento/Application/Config.php @@ -45,7 +45,7 @@ class Config private OutputInterface $output; - public function __construct(array $initConfig = [], bool $isPharMode = false, OutputInterface $output = null) + public function __construct(array $initConfig = [], bool $isPharMode = false, ?OutputInterface $output = null) { $this->initConfig = $initConfig; $this->isPharMode = (bool) $isPharMode; @@ -71,7 +71,7 @@ public function checkConfigCommandAlias(InputInterface $input) $aliasCommandParams = array_slice( BinaryString::trimExplodeEmpty(' ', $alias[$aliasCommandName]), - 1 + 1, ); if ([] === $aliasCommandParams) { continue; @@ -82,7 +82,7 @@ public function checkConfigCommandAlias(InputInterface $input) $newArgv = array_merge( array_slice($oldArgv, 0, 2), $aliasCommandParams, - array_slice($oldArgv, 2) + array_slice($oldArgv, 2), ); $input = new ArgvInput($newArgv); } @@ -123,20 +123,20 @@ public function registerCustomCommands(Application $application): void $this->output->writeln( sprintf( 'Can not add nonexistent command class "%s" as command to the application', - $commandClass - ) + $commandClass, + ), ); $this->debugWriteln( 'Please check the configuration files contain the correct class-name. If the ' . - 'class-name is correct, check autoloader configurations.' + 'class-name is correct, check autoloader configurations.', ); } else { $this->debugWriteln( sprintf( 'Add command %s -> %s', $command->getName(), - get_class($command) - ) + get_class($command), + ), ); $application->add($command); } @@ -151,7 +151,7 @@ private function newCommand($className, ?string $commandName): ?Command { if (!is_string($className) && !is_object($className)) { throw new InvalidArgumentException( - sprintf('Command classname must be string, %s given', gettype($className)) + sprintf('Command classname must be string, %s given', gettype($className)), ); } @@ -162,7 +162,7 @@ private function newCommand($className, ?string $commandName): ?Command if (false === is_subclass_of($className, self::COMMAND_CLASS, true)) { $className = is_object($className) ? get_class($className) : $className; throw new InvalidArgumentException( - sprintf('Class "%s" is not a Command (subclass of "%s")', $className, self::COMMAND_CLASS) + sprintf('Class "%s" is not a Command (subclass of "%s")', $className, self::COMMAND_CLASS), ); } diff --git a/src/N98/Magento/Application/ConfigurationLoader.php b/src/N98/Magento/Application/ConfigurationLoader.php index 685ea2677..8faf00254 100644 --- a/src/N98/Magento/Application/ConfigurationLoader.php +++ b/src/N98/Magento/Application/ConfigurationLoader.php @@ -209,7 +209,7 @@ private function traversePluginFoldersForConfigFile(string $magentoRootFolder, $ /** * Check if there is a user config file. ~/.n98-magerun.yaml */ - public function loadUserConfig(array $config, string $magentoRootFolder = null): array + public function loadUserConfig(array $config, ?string $magentoRootFolder = null): array { if (is_null($this->_userConfig)) { $this->_userConfig = []; diff --git a/src/N98/Magento/Command/AbstractMagentoCommand.php b/src/N98/Magento/Command/AbstractMagentoCommand.php index 1b1ad2080..e4dbb2291 100644 --- a/src/N98/Magento/Command/AbstractMagentoCommand.php +++ b/src/N98/Magento/Command/AbstractMagentoCommand.php @@ -154,7 +154,7 @@ public function detectMagento(OutputInterface $output, bool $silent = true): voi if (!$silent) { $editionString = ($this->_magentoEnterprise ? ' (Enterprise Edition) ' : ''); $output->writeln( - 'Found Magento ' . $editionString . 'in folder "' . $this->_magentoRootFolder . '"' + 'Found Magento ' . $editionString . 'in folder "' . $this->_magentoRootFolder . '"', ); } @@ -240,7 +240,7 @@ protected function checkRepository(PackageInterface $package, string $targetFold $command = sprintf( 'cd %s && git rev-parse refs/tags/%s', escapeshellarg($this->normalizePath($targetFolder)), - escapeshellarg($package->getSourceReference()) + escapeshellarg($package->getSourceReference()), ); $existingTags = shell_exec($command); if ($existingTags === '' || $existingTags === '0' || $existingTags === false || $existingTags === null) { @@ -251,7 +251,7 @@ protected function checkRepository(PackageInterface $package, string $targetFold $command = sprintf( 'cd %s && hg log --template "{tags}" -r %s', escapeshellarg($targetFolder), - escapeshellarg($package->getSourceReference()) + escapeshellarg($package->getSourceReference()), ); $existingTag = shell_exec($command); if ($existingTag === $package->getSourceReference()) { @@ -302,7 +302,7 @@ protected function checkDeprecatedAliases(InputInterface $input, OutputInterface if (isset($this->_deprecatedAlias[$input->getArgument('command')])) { $output->writeln( 'Deprecated: ' . $this->_deprecatedAlias[$input->getArgument('command')] . - '' + '', ); } } @@ -396,8 +396,8 @@ protected function chooseInstallationFolder(InputInterface $input, OutputInterfa sprintf( 'Folder "%s" is not a Magento working copy (%s)', $folderName, - var_export($magentoHelper->getRootFolder(), true) - ) + var_export($magentoHelper->getRootFolder(), true), + ), ); } @@ -407,8 +407,8 @@ protected function chooseInstallationFolder(InputInterface $input, OutputInterfa sprintf( 'Magento working copy in %s seems already installed. Please remove %s and retry.', $folderName, - $localXml - ) + $localXml, + ), ); } } @@ -422,7 +422,7 @@ protected function chooseInstallationFolder(InputInterface $input, OutputInterfa $dialog = $this->getQuestionHelper(); $question = new Question( 'Enter installation folder: [' . $defaultFolder . ']', - $defaultFolder + $defaultFolder, ); $question->setValidator($validateInstallationFolder); @@ -471,7 +471,7 @@ protected function askForArrayEntry(array $entries, InputInterface $input, Outpu $questionHelper = $this->getQuestionHelper(); $question = new ChoiceQuestion( sprintf('%s', $question), - $entries + $entries, ); $question->setValidator($validator); @@ -510,7 +510,7 @@ protected function createSubCommandFactory( $input, $output, $commandConfig, - $configBag + $configBag, ); } @@ -527,7 +527,7 @@ public function addFormatOption(): self 'format', null, InputOption::VALUE_OPTIONAL, - 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']' + 'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']', ); return $this; } diff --git a/src/N98/Magento/Command/AbstractMagentoStoreConfigCommand.php b/src/N98/Magento/Command/AbstractMagentoStoreConfigCommand.php index ede887670..9d165a779 100644 --- a/src/N98/Magento/Command/AbstractMagentoStoreConfigCommand.php +++ b/src/N98/Magento/Command/AbstractMagentoStoreConfigCommand.php @@ -91,13 +91,13 @@ protected function configure(): void self::COMMAND_OPTION_ON, null, InputOption::VALUE_NONE, - 'Switch on' + 'Switch on', ) ->addOption( self::COMMAND_OPTION_OFF, null, InputOption::VALUE_NONE, - 'Switch off' + 'Switch off', ) ; @@ -106,7 +106,7 @@ protected function configure(): void self::COMMAND_OPTION_GLOBAL, null, InputOption::VALUE_NONE, - 'Set value on default scope' + 'Set value on default scope', ); } @@ -114,12 +114,12 @@ protected function configure(): void $this->addArgument( self::COMMAND_ARGUMENT_STORE, InputArgument::OPTIONAL, - 'Store code or ID' + 'Store code or ID', ); } } - protected function initialize(InputInterface $input,OutputInterface $output): void + protected function initialize(InputInterface $input, OutputInterface $output): void { // for backwards compatibility before v3.0 // @phpstan-ignore function.alreadyNarrowedType @@ -175,7 +175,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->configPath, $isFalse ? '1' : '0', $store->getId() == Mage_Core_Model_App::ADMIN_STORE_ID ? 'default' : 'stores', - $store->getId() + $store->getId(), ); $comment = @@ -224,8 +224,8 @@ protected function askAndSetDeveloperIp( $output->writeln( sprintf( 'Please note: developer IP restriction is enabled for %s.', - $devRestriction - ) + $devRestriction, + ), ); $questionHelper = $this->getQuestionHelper(); @@ -240,7 +240,7 @@ protected function askAndSetDeveloperIp( $this->setDeveloperIp($mageCoreModelStore, $newDeveloperIp); $output->writeln(sprintf( 'New developer IP restriction set to %s', - $newDeveloperIp + $newDeveloperIp, )); } @@ -264,11 +264,7 @@ protected function _initStore(InputInterface $input, OutputInterface $output) return $parameterHelper->askStore($input, $output, self::COMMAND_ARGUMENT_STORE, $this->withAdminStore); } - protected function _beforeSave(Mage_Core_Model_Store $mageCoreModelStore, bool $disabled): void - { - } + protected function _beforeSave(Mage_Core_Model_Store $mageCoreModelStore, bool $disabled): void {} - protected function _afterSave(Mage_Core_Model_Store $mageCoreModelStore, bool $disabled): void - { - } + protected function _afterSave(Mage_Core_Model_Store $mageCoreModelStore, bool $disabled): void {} } diff --git a/src/N98/Magento/Command/Admin/User/ChangeStatusCommand.php b/src/N98/Magento/Command/Admin/User/ChangeStatusCommand.php index 520213ce6..e1280cd3f 100644 --- a/src/N98/Magento/Command/Admin/User/ChangeStatusCommand.php +++ b/src/N98/Magento/Command/Admin/User/ChangeStatusCommand.php @@ -72,12 +72,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($user->getIsActive() == 1) { $output->writeln( 'User ' . $user->getUsername() . '' . - ' is now active' + ' is now active', ); } else { $output->writeln( 'User ' . $user->getUsername() . '' . - ' is now inactive' + ' is now inactive', ); } } catch (Exception $e) { diff --git a/src/N98/Magento/Command/Admin/User/CreateUserCommand.php b/src/N98/Magento/Command/Admin/User/CreateUserCommand.php index ac9c35c7b..7adacc87f 100644 --- a/src/N98/Magento/Command/Admin/User/CreateUserCommand.php +++ b/src/N98/Magento/Command/Admin/User/CreateUserCommand.php @@ -78,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'lastname' => $lastname, 'email' => $email, 'password' => $password, - 'is_active' => 1 + 'is_active' => 1, ])->save(); $user->setRoleIds([$role->getId()]) diff --git a/src/N98/Magento/Command/Admin/User/DeleteUserCommand.php b/src/N98/Magento/Command/Admin/User/DeleteUserCommand.php index 0fd49b448..54262959e 100644 --- a/src/N98/Magento/Command/Admin/User/DeleteUserCommand.php +++ b/src/N98/Magento/Command/Admin/User/DeleteUserCommand.php @@ -19,7 +19,7 @@ */ class DeleteUserCommand extends AbstractAdminUserCommand { - protected function configure() :void + protected function configure(): void { $this ->setName('admin:user:delete') diff --git a/src/N98/Magento/Command/Cache/CleanCommand.php b/src/N98/Magento/Command/Cache/CleanCommand.php index 9a962df17..5ae81c38d 100644 --- a/src/N98/Magento/Command/Cache/CleanCommand.php +++ b/src/N98/Magento/Command/Cache/CleanCommand.php @@ -28,13 +28,13 @@ protected function configure(): void 'reinit', null, InputOption::VALUE_NONE, - 'Reinitialise the config cache after cleaning' + 'Reinitialise the config cache after cleaning', ) ->addOption( 'no-reinit', null, InputOption::VALUE_NONE, - "Don't reinitialise the config cache after flushing" + "Don't reinitialise the config cache after flushing", ) ->setDescription('Clean magento cache') ; @@ -61,7 +61,7 @@ public function getHelp(): string HELP; } - + protected function execute(InputInterface $input, OutputInterface $output): int { $noReinitOption = $input->getOption('no-reinit'); diff --git a/src/N98/Magento/Command/Cache/Dir/FlushCommand.php b/src/N98/Magento/Command/Cache/Dir/FlushCommand.php index 49099bb29..f0d8c6585 100644 --- a/src/N98/Magento/Command/Cache/Dir/FlushCommand.php +++ b/src/N98/Magento/Command/Cache/Dir/FlushCommand.php @@ -82,7 +82,7 @@ private function emptyDirectory(string $path): bool foreach ($dir as $file => $info) { if ($info->isDir()) { $this->verbose( - 'Filesystem::recursiveRemoveDirectory() ' . $file . '' + 'Filesystem::recursiveRemoveDirectory() ' . $file . '', ); if (!isset($filesystem)) { $filesystem = new Filesystem(); diff --git a/src/N98/Magento/Command/Cache/FlushCommand.php b/src/N98/Magento/Command/Cache/FlushCommand.php index 36ecebecc..7a0c7da81 100644 --- a/src/N98/Magento/Command/Cache/FlushCommand.php +++ b/src/N98/Magento/Command/Cache/FlushCommand.php @@ -26,13 +26,13 @@ protected function configure(): void 'reinit', null, InputOption::VALUE_NONE, - 'Reinitialise the config cache after flushing' + 'Reinitialise the config cache after flushing', ) ->addOption( 'no-reinit', null, InputOption::VALUE_NONE, - "Don't reinitialise the config cache after flushing" + "Don't reinitialise the config cache after flushing", ) ->setDescription('Flush magento cache storage') ; diff --git a/src/N98/Magento/Command/Cache/ReportCommand.php b/src/N98/Magento/Command/Cache/ReportCommand.php index 8b1157ad6..3172c5d66 100644 --- a/src/N98/Magento/Command/Cache/ReportCommand.php +++ b/src/N98/Magento/Command/Cache/ReportCommand.php @@ -29,7 +29,7 @@ protected function configure(): void 'filter-tag', '', InputOption::VALUE_OPTIONAL, - 'Filter output by TAG (separate multiple tags by comma)' + 'Filter output by TAG (separate multiple tags by comma)', ) ->addFormatOption() ; diff --git a/src/N98/Magento/Command/Category/Create/DummyCommand.php b/src/N98/Magento/Command/Category/Create/DummyCommand.php index c7b30a38c..b9c02632b 100644 --- a/src/N98/Magento/Command/Category/Create/DummyCommand.php +++ b/src/N98/Magento/Command/Category/Create/DummyCommand.php @@ -27,9 +27,9 @@ class DummyCommand extends AbstractMagentoCommand public const DEFAULT_CATEGORY_NAME = 'My Awesome Category'; public const DEFAULT_CATEGORY_STATUS = 1; - // enabled + // enabled public const DEFAULT_CATEGORY_ANCHOR = 1; - // enabled + // enabled public const DEFAULT_STORE_ID = 1; // Default Store ID protected function configure(): void @@ -41,12 +41,12 @@ protected function configure(): void ->addArgument( 'children-categories-number', InputArgument::OPTIONAL, - "Number of children for each category created (default: 0 - use '-1' for random from 0 to 5)" + "Number of children for each category created (default: 0 - use '-1' for random from 0 to 5)", ) ->addArgument( 'category-name-prefix', InputArgument::OPTIONAL, - "Category Name Prefix (default: 'My Awesome Category')" + "Category Name Prefix (default: 'My Awesome Category')", ) ->setDescription('Create a dummy category'); } @@ -107,7 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $parentCategoryId = $category->getId(); $output->writeln( "CATEGORY: '" . $category->getName() . "' WITH ID: '" . $category->getId() . - "' CREATED!" + "' CREATED!", ); unset($category); @@ -130,7 +130,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $category->save(); $output->writeln( "CATEGORY CHILD: '" . $category->getName() . "' WITH ID: '" . $category->getId() . - "' CREATED!" + "' CREATED!", ); unset($category); } @@ -185,7 +185,7 @@ private function askForArguments(InputInterface $input, OutputInterface $output) } $output->writeln( - 'Number of categories to create: ' . $input->getArgument('category-number') . '' + 'Number of categories to create: ' . $input->getArgument('category-number') . '', ); $_argument['category-number'] = $input->getArgument('category-number'); @@ -193,7 +193,7 @@ private function askForArguments(InputInterface $input, OutputInterface $output) if (is_null($input->getArgument('children-categories-number'))) { $question = new Question( "Number of children for each category created (default: 0 - use '-1' for random from 0 to 5): ", - 0 + 0, ); $question->setValidator(function ($answer) { $answer = (int) $answer; @@ -212,7 +212,7 @@ private function askForArguments(InputInterface $input, OutputInterface $output) $output->writeln( 'Number of categories children to create: ' . $input->getArgument('children-categories-number') . - '' + '', ); $_argument['children-categories-number'] = $input->getArgument('children-categories-number'); @@ -220,7 +220,7 @@ private function askForArguments(InputInterface $input, OutputInterface $output) if (is_null($input->getArgument('category-name-prefix'))) { $question = new Question( "Please enter the category name prefix (default '" . self::DEFAULT_CATEGORY_NAME . "'): ", - self::DEFAULT_CATEGORY_NAME + self::DEFAULT_CATEGORY_NAME, ); $input->setArgument('category-name-prefix', $questionHelper->ask($input, $output, $question)); } diff --git a/src/N98/Magento/Command/Cms/Block/ToggleCommand.php b/src/N98/Magento/Command/Cms/Block/ToggleCommand.php index 6ae4a0804..c226bec0e 100644 --- a/src/N98/Magento/Command/Cms/Block/ToggleCommand.php +++ b/src/N98/Magento/Command/Cms/Block/ToggleCommand.php @@ -58,11 +58,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $newStatus = !$block->getIsActive(); $block - ->setIsActive((int)$newStatus) + ->setIsActive((int) $newStatus) ->save(); $output->writeln(sprintf( 'Block %s', - $newStatus ? 'enabled' : 'disabled' + $newStatus ? 'enabled' : 'disabled', )); return Command::SUCCESS; diff --git a/src/N98/Magento/Command/Config/AbstractConfigCommand.php b/src/N98/Magento/Command/Config/AbstractConfigCommand.php index c22e4875b..82f30518d 100644 --- a/src/N98/Magento/Command/Config/AbstractConfigCommand.php +++ b/src/N98/Magento/Command/Config/AbstractConfigCommand.php @@ -63,7 +63,7 @@ protected function _validateScopeParam(string $scope): string { if (!in_array($scope, $this->_scopes)) { throw new InvalidArgumentException( - sprintf('Invalid scope parameter, must be one of: %s.', implode(', ', $this->_scopes)) + sprintf('Invalid scope parameter, must be one of: %s.', implode(', ', $this->_scopes)), ); } @@ -79,7 +79,7 @@ protected function _convertScopeIdParam(string $scope, string $scopeId, bool $al if ($scope === 'default') { if ($scopeId !== '0') { throw new InvalidArgumentException( - sprintf("Invalid scope ID %d in scope '%s', must be 0", $scopeId, $scope) + sprintf("Invalid scope ID %d in scope '%s', must be 0", $scopeId, $scope), ); } @@ -90,7 +90,7 @@ protected function _convertScopeIdParam(string $scope, string $scopeId, bool $al $website = Mage::app()->getWebsite($scopeId); if (!$website) { throw new InvalidArgumentException( - sprintf("Invalid scope parameter, website '%s' does not exist.", $scopeId) + sprintf("Invalid scope parameter, website '%s' does not exist.", $scopeId), ); } @@ -101,7 +101,7 @@ protected function _convertScopeIdParam(string $scope, string $scopeId, bool $al $store = Mage::app()->getStore($scopeId); if (!$store) { throw new InvalidArgumentException( - sprintf("Invalid scope parameter. store '%s' does not exist.", $scopeId) + sprintf("Invalid scope parameter. store '%s' does not exist.", $scopeId), ); } @@ -111,13 +111,13 @@ protected function _convertScopeIdParam(string $scope, string $scopeId, bool $al $this->invalidScopeId( (string) $scopeId !== (string) (int) $scopeId, 'Invalid scope parameter, %s is not an integer value', - $scopeId + $scopeId, ); $this->invalidScopeId( 0 - (bool) $allowZeroScope >= (int) $scopeId, 'Invalid scope parameter, %s is not a positive integer value', - $scopeId + $scopeId, ); return $scopeId; @@ -133,7 +133,7 @@ private function invalidScopeId($condition, string $mask, string $scopeId): void } throw new InvalidArgumentException( - sprintf($mask, var_export($scopeId, true)) + sprintf($mask, var_export($scopeId, true)), ); } diff --git a/src/N98/Magento/Command/Config/DeleteCommand.php b/src/N98/Magento/Command/Config/DeleteCommand.php index 1d3c4a899..b05e34ab3 100644 --- a/src/N98/Magento/Command/Config/DeleteCommand.php +++ b/src/N98/Magento/Command/Config/DeleteCommand.php @@ -30,14 +30,14 @@ protected function configure(): void null, InputOption::VALUE_OPTIONAL, "The config value's scope (default, websites, stores)", - 'default' + 'default', ) ->addOption('scope-id', null, InputOption::VALUE_OPTIONAL, "The config value's scope ID", '0') ->addOption( 'force', null, InputOption::VALUE_NONE, - "Allow deletion of non-standard scope-id's for websites and stores" + "Allow deletion of non-standard scope-id's for websites and stores", ) ->addOption('all', null, InputOption::VALUE_NONE, 'Delete all entries by path') ; @@ -139,7 +139,7 @@ private function deleteConfigEntry(string $path, string $scope, int $scopeId): a $mageCoreModelConfig->deleteConfig( $path, $scope, - $scopeId + $scopeId, ); return [ diff --git a/src/N98/Magento/Command/Config/GetCommand.php b/src/N98/Magento/Command/Config/GetCommand.php index 56155d9bc..31ae63bac 100644 --- a/src/N98/Magento/Command/Config/GetCommand.php +++ b/src/N98/Magento/Command/Config/GetCommand.php @@ -29,14 +29,14 @@ protected function configure(): void 'scope', null, InputOption::VALUE_REQUIRED, - "The config value's scope (default, websites, stores)" + "The config value's scope (default, websites, stores)", ) ->addOption('scope-id', null, InputOption::VALUE_REQUIRED, "The config value's scope ID") ->addOption( 'decrypt', null, InputOption::VALUE_NONE, - "Decrypt the config value using local.xml's crypt key" + "Decrypt the config value using local.xml's crypt key", ) ->addOption('update-script', null, InputOption::VALUE_NONE, 'Output as update script lines') ->addOption('magerun-script', null, InputOption::VALUE_NONE, 'Output for usage with config:set') @@ -81,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($scopeId = $input->getOption('scope-id')) { $collection->addFieldToFilter( 'scope_id', - ['eq' => $scopeId] + ['eq' => $scopeId], ); } @@ -106,8 +106,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'scope_id' => $item->getScopeId(), 'value' => $this->_formatValue( $item->getValue(), - $input->getOption('decrypt') ? 'decrypt' : false - ) + $input->getOption('decrypt') ? 'decrypt' : false, + ), ]; } @@ -161,7 +161,7 @@ private function renderTableValue($value, ?string $format): string break; default: throw new UnexpectedValueException( - sprintf('Unhandled format %s', var_export($value, true)) + sprintf('Unhandled format %s', var_export($value, true)), ); } } @@ -181,8 +181,8 @@ protected function renderAsUpdateScript(OutputInterface $output, array $table): sprintf( '$installer->setConfigData(%s, %s);', var_export($row['path'], true), - var_export($row['value'], true) - ) + var_export($row['value'], true), + ), ); } else { $output->writeln( @@ -191,8 +191,8 @@ protected function renderAsUpdateScript(OutputInterface $output, array $table): var_export($row['path'], true), var_export($row['value'], true), var_export($row['scope'], true), - var_export($row['scope_id'], true) - ) + var_export($row['scope_id'], true), + ), ); } } @@ -216,7 +216,7 @@ protected function renderAsMagerunScript(OutputInterface $output, array $table): $row['scope_id'], $row['scope'], escapeshellarg($row['path']), - $displayValue + $displayValue, ); $output->writeln($line); } diff --git a/src/N98/Magento/Command/Config/SearchCommand.php b/src/N98/Magento/Command/Config/SearchCommand.php index a6d56d176..50f85db3e 100644 --- a/src/N98/Magento/Command/Config/SearchCommand.php +++ b/src/N98/Magento/Command/Config/SearchCommand.php @@ -61,8 +61,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int str_ireplace( $searchString, '' . $searchString . '', - (string) $match->node->comment - ) + (string) $match->node->comment, + ), ); } @@ -85,7 +85,7 @@ protected function _searchConfiguration(string $searchString, Varien_Simplexml_C if ($systemNode) { $tmp = $this->_searchConfigurationNodes( $searchString, - $systemNode->xpath($xpathSection) + $systemNode->xpath($xpathSection), ); $matches = array_merge($matches, $tmp); } diff --git a/src/N98/Magento/Command/Config/SetCommand.php b/src/N98/Magento/Command/Config/SetCommand.php index c0cbd03a1..a8ec31063 100644 --- a/src/N98/Magento/Command/Config/SetCommand.php +++ b/src/N98/Magento/Command/Config/SetCommand.php @@ -30,26 +30,26 @@ protected function configure(): void null, InputOption::VALUE_OPTIONAL, "The config value's scope (default, websites, stores)", - 'default' + 'default', ) ->addOption('scope-id', null, InputOption::VALUE_OPTIONAL, "The config value's scope ID", '0') ->addOption( 'encrypt', null, InputOption::VALUE_NONE, - "The config value should be encrypted using local.xml's crypt key" + "The config value should be encrypted using local.xml's crypt key", ) ->addOption( 'force', null, InputOption::VALUE_NONE, - "Allow creation of non-standard scope-id's for websites and stores" + "Allow creation of non-standard scope-id's for websites and stores", ) ->addOption( 'no-null', null, InputOption::VALUE_NONE, - 'Do not treat value NULL as ' . self::DISPLAY_NULL_UNKNOWN_VALUE . ' value' + 'Do not treat value NULL as ' . self::DISPLAY_NULL_UNKNOWN_VALUE . ' value', ) ; } @@ -98,12 +98,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int $input->getArgument('path'), $value, $scope, - $scopeId + $scopeId, ); $output->writeln( '' . $input->getArgument('path') . ' => ' . $valueDisplay . - '' + '', ); return Command::SUCCESS; diff --git a/src/N98/Magento/Command/Customer/CreateDummyCommand.php b/src/N98/Magento/Command/Customer/CreateDummyCommand.php index 522d0dedb..a6bf3e383 100644 --- a/src/N98/Magento/Command/Customer/CreateDummyCommand.php +++ b/src/N98/Magento/Command/Customer/CreateDummyCommand.php @@ -32,7 +32,7 @@ protected function configure(): void 'with-addresses', null, InputOption::VALUE_NONE, - 'Create dummy billing/shipping addresses for each customers' + 'Create dummy billing/shipping addresses for each customers', ) ->setDescription('Generate dummy customers. You can specify a count and a locale.') ->addFormatOption() @@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($outputPlain) { $output->writeln( 'Customer ' . $email . ' with password ' . $password . - ' successfully created' + ' successfully created', ); } else { $table[] = [$email, $password, $customer->getFirstname(), $customer->getLastname()]; diff --git a/src/N98/Magento/Command/Customer/DeleteCommand.php b/src/N98/Magento/Command/Customer/DeleteCommand.php index 97371d9e0..435820fd9 100644 --- a/src/N98/Magento/Command/Customer/DeleteCommand.php +++ b/src/N98/Magento/Command/Customer/DeleteCommand.php @@ -214,7 +214,7 @@ protected function deleteCustomer(Mage_Customer_Model_Customer $mageCustomerMode try { $mageCustomerModelCustomer->delete(); $this->output->writeln( - sprintf('%s (%s) was successfully deleted', $mageCustomerModelCustomer->getName(), $mageCustomerModelCustomer->getEmail()) + sprintf('%s (%s) was successfully deleted', $mageCustomerModelCustomer->getName(), $mageCustomerModelCustomer->getEmail()), ); return true; } catch (Exception $exception) { @@ -240,9 +240,9 @@ protected function batchDelete($customers): int public function validateInt(string $answer): string { - if ((int)$answer === 0) { + if ((int) $answer === 0) { throw new RuntimeException( - 'The range should be numeric and above 0 e.g. 1' + 'The range should be numeric and above 0 e.g. 1', ); } diff --git a/src/N98/Magento/Command/Customer/ListCommand.php b/src/N98/Magento/Command/Customer/ListCommand.php index ebceaf4d2..f58f1deeb 100644 --- a/src/N98/Magento/Command/Customer/ListCommand.php +++ b/src/N98/Magento/Command/Customer/ListCommand.php @@ -48,7 +48,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($input->getArgument('search')) { $mageCustomerModelResourceCustomerCollection->addAttributeToFilter( - [['attribute' => 'email', 'like' => '%' . $input->getArgument('search') . '%'], ['attribute' => 'firstname', 'like' => '%' . $input->getArgument('search') . '%'], ['attribute' => 'lastname', 'like' => '%' . $input->getArgument('search') . '%']] + [['attribute' => 'email', 'like' => '%' . $input->getArgument('search') . '%'], ['attribute' => 'firstname', 'like' => '%' . $input->getArgument('search') . '%'], ['attribute' => 'lastname', 'like' => '%' . $input->getArgument('search') . '%']], ); } diff --git a/src/N98/Magento/Command/Database/AbstractShowCommand.php b/src/N98/Magento/Command/Database/AbstractShowCommand.php index b4a9b6702..8c72a7e1d 100644 --- a/src/N98/Magento/Command/Database/AbstractShowCommand.php +++ b/src/N98/Magento/Command/Database/AbstractShowCommand.php @@ -43,7 +43,7 @@ protected function configure(): void ->addArgument( 'search', InputArgument::OPTIONAL, - 'Only output variables of specified name. The wildcard % is supported!' + 'Only output variables of specified name. The wildcard % is supported!', ) ->addFormatOption() ->addOption( @@ -51,13 +51,13 @@ protected function configure(): void null, InputOption::VALUE_OPTIONAL, 'Amount of decimals to display. If -1 then disabled', - 0 + 0, ) ->addOption( 'no-description', null, InputOption::VALUE_NONE, - 'Disable description' + 'Disable description', ); } diff --git a/src/N98/Magento/Command/Database/Compressor/Gzip.php b/src/N98/Magento/Command/Database/Compressor/Gzip.php index f33f0f0f1..a841bea20 100644 --- a/src/N98/Magento/Command/Database/Compressor/Gzip.php +++ b/src/N98/Magento/Command/Database/Compressor/Gzip.php @@ -69,8 +69,7 @@ public function getFileName($fileName, $pipe = true) } if (substr($fileName, -4, 4) === '.sql') { $fileName .= '.gz'; - } - else { + } else { $fileName .= '.sql.gz'; } } elseif (substr($fileName, -4, 4) === '.tgz') { diff --git a/src/N98/Magento/Command/Database/ConsoleCommand.php b/src/N98/Magento/Command/Database/ConsoleCommand.php index dd9857998..250f5ee4f 100644 --- a/src/N98/Magento/Command/Database/ConsoleCommand.php +++ b/src/N98/Magento/Command/Database/ConsoleCommand.php @@ -25,14 +25,14 @@ protected function configure(): void 'use-mycli-instead-of-mysql', null, InputOption::VALUE_NONE, - 'Use `mycli` as the MySQL client instead of `mysql`' + 'Use `mycli` as the MySQL client instead of `mysql`', ) ->addOption( 'no-auto-rehash', null, InputOption::VALUE_NONE, 'Same as `-A` option to MySQL client to turn off ' . - 'auto-complete (avoids long initial connection time).' + 'auto-complete (avoids long initial connection time).', ) ->setDescription('Opens mysql client by database config from local.xml'); } diff --git a/src/N98/Magento/Command/Database/DropCommand.php b/src/N98/Magento/Command/Database/DropCommand.php index cba470e9b..cb391d1c1 100644 --- a/src/N98/Magento/Command/Database/DropCommand.php +++ b/src/N98/Magento/Command/Database/DropCommand.php @@ -50,7 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $input, $output, new ConfirmationQuestion('Really drop database ' . $this->dbSettings['dbname'] . - ' ? [n]: ', false) + ' ? [n]: ', false), ); } diff --git a/src/N98/Magento/Command/Database/DumpCommand.php b/src/N98/Magento/Command/Database/DumpCommand.php index 676c9f9cc..50f4d8e22 100644 --- a/src/N98/Magento/Command/Database/DumpCommand.php +++ b/src/N98/Magento/Command/Database/DumpCommand.php @@ -37,105 +37,105 @@ protected function configure(): void 't', InputOption::VALUE_OPTIONAL, 'Append or prepend a timestamp to filename if a filename is provided. ' . - 'Possible values are "suffix", "prefix" or "no".' + 'Possible values are "suffix", "prefix" or "no".', ) ->addOption( 'compression', 'c', InputOption::VALUE_REQUIRED, - 'Compress the dump file using one of the supported algorithms' + 'Compress the dump file using one of the supported algorithms', ) ->addOption( 'dump-option', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - 'Option(s) to pass to mysqldump command. E.g. --dump-option="--set-gtid-purged=off"' + 'Option(s) to pass to mysqldump command. E.g. --dump-option="--set-gtid-purged=off"', ) ->addOption( 'xml', null, InputOption::VALUE_NONE, - 'Dump database in xml format' + 'Dump database in xml format', ) ->addOption( 'hex-blob', null, InputOption::VALUE_NONE, - 'Dump binary columns using hexadecimal notation (for example, "abc" becomes 0x616263)' + 'Dump binary columns using hexadecimal notation (for example, "abc" becomes 0x616263)', ) ->addOption( 'only-command', null, InputOption::VALUE_NONE, - 'Print only mysqldump command. Do not execute' + 'Print only mysqldump command. Do not execute', ) ->addOption( 'print-only-filename', null, InputOption::VALUE_NONE, - 'Execute and prints no output except the dump filename' + 'Execute and prints no output except the dump filename', ) ->addOption( 'dry-run', null, InputOption::VALUE_NONE, - 'do everything but the dump' + 'do everything but the dump', ) ->addOption( 'no-single-transaction', null, InputOption::VALUE_NONE, - 'Do not use single-transaction (not recommended, this is blocking)' + 'Do not use single-transaction (not recommended, this is blocking)', ) ->addOption( 'human-readable', null, InputOption::VALUE_NONE, 'Use a single insert with column names per row. Useful to track database differences. Use db:import ' . - '--optimize for speeding up the import.' + '--optimize for speeding up the import.', ) ->addOption( 'add-routines', null, InputOption::VALUE_NONE, - 'Include stored routines in dump (procedures & functions)' + 'Include stored routines in dump (procedures & functions)', ) ->addOption( 'no-tablespaces', null, InputOption::VALUE_NONE, - 'Use this option if you want to create a dump without having the PROCESS privilege' + 'Use this option if you want to create a dump without having the PROCESS privilege', ) ->addOption('stdout', null, InputOption::VALUE_NONE, 'Dump to stdout') ->addOption( 'strip', 's', InputOption::VALUE_OPTIONAL, - 'Tables to strip (dump only structure of those tables)' + 'Tables to strip (dump only structure of those tables)', ) ->addOption( 'exclude', 'e', InputOption::VALUE_OPTIONAL, - 'Tables to exclude from the dump' + 'Tables to exclude from the dump', ) ->addOption( 'include', 'i', InputOption::VALUE_OPTIONAL, - 'Tables to include in the dump' + 'Tables to include in the dump', ) ->addOption( 'force', 'f', InputOption::VALUE_NONE, - 'Do not prompt if all options are defined' + 'Do not prompt if all options are defined', ) ->addOption( 'connection', 'con', InputOption::VALUE_OPTIONAL, - 'Specify local.xml connection node, default to default_setup' + 'Specify local.xml connection node, default to default_setup', ) ->setDescription('Dumps database with mysqldump cli client'); } @@ -343,7 +343,7 @@ private function runExecs(array $execs, string $fileName, InputInterface $input, if ($this->nonCommandOutput($input)) { $output->writeln( 'Start dumping database ' . $this->dbSettings['dbname'] . - ' to file ' . $fileName . '' + ' to file ' . $fileName . '', ); } @@ -397,7 +397,7 @@ private function stripTables(InputInterface $input, OutputInterface $output): ar if ($this->nonCommandOutput($input)) { $output->writeln( - sprintf('No-data export for: %s', implode(' ', $stripTables)) + sprintf('No-data export for: %s', implode(' ', $stripTables)), ); } @@ -417,7 +417,7 @@ private function excludeTables(InputInterface $input, OutputInterface $output): if ($this->nonCommandOutput($input)) { $output->writeln( - sprintf('Excluded: %s', implode(' ', $excludeTables)) + sprintf('Excluded: %s', implode(' ', $excludeTables)), ); } } @@ -429,7 +429,7 @@ private function excludeTables(InputInterface $input, OutputInterface $output): $excludeTables = array_diff($allTables, $includeTables); if ($this->nonCommandOutput($input)) { $output->writeln( - sprintf('Included: %s', implode(' ', $includeTables)) + sprintf('Included: %s', implode(' ', $includeTables)), ); } } @@ -447,7 +447,7 @@ private function resolveDatabaseTables(string $list): array return $databaseHelper->resolveTables( explode(' ', $list), - $databaseHelper->getTableDefinitions($this->getCommandConfig()) + $databaseHelper->getTableDefinitions($this->getCommandConfig()), ); } @@ -472,12 +472,12 @@ protected function getFileName(InputInterface $input, OutputInterface $output, C ) && !$input->getOption('stdout')) { $defaultName = VerifyOrDie::filename( - $namePrefix . $this->dbSettings['dbname'] . $nameSuffix . $nameExtension + $namePrefix . $this->dbSettings['dbname'] . $nameSuffix . $nameExtension, ); if (isset($isDir) && $isDir) { $defaultName = rtrim($fileName, '/') . '/' . $defaultName; } - + if (!$input->getOption('force')) { $dialog = $this->getQuestionHelper(); $fileName = $dialog->ask( @@ -524,8 +524,8 @@ private function getFileNamePrefixSuffix($optionAddTime = null): array throw new InvalidArgumentException( sprintf( 'Invalid --add-time value %s, possible values are none (for) "suffix", "prefix" or "no"', - var_export($optionAddTime, true) - ) + var_export($optionAddTime, true), + ), ); } diff --git a/src/N98/Magento/Command/Database/ImportCommand.php b/src/N98/Magento/Command/Database/ImportCommand.php index ed0203f98..a4ce51be3 100644 --- a/src/N98/Magento/Command/Database/ImportCommand.php +++ b/src/N98/Magento/Command/Database/ImportCommand.php @@ -31,7 +31,7 @@ protected function configure(): void 'optimize', null, InputOption::VALUE_NONE, - 'Convert verbose INSERTs to short ones before import (not working with compression)' + 'Convert verbose INSERTs to short ones before import (not working with compression)', ) ->addOption('drop', null, InputOption::VALUE_NONE, 'Drop and recreate database before import') ->addOption('stdin', null, InputOption::VALUE_NONE, 'Import data from STDIN rather than file') @@ -212,7 +212,7 @@ protected function doImport(OutputInterface $output, string $fileName, string $e $commandOutput = null; $output->writeln( 'Importing SQL dump ' . $fileName . ' to database ' - . $this->dbSettings['dbname'] . '' + . $this->dbSettings['dbname'] . '', ); Exec::run($exec, $commandOutput, $returnValue); diff --git a/src/N98/Magento/Command/Database/InfoCommand.php b/src/N98/Magento/Command/Database/InfoCommand.php index 85ab7e71f..34ea40647 100644 --- a/src/N98/Magento/Command/Database/InfoCommand.php +++ b/src/N98/Magento/Command/Database/InfoCommand.php @@ -58,14 +58,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int $pdoConnectionString = sprintf( 'mysql:unix_socket=%s;dbname=%s', $this->dbSettings['unix_socket'], - $this->dbSettings['dbname'] + $this->dbSettings['dbname'], ); } else { $pdoConnectionString = sprintf( 'mysql:host=%s;port=%s;dbname=%s', $this->dbSettings['host'], $portOrDefault, - $this->dbSettings['dbname'] + $this->dbSettings['dbname'], ); } @@ -82,7 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $portOrDefault, $this->dbSettings['dbname'], $this->dbSettings['username'], - $this->dbSettings['password'] + $this->dbSettings['password'], ); } diff --git a/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php b/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php index ba071bbc1..c1303cea1 100644 --- a/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php +++ b/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php @@ -45,14 +45,14 @@ protected function configure(): void null, InputOption::VALUE_OPTIONAL, 'Check type (one of QUICK, FAST, MEDIUM, EXTENDED, CHANGED)', - 'MEDIUM' + 'MEDIUM', ) ->addOption('repair', null, InputOption::VALUE_NONE, 'Repair tables (only MyISAM)') ->addOption( 'table', null, InputOption::VALUE_OPTIONAL, - 'Process only given table (wildcards are supported)' + 'Process only given table (wildcards are supported)', ) ->addFormatOption(); } @@ -119,7 +119,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($input->getOption('table')) { $resolvedTables = [$this->dbHelper->resolveTables( ['@check'], - ['check' => ['tables' => explode(' ', $input->getOption('table'))]] + ['check' => ['tables' => explode(' ', $input->getOption('table'))]], )]; $tables = $resolvedTables[0]; } else { diff --git a/src/N98/Magento/Command/Database/StatusCommand.php b/src/N98/Magento/Command/Database/StatusCommand.php index 5e5c28873..9d08aa114 100644 --- a/src/N98/Magento/Command/Database/StatusCommand.php +++ b/src/N98/Magento/Command/Database/StatusCommand.php @@ -69,7 +69,7 @@ protected function generateRows(array $outputVars, bool $hasDescription): array ) ); $rows[] = ['Full table scans', sprintf('%.2f%%', $tableScanRate * 100), $this->formatDesc( - 'HINT: "Handler_read_rnd_next" is reset to zero when reached the value of 2^32 (4G).' + 'HINT: "Handler_read_rnd_next" is reset to zero when reached the value of 2^32 (4G).', )]; } @@ -80,7 +80,7 @@ protected function generateRows(array $outputVars, bool $hasDescription): array $rows[] = ['InnoDB Buffer Pool hit', sprintf('%.2f', $bufferHitRate * 100) . '%', $this->formatDesc( 'An InnoDB Buffer Pool hit ratio below 99.9% is a weak indicator that ' . - 'your InnoDB Buffer Pool could be increased.' + 'your InnoDB Buffer Pool could be increased.', )]; } @@ -119,7 +119,7 @@ protected function timeElapsedString($datetime, bool $full = false): string $diff = $now->diff($ago); $diff->w = floor($diff->d / 7); - $diff->d -= (int)$diff->w * 7; + $diff->d -= (int) $diff->w * 7; $string = ['y' => 'year', 'm' => 'month', 'h' => 'hour', 'i' => 'minute', 's' => 'second']; foreach ($string as $k => &$v) { diff --git a/src/N98/Magento/Command/Database/VariablesCommand.php b/src/N98/Magento/Command/Database/VariablesCommand.php index 402d9474d..be0af40f9 100644 --- a/src/N98/Magento/Command/Database/VariablesCommand.php +++ b/src/N98/Magento/Command/Database/VariablesCommand.php @@ -41,7 +41,7 @@ class VariablesCommand extends AbstractShowCommand 'desc' => '', // @todo add description everywhere 'opt' => '', - ] + ], ]; protected function configure(): void diff --git a/src/N98/Magento/Command/Developer/ClassLookupCommand.php b/src/N98/Magento/Command/Developer/ClassLookupCommand.php index 44e46d61c..59ce1cfed 100644 --- a/src/N98/Magento/Command/Developer/ClassLookupCommand.php +++ b/src/N98/Magento/Command/Developer/ClassLookupCommand.php @@ -43,11 +43,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $resolved = $this->_getConfig()->getGroupedClassName( $input->getArgument('type'), - $input->getArgument('name') + $input->getArgument('name'), ); $output->writeln( ucfirst($input->getArgument('type')) . ' ' . $input->getArgument('name') . ' ' . - 'resolves to ' . $resolved . '' + 'resolves to ' . $resolved . '', ); if (!class_exists('\\' . $resolved)) { diff --git a/src/N98/Magento/Command/Developer/Code/Model/MethodCommand.php b/src/N98/Magento/Command/Developer/Code/Model/MethodCommand.php index 9a98a0287..0f64ea2af 100644 --- a/src/N98/Magento/Command/Developer/Code/Model/MethodCommand.php +++ b/src/N98/Magento/Command/Developer/Code/Model/MethodCommand.php @@ -50,7 +50,7 @@ protected function configure(): void ->addArgument('modelName', InputOption::VALUE_REQUIRED, 'Model Name namespace/modelName') ->setDescription( 'Code annotations: Reads the columns from a table and writes the getter and setter methods into the ' . - 'class file for @methods.' + 'class file for @methods.', ); } @@ -123,13 +123,13 @@ protected function getGetterSetter(): array $getterSetter[] = sprintf( ' * @method %s get%s()', $this->getColumnType($colProp['Type']), - $this->camelize($colName) + $this->camelize($colName), ); $getterSetter[] = sprintf( ' * @method %s set%s(%s $value)', $modelClassName, $this->camelize($colName), - $this->getColumnType($colProp['Type']) + $this->getColumnType($colProp['Type']), ); } @@ -217,7 +217,7 @@ protected function checkClassFileName(): void $fileName = str_replace( ' ', DIRECTORY_SEPARATOR, - ucwords(str_replace('_', ' ', get_class($this->_mageModel))) + ucwords(str_replace('_', ' ', get_class($this->_mageModel))), ) . '.php'; $this->_fileName = $this->searchFullPath($fileName); @@ -239,7 +239,7 @@ protected function checkModel(): void ? $this->_mageModel->getResource()->getMainTable() : null; if (empty($this->_mageModelTable)) { throw new InvalidArgumentException( - 'Cannot find main table of model ' . $modelName + 'Cannot find main table of model ' . $modelName, ); } } diff --git a/src/N98/Magento/Command/Developer/Console/Psy/Shell.php b/src/N98/Magento/Command/Developer/Console/Psy/Shell.php index 64aeef5ea..7de565dea 100644 --- a/src/N98/Magento/Command/Developer/Console/Psy/Shell.php +++ b/src/N98/Magento/Command/Developer/Console/Psy/Shell.php @@ -14,7 +14,7 @@ */ class Shell extends BaseShell { - public function __construct(Configuration $configuration = null) + public function __construct(?Configuration $configuration = null) { parent::__construct($configuration); diff --git a/src/N98/Magento/Command/Developer/ConsoleCommand.php b/src/N98/Magento/Command/Developer/ConsoleCommand.php index afd443d84..5c45c7f84 100644 --- a/src/N98/Magento/Command/Developer/ConsoleCommand.php +++ b/src/N98/Magento/Command/Developer/ConsoleCommand.php @@ -27,7 +27,7 @@ protected function configure(): void $this ->setName('dev:console') ->setDescription( - 'Opens PHP interactive shell with initialized Mage::app() (Experimental)' + 'Opens PHP interactive shell with initialized Mage::app() (Experimental)', ) ; } @@ -51,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $edition = $this->getApplication()->isMagentoEnterprise() ? 'EE' : 'CE'; $shellOutput->writeln( 'Magento ' . Mage::getVersion() . ' ' . $edition . - ' initialized. ' . $ok + ' initialized. ' . $ok, ); } else { $shellOutput->writeln('Magento is not initialized.'); diff --git a/src/N98/Magento/Command/Developer/EmailTemplate/UsageCommand.php b/src/N98/Magento/Command/Developer/EmailTemplate/UsageCommand.php index 83d47b0b3..91e3f03dd 100644 --- a/src/N98/Magento/Command/Developer/EmailTemplate/UsageCommand.php +++ b/src/N98/Magento/Command/Developer/EmailTemplate/UsageCommand.php @@ -74,7 +74,7 @@ protected function findEmailTemplates(): array $configPaths[] = [ 'scope' => 'Unused', 'scope_id' => 'Unused', - 'path' => 'Unused' + 'path' => 'Unused', ]; } diff --git a/src/N98/Magento/Command/Developer/Ide/PhpStorm/MetaCommand.php b/src/N98/Magento/Command/Developer/Ide/PhpStorm/MetaCommand.php index 8dcdc7aa6..2de1999df 100644 --- a/src/N98/Magento/Command/Developer/Ide/PhpStorm/MetaCommand.php +++ b/src/N98/Magento/Command/Developer/Ide/PhpStorm/MetaCommand.php @@ -54,7 +54,7 @@ protected function configure(): void null, InputOption::VALUE_REQUIRED, 'PhpStorm Meta version (' . self::VERSION_OLD . ', ' . self::VERSION_2017 . ', ' . self::VERSION_2019 . ')', - self::VERSION_2019 + self::VERSION_2019, ) ->addOption('stdout', null, InputOption::VALUE_NONE, 'Print to stdout instead of file .phpstorm.meta.php') ->setDescription('Generates meta data file for PhpStorm auto completion (default version : ' . self::VERSION_2019 . ')'); @@ -78,7 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$input->getOption('stdout') && $classMaps[$group] !== []) { $output->writeln( - 'Generated definitions for ' . $group . ' group' + 'Generated definitions for ' . $group . ' group', ); } } @@ -100,7 +100,7 @@ protected function getRealClassname(SplFileInfo $file, string $classPrefix): str $path = $file->getRelativePathname(); if (substr($path, -4) !== '.php') { throw new UnexpectedValueException( - sprintf('Expected that relative file %s ends with ".php"', var_export($path, true)) + sprintf('Expected that relative file %s ends with ".php"', var_export($path, true)), ); } diff --git a/src/N98/Magento/Command/Developer/Log/DbCommand.php b/src/N98/Magento/Command/Developer/Log/DbCommand.php index befde3d23..d102b4256 100644 --- a/src/N98/Magento/Command/Developer/Log/DbCommand.php +++ b/src/N98/Magento/Command/Developer/Log/DbCommand.php @@ -75,7 +75,7 @@ protected function _replaceVariable(InputInterface $input, OutputInterface $outp } $output->writeln( - 'Changed ' . $variable . ' to ' . $newValue . '' + 'Changed ' . $variable . ' to ' . $newValue . '', ); $contents = preg_replace($debugLinePattern, 'protected ' . $variable . ' = ' . $newValue, $contents); diff --git a/src/N98/Magento/Command/Developer/Module/CreateCommand.php b/src/N98/Magento/Command/Developer/Module/CreateCommand.php index 8f8732f40..d1e90618d 100644 --- a/src/N98/Magento/Command/Developer/Module/CreateCommand.php +++ b/src/N98/Magento/Command/Developer/Module/CreateCommand.php @@ -137,7 +137,7 @@ protected function createModuleDirectories(InputInterface $input, OutputInterfac $this->_magentoRootFolder, $this->codePool, $this->vendorNamespace, - $this->moduleName + $this->moduleName, ); if (file_exists($moduleDir)) { @@ -198,7 +198,7 @@ protected function writeEtcModules(OutputInterface $output): void '%s/app/etc/modules/%s_%s.xml', $this->_magentoRootFolder, $this->vendorNamespace, - $this->moduleName + $this->moduleName, ); /** @var TwigHelper $helper */ @@ -214,7 +214,7 @@ protected function writeModuleConfig(OutputInterface $output): void $outFile = $this->moduleDirectory . '/etc/config.xml'; file_put_contents( $outFile, - $this->getHelper('twig')->render('dev/module/create/app/etc/modules/config.twig', $this->twigVars) + $this->getHelper('twig')->render('dev/module/create/app/etc/modules/config.twig', $this->twigVars), ); $output->writeln('Created file: ' . $outFile . ''); @@ -225,7 +225,7 @@ protected function writeModmanFile(OutputInterface $output): void $outFile = $this->_magentoRootFolder . '/../modman'; file_put_contents( $outFile, - $this->getHelper('twig')->render('dev/module/create/modman.twig', $this->twigVars) + $this->getHelper('twig')->render('dev/module/create/modman.twig', $this->twigVars), ); $output->writeln('Created file: ' . $outFile . ''); } @@ -247,7 +247,7 @@ protected function writeReadme(InputInterface $input, OutputInterface $output): file_put_contents( $outFile, - $this->getHelper('twig')->render('dev/module/create/app/etc/modules/readme.twig', $this->twigVars) + $this->getHelper('twig')->render('dev/module/create/app/etc/modules/readme.twig', $this->twigVars), ); $output->writeln('Created file: ' . $outFile . ''); } @@ -269,7 +269,7 @@ protected function writeComposerConfig(InputInterface $input, OutputInterface $o file_put_contents( $outFile, - $this->getHelper('twig')->render('dev/module/create/composer.twig', $this->twigVars) + $this->getHelper('twig')->render('dev/module/create/composer.twig', $this->twigVars), ); $output->writeln('Created file: ' . $outFile . ''); } diff --git a/src/N98/Magento/Command/Developer/Module/Dependencies/FromCommand.php b/src/N98/Magento/Command/Developer/Module/Dependencies/FromCommand.php index 75329de57..ce5a17413 100644 --- a/src/N98/Magento/Command/Developer/Module/Dependencies/FromCommand.php +++ b/src/N98/Magento/Command/Developer/Module/Dependencies/FromCommand.php @@ -54,7 +54,7 @@ protected function findModuleDependencies(string $moduleName, bool $recursive = if ($recursive) { $dependencies = array_merge( $dependencies, - $this->findModuleDependencies($dependencyName, $recursive) + $this->findModuleDependencies($dependencyName, $recursive), ); } } diff --git a/src/N98/Magento/Command/Developer/Module/Dependencies/OnCommand.php b/src/N98/Magento/Command/Developer/Module/Dependencies/OnCommand.php index 835b258ba..f8c33b7f3 100644 --- a/src/N98/Magento/Command/Developer/Module/Dependencies/OnCommand.php +++ b/src/N98/Magento/Command/Developer/Module/Dependencies/OnCommand.php @@ -94,7 +94,7 @@ protected function findModuleDependencies(string $moduleName, bool $recursive = if ($recursive) { $dependencies = array_merge( $dependencies, - $this->findModuleDependencies($dependencyName, $recursive) + $this->findModuleDependencies($dependencyName, $recursive), ); } } else { diff --git a/src/N98/Magento/Command/Developer/Module/Disableenable/AbstractCommand.php b/src/N98/Magento/Command/Developer/Module/Disableenable/AbstractCommand.php index a72b672e5..34562b6cd 100644 --- a/src/N98/Magento/Command/Developer/Module/Disableenable/AbstractCommand.php +++ b/src/N98/Magento/Command/Developer/Module/Disableenable/AbstractCommand.php @@ -86,8 +86,7 @@ protected function enableModule(string $module, OutputInterface $output): void { $xml = null; $validDecFile = false; - foreach ($this->getDeclaredModuleFiles() as $declaredModuleFile) - { + foreach ($this->getDeclaredModuleFiles() as $declaredModuleFile) { $content = file_get_contents($declaredModuleFile); if ($content) { $xml = new Varien_Simplexml_Element($content); @@ -112,7 +111,7 @@ protected function enableModule(string $module, OutputInterface $output): void $msg = sprintf( '%s: Failed to update declaration file [%s]', $module, - $validDecFile + $validDecFile, ); } } else { @@ -154,7 +153,7 @@ protected function getDeclaredModuleFiles(): array return array_reverse(array_merge( $collectModuleFiles['base'], $collectModuleFiles['mage'], - $collectModuleFiles['custom'] + $collectModuleFiles['custom'], )); } } diff --git a/src/N98/Magento/Command/Developer/Module/Observer/ListCommand.php b/src/N98/Magento/Command/Developer/Module/Observer/ListCommand.php index cae360926..4974a8846 100644 --- a/src/N98/Magento/Command/Developer/Module/Observer/ListCommand.php +++ b/src/N98/Magento/Command/Developer/Module/Observer/ListCommand.php @@ -31,7 +31,7 @@ protected function configure(): void 'sort', null, InputOption::VALUE_NONE, - 'Sort by event name ascending' + 'Sort by event name ascending', ); } diff --git a/src/N98/Magento/Command/Developer/Module/Rewrite/CanNotAutoloadCollaboratorClassException.php b/src/N98/Magento/Command/Developer/Module/Rewrite/CanNotAutoloadCollaboratorClassException.php index c9b79bc40..f366ac5bf 100644 --- a/src/N98/Magento/Command/Developer/Module/Rewrite/CanNotAutoloadCollaboratorClassException.php +++ b/src/N98/Magento/Command/Developer/Module/Rewrite/CanNotAutoloadCollaboratorClassException.php @@ -13,6 +13,4 @@ * * @author Tom Klingenberg (https://github.com/ktomk) */ -class CanNotAutoloadCollaboratorClassException extends Exception -{ -} +class CanNotAutoloadCollaboratorClassException extends Exception {} diff --git a/src/N98/Magento/Command/Developer/Module/Rewrite/ClassExistsChecker.php b/src/N98/Magento/Command/Developer/Module/Rewrite/ClassExistsChecker.php index e240b4864..1011b7aff 100644 --- a/src/N98/Magento/Command/Developer/Module/Rewrite/ClassExistsChecker.php +++ b/src/N98/Magento/Command/Developer/Module/Rewrite/ClassExistsChecker.php @@ -109,7 +109,7 @@ public function autoloadTerminator(string $notFoundClass): void $context->stack[] = [$notFoundClass, $className]; $context->lastException = new CanNotAutoloadCollaboratorClassException( - sprintf('%s for %s', $notFoundClass, $className) + sprintf('%s for %s', $notFoundClass, $className), ); throw $context->lastException; } diff --git a/src/N98/Magento/Command/Developer/Module/Rewrite/ClassExistsThrownException.php b/src/N98/Magento/Command/Developer/Module/Rewrite/ClassExistsThrownException.php index c8f3651b0..f99a49d28 100644 --- a/src/N98/Magento/Command/Developer/Module/Rewrite/ClassExistsThrownException.php +++ b/src/N98/Magento/Command/Developer/Module/Rewrite/ClassExistsThrownException.php @@ -15,6 +15,4 @@ * * @author Tom Klingenberg (https://github.com/ktomk) */ -class ClassExistsThrownException extends RuntimeException -{ -} +class ClassExistsThrownException extends RuntimeException {} diff --git a/src/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommand.php b/src/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommand.php index 97892014a..ba6e58719 100644 --- a/src/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommand.php +++ b/src/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommand.php @@ -29,7 +29,7 @@ protected function configure(): void 'log-junit', null, InputOption::VALUE_REQUIRED, - 'Log conflicts in JUnit XML format to defined file.' + 'Log conflicts in JUnit XML format to defined file.', ) ->setDescription('Lists all magento rewrite conflicts'); } @@ -122,7 +122,7 @@ protected function logJUnit(array $conflicts, string $filename, float $duration) $conflict['Type'], $conflict['Class'], $conflict['Rewrites'], - $conflict['Loaded Class'] + $conflict['Loaded Class'], ); $testCaseElement->addFailure($message, 'MagentoRewriteConflictException'); } @@ -173,7 +173,7 @@ private function writeOutput(OutputInterface $output, array $conflicts): void $message = sprintf( '%d %s found!', $number, - $number === 1 ? 'conflict was' : 'conflicts were' + $number === 1 ? 'conflict was' : 'conflicts were', ); $output->writeln('' . $message . ''); diff --git a/src/N98/Magento/Command/Developer/Module/UpdateCommand.php b/src/N98/Magento/Command/Developer/Module/UpdateCommand.php index 207f68808..6234c1adb 100644 --- a/src/N98/Magento/Command/Developer/Module/UpdateCommand.php +++ b/src/N98/Magento/Command/Developer/Module/UpdateCommand.php @@ -61,48 +61,48 @@ protected function configure(): void 'add-all', null, InputOption::VALUE_NONE, - 'Adds blocks, helpers and models classes to config.xml' + 'Adds blocks, helpers and models classes to config.xml', ) ->addOption( 'add-resource-model', null, InputOption::VALUE_NONE, - 'Adds resource model class and entities to config.xml' + 'Adds resource model class and entities to config.xml', ) ->addOption( 'add-routers', null, InputOption::VALUE_NONE, - 'Adds routers for frontend or admin areas to config.xml' + 'Adds routers for frontend or admin areas to config.xml', ) ->addOption( 'add-events', null, InputOption::VALUE_NONE, - 'Adds events observer to global, frontend or adminhtml areas to config.xml' + 'Adds events observer to global, frontend or adminhtml areas to config.xml', ) ->addOption( 'add-layout-updates', null, InputOption::VALUE_NONE, - 'Adds layout updates to frontend or adminhtml areas to config.xml' + 'Adds layout updates to frontend or adminhtml areas to config.xml', ) ->addOption( 'add-translate', null, InputOption::VALUE_NONE, - 'Adds translate configuration to frontend or adminhtml areas to config.xml' + 'Adds translate configuration to frontend or adminhtml areas to config.xml', ) ->addOption( 'add-default', null, InputOption::VALUE_NONE, - 'Adds default value (related to system.xml groups/fields)' + 'Adds default value (related to system.xml groups/fields)', ) ->setDescription('Update a Magento module.'); } - + protected function execute(InputInterface $input, OutputInterface $output): int { $this->initMagento(); @@ -179,7 +179,7 @@ protected function setModuleDirectory(string $moduleDir): void { if (!file_exists($moduleDir)) { throw new RuntimeException( - 'Module does not exist. Use dev:module:create to create it before updating. Stop.' + 'Module does not exist. Use dev:module:create to create it before updating. Stop.', ); } @@ -250,7 +250,7 @@ protected function addResourceModelNodeIfConfirmed(InputInterface $input, Output $question = new ConfirmationQuestion( 'Would you like to also add a Resource Model(y/n)?', - false + false, ); if ($questionHelper->ask($input, $output, $question)) { @@ -288,7 +288,7 @@ protected function setLayoutUpdatesNode(InputInterface $input, SimpleXMLElement $this->addLayoutUpdate( $configXml, $this->configNodes['layout_updates_area'], - $this->configNodes['layout_update_module'] + $this->configNodes['layout_update_module'], ); } } @@ -299,7 +299,7 @@ protected function setTranslateNode(InputInterface $input, SimpleXMLElement $con $this->addTranslate( $configXml, $this->configNodes['translate_area'], - $this->configNodes['translate_module'] + $this->configNodes['translate_module'], ); } } @@ -412,7 +412,7 @@ protected function askResourceModelOptions(InputInterface $input, OutputInterfac $question = new ConfirmationQuestion( 'Would you like to set mysql4 deprecated node(y/n)?', - false + false, ); if ($questionHelper->ask($input, $output, $question)) { $this->configNodes['resource_deprecated_mysql4_node'] = true; @@ -446,7 +446,7 @@ protected function askRoutersOptions(InputInterface $input, OutputInterface $out $question = new ChoiceQuestion( 'Area (frontend|admin): ', - ['frontend', 'admin'] + ['frontend', 'admin'], ); $area = trim($questionHelper->ask($input, $output, $question)); @@ -478,7 +478,7 @@ protected function askEventsOptions(InputInterface $input, OutputInterface $outp $question = new ChoiceQuestion( 'Area (global|frontend|adminhtml): ', - ['global', 'frontend', 'admin'] + ['global', 'frontend', 'admin'], ); $area = trim($questionHelper->ask($input, $output, $question)); @@ -518,7 +518,7 @@ protected function askLayoutUpdatesOptions(InputInterface $input, OutputInterfac $question = new ChoiceQuestion( 'Area (frontend|admin): ', - ['frontend', 'admin'] + ['frontend', 'admin'], ); $area = trim($questionHelper->ask($input, $output, $question)); @@ -550,7 +550,7 @@ protected function askTranslateOptions(InputInterface $input, OutputInterface $o $question = new ChoiceQuestion( 'Area (frontend|admin): ', - ['frontend', 'admin'] + ['frontend', 'admin'], ); $area = trim($questionHelper->ask($input, $output, $question)); @@ -611,7 +611,7 @@ protected function addResourceModel(SimpleXMLElement $simpleXml): void { if (is_null($simpleXml->global->models)) { throw new RuntimeException( - 'Global models node is not set. Run --add-models before --add-resource-model command.' + 'Global models node is not set. Run --add-models before --add-resource-model command.', ); } @@ -624,7 +624,7 @@ protected function addResourceModel(SimpleXMLElement $simpleXml): void if ($this->configNodes['resource_deprecated_mysql4_node'] === true) { $simpleXml->global->models->$resourceNamespace->deprecatedNode ? null : $resourceModelNode->addChild( 'deprecatedNode', - $resourceNamespace . '_eav_mysql4' + $resourceNamespace . '_eav_mysql4', ); } else { $this->removeChildNodeIfNotNull($resourceModelNode, 'deprecatedNode'); diff --git a/src/N98/Magento/Command/Developer/Report/CountCommand.php b/src/N98/Magento/Command/Developer/Report/CountCommand.php index dbdfc2510..0a54696f1 100644 --- a/src/N98/Magento/Command/Developer/Report/CountCommand.php +++ b/src/N98/Magento/Command/Developer/Report/CountCommand.php @@ -33,7 +33,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $dir = Mage::getBaseDir('var') . DIRECTORY_SEPARATOR . 'report' . DIRECTORY_SEPARATOR; $count = $this->getFileCount($dir); - $output->writeln((string)$count); + $output->writeln((string) $count); return Command::SUCCESS; } diff --git a/src/N98/Magento/Command/Developer/Setup/Script/Attribute/EntityType/AbstractEntityType.php b/src/N98/Magento/Command/Developer/Setup/Script/Attribute/EntityType/AbstractEntityType.php index 959a7ff40..c447997e2 100644 --- a/src/N98/Magento/Command/Developer/Setup/Script/Attribute/EntityType/AbstractEntityType.php +++ b/src/N98/Magento/Command/Developer/Setup/Script/Attribute/EntityType/AbstractEntityType.php @@ -54,7 +54,7 @@ public function getAttributeLabels($attribute): array // FIXME: after having this warning in for some time, promote to a parameter type-hint. if (!$attribute instanceof Mage_Eav_Model_Entity_Attribute) { trigger_error( - sprintf('Attribute not of type Mage_Eav_Model_Entity_Attribute, is of type %s', get_class($attribute)) + sprintf('Attribute not of type Mage_Eav_Model_Entity_Attribute, is of type %s', get_class($attribute)), ); } @@ -85,7 +85,7 @@ protected function getOptions(Mage_Eav_Model_Entity_Attribute $mageEavModelEntit ->from(['o' => $resourceModel->getTableName('eav_attribute_option')]) ->join( ['ov' => $resourceModel->getTableName('eav_attribute_option_value')], - 'o.option_id = ov.option_id' + 'o.option_id = ov.option_id', ) ->where('o.attribute_id = ?', $mageEavModelEntityAttribute->getId()) ->where('ov.store_id = 0') diff --git a/src/N98/Magento/Command/Developer/Setup/Script/AttributeCommand.php b/src/N98/Magento/Command/Developer/Setup/Script/AttributeCommand.php index c1e0f8b57..bc7bc1cb3 100644 --- a/src/N98/Magento/Command/Developer/Setup/Script/AttributeCommand.php +++ b/src/N98/Magento/Command/Developer/Setup/Script/AttributeCommand.php @@ -59,7 +59,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $generator = Factory::create($entityType, $attribute); $generator->setReadConnection( - $coreResource->getConnection('core_read') + $coreResource->getConnection('core_read'), ); $code = $generator->generateCode(); $warnings = $generator->getWarnings(); diff --git a/src/N98/Magento/Command/Developer/Theme/DuplicatesCommand.php b/src/N98/Magento/Command/Developer/Theme/DuplicatesCommand.php index 692535a50..a38b7c9ae 100644 --- a/src/N98/Magento/Command/Developer/Theme/DuplicatesCommand.php +++ b/src/N98/Magento/Command/Developer/Theme/DuplicatesCommand.php @@ -31,13 +31,13 @@ protected function configure(): void 'originalTheme', InputArgument::OPTIONAL, 'Original theme to comapre. Default is "base/default"', - 'base/default' + 'base/default', ) ->addOption( 'log-junit', null, InputOption::VALUE_REQUIRED, - 'Log duplicates in JUnit XML format to defined file.' + 'Log duplicates in JUnit XML format to defined file.', ) ->setDescription('Find duplicate files (templates, layout, locale, etc.) between two themes.') ; @@ -56,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->detectMagento($output); $referenceFiles = $this->getChecksums( - $this->_magentoRootFolder . '/app/design/frontend/' . $input->getArgument('originalTheme') + $this->_magentoRootFolder . '/app/design/frontend/' . $input->getArgument('originalTheme'), ); $themeFolder = $this->_magentoRootFolder . '/app/design/frontend/' . $input->getArgument('theme'); @@ -115,13 +115,13 @@ protected function logJUnit(InputInterface $input, array $duplicates, string $fi $testCaseElement = $testSuiteElement->addTestCase(); $testCaseElement->setName( 'Magento Duplicate Theme Files: ' . $input->getArgument('theme') . ' | ' . - $input->getArgument('originalTheme') + $input->getArgument('originalTheme'), ); $testCaseElement->setClassname('ConflictsCommand'); foreach ($duplicates as $duplicate) { $testCaseElement->addFailure( sprintf('Duplicate File: %s', $duplicate), - 'MagentoThemeDuplicateFileException' + 'MagentoThemeDuplicateFileException', ); } diff --git a/src/N98/Magento/Command/Developer/Theme/InfoCommand.php b/src/N98/Magento/Command/Developer/Theme/InfoCommand.php index 483877725..9dcaae1b3 100644 --- a/src/N98/Magento/Command/Developer/Theme/InfoCommand.php +++ b/src/N98/Magento/Command/Developer/Theme/InfoCommand.php @@ -67,7 +67,7 @@ protected function _displayTable(OutputInterface $output, Mage_Core_Model_Store $this->writeSection( $output, - 'Current design setting on store: ' . $websiteCode . $mageCoreModelStore->getCode() + 'Current design setting on store: ' . $websiteCode . $mageCoreModelStore->getCode(), ); $storeInfoLines = $this->_parse($this->_configNodesWithExceptions, $mageCoreModelStore, true); $storeInfoLines = array_merge($storeInfoLines, $this->_parse($this->_configNodes, $mageCoreModelStore)); @@ -88,7 +88,7 @@ protected function _parse(array $nodes, Mage_Core_Model_Store $mageCoreModelStor $result[] = [$nodeLabel, (string) Mage::getConfig()->getNode( $node, AbstractMagentoStoreConfigCommand::SCOPE_STORE_VIEW, - $mageCoreModelStore->getCode() + $mageCoreModelStore->getCode(), )]; if ($withExceptions) { $result[] = [$nodeLabel . ' exceptions', $this->_parseException($node, $mageCoreModelStore)]; @@ -103,7 +103,7 @@ protected function _parseException(string $node, Mage_Core_Model_Store $mageCore $exception = (string) Mage::getConfig()->getNode( $node . self::THEMES_EXCEPTION, AbstractMagentoStoreConfigCommand::SCOPE_STORE_VIEW, - $mageCoreModelStore->getCode() + $mageCoreModelStore->getCode(), ); if ($exception === '' || $exception === '0') { diff --git a/src/N98/Magento/Command/Developer/Translate/SetCommand.php b/src/N98/Magento/Command/Developer/Translate/SetCommand.php index dbb27ae08..b8c6dd13b 100644 --- a/src/N98/Magento/Command/Developer/Translate/SetCommand.php +++ b/src/N98/Magento/Command/Developer/Translate/SetCommand.php @@ -57,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $input->getArgument('string'), $input->getArgument('translate'), $locale, - $store->getId() + $store->getId(), ); $output->writeln( @@ -65,8 +65,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'Translated (%s): %s => %s', $locale, $input->getArgument('string'), - $input->getArgument('translate') - ) + $input->getArgument('translate'), + ), ); $input = new StringInput('cache:flush'); diff --git a/src/N98/Magento/Command/Eav/Attribute/Create/DummyCommand.php b/src/N98/Magento/Command/Eav/Attribute/Create/DummyCommand.php index 8ebe09a32..9585d1d15 100644 --- a/src/N98/Magento/Command/Eav/Attribute/Create/DummyCommand.php +++ b/src/N98/Magento/Command/Eav/Attribute/Create/DummyCommand.php @@ -56,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $output->writeln( - 'This only create sample attribute values, do not use on production environment' + 'This only create sample attribute values, do not use on production environment', ); // Ask for Arguments @@ -65,8 +65,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln( sprintf( "Locale '%s' not supported, switch to default locale 'us_US'.", - $input->getArgument('locale') - ) + $input->getArgument('locale'), + ), ); $argument['locale'] = 'en_US'; } else { diff --git a/src/N98/Magento/Command/Eav/Attribute/RemoveCommand.php b/src/N98/Magento/Command/Eav/Attribute/RemoveCommand.php index bbf259987..d8b23a13f 100644 --- a/src/N98/Magento/Command/Eav/Attribute/RemoveCommand.php +++ b/src/N98/Magento/Command/Eav/Attribute/RemoveCommand.php @@ -56,7 +56,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $message = sprintf( 'Attribute: "%s" does not exist for entity type: "%s"', $attributeCode, - $entityType + $entityType, ); $output->writeln(sprintf('%s', $message)); } else { @@ -75,8 +75,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int sprintf( 'Successfully removed attribute: "%s" from entity type: "%s"', $attributeCode, - $entityType - ) + $entityType, + ), ); } } diff --git a/src/N98/Magento/Command/Eav/Attribute/ViewCommand.php b/src/N98/Magento/Command/Eav/Attribute/ViewCommand.php index a481df146..9d0f7c1ba 100644 --- a/src/N98/Magento/Command/Eav/Attribute/ViewCommand.php +++ b/src/N98/Magento/Command/Eav/Attribute/ViewCommand.php @@ -66,7 +66,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int ['Cache-ID-Tags', $cacheIdTags ? implode(',', $cacheIdTags) : ''], ['Cache-Tags', $cacheTags ? implode(',', $cacheTags) : ''], ['Default-Value', $attribute->getDefaultValue() ?: ''], - ['Flat-Columns', $flatColumns ? implode(',', array_keys($flatColumns)) : ''] + ['Flat-Columns', $flatColumns ? implode(',', array_keys($flatColumns)) : ''], ]; $flatIndexes = $attribute->getFlatIndexes() ? $attribute->getFlatIndexes() : ''; diff --git a/src/N98/Magento/Command/Indexer/AbstractIndexerCommand.php b/src/N98/Magento/Command/Indexer/AbstractIndexerCommand.php index ab8ca0553..2a5f21f53 100644 --- a/src/N98/Magento/Command/Indexer/AbstractIndexerCommand.php +++ b/src/N98/Magento/Command/Indexer/AbstractIndexerCommand.php @@ -45,7 +45,7 @@ protected function getIndexerList(): array 'code' => $indexer->getIndexerCode(), 'status' => $indexer->getStatus(), 'last_runtime' => $lastReadableRuntime, - 'runtime_seconds' => $runtimeInSeconds + 'runtime_seconds' => $runtimeInSeconds, ]; } @@ -102,7 +102,7 @@ protected function writeEstimatedEnd(OutputInterface $output, Mage_Index_Model_P $estimatedEnd->add(new DateInterval('PT' . $runtimeInSeconds . 'S')); $output->writeln( - sprintf('Estimated end: %s', $estimatedEnd->format('Y-m-d H:i:s T')) + sprintf('Estimated end: %s', $estimatedEnd->format('Y-m-d H:i:s T')), ); } @@ -116,8 +116,8 @@ protected function writeSuccessResult( sprintf( 'Successfully re-indexed %s (Runtime: %s)', $mageIndexModelProcess->getIndexerCode(), - DateTimeUtils::difference($startTime, $endTime) - ) + DateTimeUtils::difference($startTime, $endTime), + ), ); } @@ -133,8 +133,8 @@ protected function writeFailedResult( 'Reindex finished with error message "%s". %s (Runtime: %s)', $errorMessage, $mageIndexModelProcess->getIndexerCode(), - DateTimeUtils::difference($startTime, $endTime) - ) + DateTimeUtils::difference($startTime, $endTime), + ), ); } @@ -162,7 +162,7 @@ protected function executeProcesses(OutputInterface $output, array $processes): private function executeProcess(OutputInterface $output, Mage_Index_Model_Process $mageIndexModelProcess): bool { $output->writeln( - sprintf('Started reindex of: %s', $mageIndexModelProcess->getIndexerCode()) + sprintf('Started reindex of: %s', $mageIndexModelProcess->getIndexerCode()), ); $this->writeEstimatedEnd($output, $mageIndexModelProcess); diff --git a/src/N98/Magento/Command/Indexer/ReindexCommand.php b/src/N98/Magento/Command/Indexer/ReindexCommand.php index e160bfae4..ecb4c646b 100644 --- a/src/N98/Magento/Command/Indexer/ReindexCommand.php +++ b/src/N98/Magento/Command/Indexer/ReindexCommand.php @@ -46,7 +46,7 @@ public function getHelp(): string HELP; } - + protected function execute(InputInterface $input, OutputInterface $output): int { $this->detectMagento($output); @@ -93,7 +93,7 @@ private function askForIndexCodes(InputInterface $input, OutputInterface $output $choices[] = sprintf( '%-40s (last runtime: %s)', $indexer['code'], - $indexer['last_runtime'] + $indexer['last_runtime'], ); } @@ -115,7 +115,7 @@ private function askForIndexCodes(InputInterface $input, OutputInterface $output $questionHelper = $this->getQuestionHelper(); $choiceQuestion = new ChoiceQuestion( 'Please select a indexer: ', - $choices + $choices, ); $choiceQuestion->setValidator($validator); diff --git a/src/N98/Magento/Command/Installer/InstallCommand.php b/src/N98/Magento/Command/Installer/InstallCommand.php index 8eca2ebf7..63372b563 100644 --- a/src/N98/Magento/Command/Installer/InstallCommand.php +++ b/src/N98/Magento/Command/Installer/InstallCommand.php @@ -32,7 +32,7 @@ protected function configure(): void 'magentoVersionByName', null, InputOption::VALUE_OPTIONAL, - 'Magento version name instead of order number' + 'Magento version name instead of order number', ) ->addOption('installationFolder', null, InputOption::VALUE_OPTIONAL, 'Installation folder') ->addOption('dbHost', null, InputOption::VALUE_OPTIONAL, 'Database host') @@ -45,39 +45,39 @@ protected function configure(): void 'useDefaultConfigParams', null, InputOption::VALUE_OPTIONAL, - 'Use default installation parameters defined in the yaml file' + 'Use default installation parameters defined in the yaml file', ) ->addOption('baseUrl', null, InputOption::VALUE_OPTIONAL, 'Installation base url') ->addOption( 'replaceHtaccessFile', null, InputOption::VALUE_OPTIONAL, - 'Generate htaccess file (for non vhost environment)' + 'Generate htaccess file (for non vhost environment)', ) ->addOption( 'noDownload', null, InputOption::VALUE_NONE, 'If set skips download step. Used when installationFolder is already a Magento installation that has ' . - 'to be installed on the given database.' + 'to be installed on the given database.', ) ->addOption( 'only-download', null, InputOption::VALUE_NONE, - 'Downloads (and extracts) source code' + 'Downloads (and extracts) source code', ) ->addOption( 'forceUseDb', null, InputOption::VALUE_NONE, - 'If --forceUseDb passed, force to use given database if it already exists.' + 'If --forceUseDb passed, force to use given database if it already exists.', ) ->addOption( 'composer-use-same-php-binary', null, InputOption::VALUE_NONE, - 'If --composer-use-same-php-binary passed, will invoke composer with the same PHP binary' + 'If --composer-use-same-php-binary passed, will invoke composer with the same PHP binary', ) ->setDescription('Install magento'); } @@ -123,7 +123,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $subCommandFactory = $this->createSubCommandFactory( $input, $output, - 'N98\Magento\Command\Installer\SubCommand' // sub-command namespace + 'N98\Magento\Command\Installer\SubCommand', // sub-command namespace ); // @todo load commands from config diff --git a/src/N98/Magento/Command/Installer/SubCommand/ChooseInstallationFolder.php b/src/N98/Magento/Command/Installer/SubCommand/ChooseInstallationFolder.php index fbf8ab258..adf588a93 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/ChooseInstallationFolder.php +++ b/src/N98/Magento/Command/Installer/SubCommand/ChooseInstallationFolder.php @@ -7,6 +7,7 @@ use InvalidArgumentException; use N98\Magento\Command\SubCommand\AbstractSubCommand; use Symfony\Component\Console\Question\Question; + use function chdir; /** @@ -54,16 +55,16 @@ public function execute() $question = new Question( sprintf( 'Enter installation folder: [%s]', - $defaultFolder + $defaultFolder, ), - $defaultFolder + $defaultFolder, ); $question->setValidator($validateInstallationFolder); $installationFolder = $this->getCommand()->getQuestionHelper()->ask( $this->input, $this->output, - $question + $question, ); } else { // @Todo improve validation and bring it to 1 single function diff --git a/src/N98/Magento/Command/Installer/SubCommand/CreateDatabase.php b/src/N98/Magento/Command/Installer/SubCommand/CreateDatabase.php index 7f6bd237c..36e85b0dc 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/CreateDatabase.php +++ b/src/N98/Magento/Command/Installer/SubCommand/CreateDatabase.php @@ -73,7 +73,7 @@ public function execute() $question = new Question( 'Please enter the database host [' . $dbHostDefault . ']: ', - $dbHostDefault + $dbHostDefault, ); $question->setValidator($this->notEmptyCallback); @@ -82,8 +82,8 @@ public function execute() $questionHelper->ask( $this->input, $this->output, - $question - ) + $question, + ), ); // Port @@ -93,9 +93,9 @@ public function execute() $question = new Question( sprintf( 'Please enter the database port [%s]: ', - $dbPortDefault + $dbPortDefault, ), - $dbPortDefault + $dbPortDefault, ); $question->setValidator($this->notEmptyCallback); @@ -104,8 +104,8 @@ public function execute() (int) $questionHelper->ask( $this->input, $this->output, - $question - ) + $question, + ), ); // User @@ -115,9 +115,9 @@ public function execute() $question = new Question( sprintf( 'Please enter the database username [%s]: ', - $dbUserDefault + $dbUserDefault, ), - $dbUserDefault + $dbUserDefault, ); $question->setValidator($this->notEmptyCallback); @@ -126,8 +126,8 @@ public function execute() $questionHelper->ask( $this->input, $this->output, - $question - ) + $question, + ), ); // Password @@ -137,9 +137,9 @@ public function execute() $question = new Question( sprintf( 'Please enter the database password [%s]: ', - $dbPassDefault + $dbPassDefault, ), - $dbPassDefault + $dbPassDefault, ); $this->config->setString( @@ -147,8 +147,8 @@ public function execute() $questionHelper->ask( $this->input, $this->output, - $question - ) + $question, + ), ); // DB-Name @@ -158,9 +158,9 @@ public function execute() $question = new Question( sprintf( 'Please enter the database name [%s]: ', - $dbNameDefault + $dbNameDefault, ), - $dbNameDefault + $dbNameDefault, ); $question->setValidator($this->notEmptyCallback); @@ -169,8 +169,8 @@ public function execute() $questionHelper->ask( $this->input, $this->output, - $question - ) + $question, + ), ); $db = $this->validateDatabaseSettings($this->input, $this->output); @@ -189,7 +189,7 @@ protected function validateDatabaseSettings(InputInterface $input, OutputInterfa $dsn = sprintf( 'mysql:host=%s;port=%s', $this->config->getString('db_host'), - $this->config->getString('db_port') + $this->config->getString('db_port'), ); $pdo = new PDO($dsn, $this->config->getString('db_user'), $this->config->getString('db_pass')); diff --git a/src/N98/Magento/Command/Installer/SubCommand/DownloadMagento.php b/src/N98/Magento/Command/Installer/SubCommand/DownloadMagento.php index 2b0c8eceb..50e256604 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/DownloadMagento.php +++ b/src/N98/Magento/Command/Installer/SubCommand/DownloadMagento.php @@ -46,7 +46,7 @@ private function implementation(): void $skipInstallation = $dialog->ask( $this->input, $this->output, - new ConfirmationQuestion('A magento installation already exists in this folder. Skip download? [y]: ', true) + new ConfirmationQuestion('A magento installation already exists in this folder. Skip download? [y]: ', true), ); if ($skipInstallation) { @@ -90,7 +90,7 @@ private function composerCreateProject(array $package): void if (Exec::CODE_CLEAN_EXIT !== $code) { throw new RuntimeException( - 'Non-zero exit code for composer create-project command: ' . $process->getCommandLine() + 'Non-zero exit code for composer create-project command: ' . $process->getCommandLine(), ); } } @@ -103,9 +103,9 @@ protected function composerAllowPlugins(string $pluginName): void [ 'config', 'allow-plugins.' . $pluginName, - 'true' - ] - ) + 'true', + ], + ), ); $process->setTimeout(86400); diff --git a/src/N98/Magento/Command/Installer/SubCommand/InstallComposer.php b/src/N98/Magento/Command/Installer/SubCommand/InstallComposer.php index 23ddb729d..10e8bc094 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/InstallComposer.php +++ b/src/N98/Magento/Command/Installer/SubCommand/InstallComposer.php @@ -19,7 +19,7 @@ class InstallComposer extends AbstractSubCommand /** * @var int */ - const EXEC_STATUS_OK = 0; + public const EXEC_STATUS_OK = 0; /** * @return void diff --git a/src/N98/Magento/Command/Installer/SubCommand/InstallMagento.php b/src/N98/Magento/Command/Installer/SubCommand/InstallMagento.php index 64f7ac9cd..baaae887d 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/InstallMagento.php +++ b/src/N98/Magento/Command/Installer/SubCommand/InstallMagento.php @@ -21,7 +21,7 @@ */ class InstallMagento extends AbstractSubCommand { - const MAGENTO_INSTALL_SCRIPT_PATH = 'install.php'; + public const MAGENTO_INSTALL_SCRIPT_PATH = 'install.php'; protected Closure $notEmptyCallback; @@ -49,150 +49,150 @@ public function execute(): void $question = new Question( sprintf( 'Please enter the session save: [%s]: ', - $defaults['session_save'] + $defaults['session_save'], ), - $defaults['session_save'] + $defaults['session_save'], ); $sessionSave = $useDefaultConfigParams ? $defaults['session_save'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $question = new Question( sprintf( 'Please enter the admin/backend frontname: [%s] ', - $defaults['admin_frontname'] + $defaults['admin_frontname'], ), - $defaults['admin_frontname'] + $defaults['admin_frontname'], ); $question->setValidator($this->notEmptyCallback); $adminFrontname = $useDefaultConfigParams ? $defaults['admin_frontname'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $question = new Question( sprintf( 'Please enter the default currency code: [%s]: ', - $defaults['currency'] + $defaults['currency'], ), - $defaults['currency'] + $defaults['currency'], ); $question->setValidator($this->notEmptyCallback); $currency = $useDefaultConfigParams ? $defaults['currency'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $question = new Question( sprintf( 'Please enter the locale code: [%s]: ', - $defaults['locale'] + $defaults['locale'], ), - $defaults['locale'] + $defaults['locale'], ); $question->setValidator($this->notEmptyCallback); $locale = $useDefaultConfigParams ? $defaults['locale'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $question = new Question( sprintf( 'Please enter the timezone: [%s]: ', - $defaults['timezone'] + $defaults['timezone'], ), - $defaults['timezone'] + $defaults['timezone'], ); $question->setValidator($this->notEmptyCallback); $timezone = $useDefaultConfigParams ? $defaults['timezone'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $question = new Question( sprintf( 'Please enter the admin username: [%s]: ', - $defaults['admin_username'] + $defaults['admin_username'], ), - $defaults['admin_username'] + $defaults['admin_username'], ); $question->setValidator($this->notEmptyCallback); $adminUsername = $useDefaultConfigParams ? $defaults['admin_username'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $question = new Question( sprintf( 'Please enter the admin password: [%s]: ', - $defaults['admin_password'] + $defaults['admin_password'], ), - $defaults['admin_password'] + $defaults['admin_password'], ); $question->setValidator($this->notEmptyCallback); $adminPassword = $useDefaultConfigParams ? $defaults['admin_password'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $question = new Question( sprintf( "Please enter the admin's firstname: [%s]: ", - $defaults['admin_firstname'] + $defaults['admin_firstname'], ), - $defaults['admin_firstname'] + $defaults['admin_firstname'], ); $question->setValidator($this->notEmptyCallback); $adminFirstname = $useDefaultConfigParams ? $defaults['admin_firstname'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $question = new Question( sprintf( "Please enter the admin's lastname: [%s]: ", - $defaults['admin_lastname'] + $defaults['admin_lastname'], ), - $defaults['admin_lastname'] + $defaults['admin_lastname'], ); $question->setValidator($this->notEmptyCallback); $adminLastname = $useDefaultConfigParams ? $defaults['admin_lastname'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $question = new Question( sprintf( "Please enter the admin's email: [%s]: ", - $defaults['admin_email'] + $defaults['admin_email'], ), - $defaults['admin_email'] + $defaults['admin_email'], ); $question->setValidator($this->notEmptyCallback); $adminEmail = $useDefaultConfigParams ? $defaults['admin_email'] : $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $validateBaseUrl = function ($url) { @@ -202,7 +202,7 @@ public function execute(): void if (parse_url($url, \PHP_URL_HOST) === 'localhost') { throw new InvalidArgumentException( - 'localhost cause problems! Please use 127.0.0.1 or another hostname' + 'localhost cause problems! Please use 127.0.0.1 or another hostname', ); } @@ -215,7 +215,7 @@ public function execute(): void $baseUrl = $this->input->getOption('baseUrl') ?? $questionHelper->ask( $this->input, $this->output, - $question + $question, ); $baseUrl = rtrim($baseUrl, '/') . '/'; // normalize baseUrl @@ -321,7 +321,7 @@ private function runInstallScriptCommand(OutputInterface $output, string $instal '%s -ddisplay_startup_errors=1 -ddisplay_errors=1 -derror_reporting=-1 -f %s -- %s', OperatingSystem::getPhpBinary(), escapeshellarg($installationFolder . '/' . self::MAGENTO_INSTALL_SCRIPT_PATH), - $installArgs + $installArgs, ); $output->writeln('' . $installCommand . ''); @@ -338,7 +338,7 @@ private function runInstallScriptCommand(OutputInterface $output, string $instal throw new RuntimeException( sprintf('Installation failed (Exit code %s). %s', $returnStatus, $installationOutput), 1, - $exception + $exception, ); } diff --git a/src/N98/Magento/Command/Installer/SubCommand/InstallSampleData.php b/src/N98/Magento/Command/Installer/SubCommand/InstallSampleData.php index f756b8d75..079bb01af 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/InstallSampleData.php +++ b/src/N98/Magento/Command/Installer/SubCommand/InstallSampleData.php @@ -33,7 +33,7 @@ public function execute(): void : $questionHelper->ask( $this->input, $this->output, - new ConfirmationQuestion('Install sample data? [yes]: ', true) + new ConfirmationQuestion('Install sample data? [yes]: ', true), ); if (!$installSampleData) { @@ -46,7 +46,7 @@ public function execute(): void $flag = $this->getOptionalBooleanOption( 'installSampleData', 'Install sample data?', - 'no' + 'no', ); if (!$flag) { @@ -102,14 +102,14 @@ private function installSampleData(array $demoPackageData): void if (is_dir($expandedFolder)) { $filesystem->recursiveCopy( $expandedFolder, - $this->config['installationFolder'] + $this->config['installationFolder'], ); $filesystem->recursiveRemoveDirectory($expandedFolder); } // Install sample data $sampleDataSqlFile = glob( - $this->config['installationFolder'] . '/magento_*sample_data*sql' + $this->config['installationFolder'] . '/magento_*sample_data*sql', ); $databaseHelper = $this->command->getDatabaseHelper(); @@ -173,7 +173,7 @@ private function extractTar(string $sampleDataFile): void { $process = new Process( ['tar', '-xzf', $sampleDataFile], - $this->config['installationFolder'] . '/_temp_demo_data' + $this->config['installationFolder'] . '/_temp_demo_data', ); $process->setTimeout(3600); $process->run(); @@ -186,7 +186,7 @@ private function extractZip(string $sampleDataFile): void { $process = new Process( ['unzip', $sampleDataFile], - $this->config['installationFolder'] . '/_temp_demo_data' + $this->config['installationFolder'] . '/_temp_demo_data', ); $process->setTimeout(3600); $process->run(); diff --git a/src/N98/Magento/Command/Installer/SubCommand/PostInstallation.php b/src/N98/Magento/Command/Installer/SubCommand/PostInstallation.php index d3e1960e1..76c34daf1 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/PostInstallation.php +++ b/src/N98/Magento/Command/Installer/SubCommand/PostInstallation.php @@ -31,7 +31,7 @@ public function execute() $arrayInput->setInteractive(false); $this->getCommand()->getApplication()->run( $arrayInput, - $this->output + $this->output, ); /** diff --git a/src/N98/Magento/Command/Installer/SubCommand/PreCheckPhp.php b/src/N98/Magento/Command/Installer/SubCommand/PreCheckPhp.php index e264c0a62..5ab8a71be 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/PreCheckPhp.php +++ b/src/N98/Magento/Command/Installer/SubCommand/PreCheckPhp.php @@ -3,6 +3,7 @@ declare(strict_types=1); /** @noinspection PhpComposerExtensionStubsInspection */ + namespace N98\Magento\Command\Installer\SubCommand; use N98\Magento\Command\SubCommand\AbstractSubCommand; @@ -41,7 +42,7 @@ protected function checkExtensions() if ($missingExtensions !== []) { throw new RuntimeException( - 'The following PHP extensions are required to start installation: ' . implode(',', $missingExtensions) + 'The following PHP extensions are required to start installation: ' . implode(',', $missingExtensions), ); } } diff --git a/src/N98/Magento/Command/Installer/SubCommand/RewriteHtaccessFile.php b/src/N98/Magento/Command/Installer/SubCommand/RewriteHtaccessFile.php index 6601ce5d6..8b77ece65 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/RewriteHtaccessFile.php +++ b/src/N98/Magento/Command/Installer/SubCommand/RewriteHtaccessFile.php @@ -42,7 +42,7 @@ protected function _backupOriginalFile(string $htaccessFile): void { copy( $htaccessFile, - $htaccessFile . '.dist' + $htaccessFile . '.dist', ); } diff --git a/src/N98/Magento/Command/Installer/SubCommand/SelectMagentoVersion.php b/src/N98/Magento/Command/Installer/SubCommand/SelectMagentoVersion.php index a082f7a7e..1ebf48c12 100644 --- a/src/N98/Magento/Command/Installer/SubCommand/SelectMagentoVersion.php +++ b/src/N98/Magento/Command/Installer/SubCommand/SelectMagentoVersion.php @@ -39,7 +39,7 @@ public function execute() if (!in_array( $typeInput - 1, range(0, count($this->commandConfig['magento-packages']) - 1), - true + true, )) { throw new \InvalidArgumentException('Invalid type'); } @@ -50,7 +50,7 @@ public function execute() $type = $this->getCommand()->getQuestionHelper()->ask( $this->input, $this->output, - $choiceQuestion + $choiceQuestion, ); } else { $type = null; diff --git a/src/N98/Magento/Command/Installer/UninstallCommand.php b/src/N98/Magento/Command/Installer/UninstallCommand.php index d118744da..4ffeacc37 100644 --- a/src/N98/Magento/Command/Installer/UninstallCommand.php +++ b/src/N98/Magento/Command/Installer/UninstallCommand.php @@ -31,10 +31,10 @@ protected function configure(): void 'installationFolder', null, InputOption::VALUE_OPTIONAL, - 'Folder where Magento is currently installed' + 'Folder where Magento is currently installed', ) ->setDescription( - 'Uninstall magento (drops database and empties current folder or folder set via installationFolder)' + 'Uninstall magento (drops database and empties current folder or folder set via installationFolder)', ) ; } @@ -61,7 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!$shouldUninstall) { $confirmationQuestion = new ConfirmationQuestion( 'Really uninstall ? [n]: ', - false + false, ); $shouldUninstall = $questionHelper->ask($input, $output, $confirmationQuestion); } diff --git a/src/N98/Magento/Command/LocalConfig/GenerateCommand.php b/src/N98/Magento/Command/LocalConfig/GenerateCommand.php index 997a69039..03a1f9b8e 100644 --- a/src/N98/Magento/Command/LocalConfig/GenerateCommand.php +++ b/src/N98/Magento/Command/LocalConfig/GenerateCommand.php @@ -54,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (file_exists($configFile)) { $output->writeln( - sprintf('local.xml file already exists in folder "%s/app/etc"', dirname($configFile)) + sprintf('local.xml file already exists in folder "%s/app/etc"', dirname($configFile)), ); return Command::FAILURE; } @@ -114,30 +114,30 @@ protected function askForArguments(InputInterface $input, OutputInterface $outpu $arguments = [ 'db-host' => [ 'prompt' => 'database host', - 'required' => true + 'required' => true, ], 'db-user' => [ 'prompt' => 'database username', - 'required' => true + 'required' => true, ], 'db-pass' => [ 'prompt' => 'database password', - 'required' => false + 'required' => false, ], 'db-name' => [ 'prompt' => 'database name', - 'required' => true + 'required' => true, ], 'session-save' => [ 'prompt' => 'session save', 'required' => true, - 'default' => 'files' + 'default' => 'files', ], 'admin-frontname' => [ 'prompt' => 'admin frontname', 'required' => true, - 'default' => 'admin' - ] + 'default' => 'admin', + ], ]; foreach ($arguments as $argument => $options) { @@ -149,14 +149,14 @@ protected function askForArguments(InputInterface $input, OutputInterface $outpu $output, new Question( sprintf('%s%s: ', $messagePrefix, $options['prompt']), - (string) $options['default'] + (string) $options['default'], ), - ) + ), ); } else { $input->setArgument( $argument, - $this->getOrAskForArgument($argument, $input, $output, $messagePrefix . $options['prompt']) + $this->getOrAskForArgument($argument, $input, $output, $messagePrefix . $options['prompt']), ); } diff --git a/src/N98/Magento/Command/Media/DumpCommand.php b/src/N98/Magento/Command/Media/DumpCommand.php index f68e0bf29..42863f0ec 100644 --- a/src/N98/Magento/Command/Media/DumpCommand.php +++ b/src/N98/Magento/Command/Media/DumpCommand.php @@ -65,7 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $currentFolder = pathinfo($file->getRelativePathname(), PATHINFO_DIRNAME); if ($currentFolder !== $lastFolder) { $output->writeln( - sprintf('Compress directory: media/%s', $currentFolder) + sprintf('Compress directory: media/%s', $currentFolder), ); } diff --git a/src/N98/Magento/Command/OpenBrowserCommand.php b/src/N98/Magento/Command/OpenBrowserCommand.php index dcbf07a5b..0000a0aff 100644 --- a/src/N98/Magento/Command/OpenBrowserCommand.php +++ b/src/N98/Magento/Command/OpenBrowserCommand.php @@ -84,7 +84,7 @@ private function resolveOpenerCommand(OutputInterface $output): string if (OutputInterface::VERBOSITY_DEBUG <= $output->getVerbosity()) { $message = sprintf('open command is "%s"', $opener); $output->writeln( - '' . $message . '' + '' . $message . '', ); } diff --git a/src/N98/Magento/Command/Script/Repository/RunCommand.php b/src/N98/Magento/Command/Script/Repository/RunCommand.php index eb310ac61..97a05146a 100644 --- a/src/N98/Magento/Command/Script/Repository/RunCommand.php +++ b/src/N98/Magento/Command/Script/Repository/RunCommand.php @@ -79,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $dialog = $this->getQuestionHelper(); $choiceQuestion = new ChoiceQuestion( 'Please select a script file: ', - $choices + $choices, ); $choiceQuestion->setValidator($validator); diff --git a/src/N98/Magento/Command/Script/Repository/ScriptLoader.php b/src/N98/Magento/Command/Script/Repository/ScriptLoader.php index bb1c8b3e4..934a3aa33 100644 --- a/src/N98/Magento/Command/Script/Repository/ScriptLoader.php +++ b/src/N98/Magento/Command/Script/Repository/ScriptLoader.php @@ -46,7 +46,7 @@ public function getFiles(): array return $this->_scriptFiles; } - protected function findScripts(array $scriptFolders = null): void + protected function findScripts(?array $scriptFolders = null): void { if (null === $scriptFolders) { $scriptFolders = $this->_scriptFolders; diff --git a/src/N98/Magento/Command/ScriptCommand.php b/src/N98/Magento/Command/ScriptCommand.php index 69870bc97..54abce629 100644 --- a/src/N98/Magento/Command/ScriptCommand.php +++ b/src/N98/Magento/Command/ScriptCommand.php @@ -139,12 +139,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int case '#': break; - // set var + // set var case '$': $this->registerVariable($input, $output, $command); break; - // run shell script + // run shell script case '!': $this->runShellCommand($output, $command); break; @@ -228,7 +228,7 @@ protected function registerVariable(InputInterface $input, OutputInterface $outp $choices = BinaryString::trimExplodeEmpty(',', $choiceMatches[1]); $question = new ChoiceQuestion( 'Please enter a value for ' . $matches[1] . ': ', - $choices + $choices, ); $selectedIndex = $dialog->ask($input, $output, $question); diff --git a/src/N98/Magento/Command/SelfUpdateCommand.php b/src/N98/Magento/Command/SelfUpdateCommand.php index d1c82a14c..a2a94d669 100644 --- a/src/N98/Magento/Command/SelfUpdateCommand.php +++ b/src/N98/Magento/Command/SelfUpdateCommand.php @@ -82,13 +82,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!is_writable($tempDirectory = dirname($tempFilename))) { throw new RuntimeException( 'n98-magerun2 update failed: the "' . $tempDirectory . - '" directory used to download the temp file could not be written' + '" directory used to download the temp file could not be written', ); } if (!is_writable($localFilename)) { throw new RuntimeException( - 'n98-magerun2 update failed: the "' . $localFilename . '" file could not be written' + 'n98-magerun2 update failed: the "' . $localFilename . '" file could not be written', ); } @@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int [], [ 'verify' => true, - ] + ], ); if (!$response->success) { @@ -176,9 +176,9 @@ private function downloadNewPhar(OutputInterface $output, string $remoteUrl, str [ 'verify' => true, 'headers' => [ - 'Accept-Encoding' => 'deflate, gzip, br, zstd' - ] - ] + 'Accept-Encoding' => 'deflate, gzip, br, zstd', + ], + ], ); if (!$response->success) { @@ -197,7 +197,7 @@ private function downloadNewPhar(OutputInterface $output, string $remoteUrl, str 'request.progress', function ($data, $responseBytes, $responseByteLimit) use ($progressBar): void { $progressBar->setProgress($responseBytes); - } + }, ); $response = Requests::get( @@ -208,9 +208,9 @@ function ($data, $responseBytes, $responseByteLimit) use ($progressBar): void { 'hooks' => $hooks, 'verify' => true, 'headers' => [ - 'Accept-Encoding' => 'deflate, gzip, br, zstd' - ] - ] + 'Accept-Encoding' => 'deflate, gzip, br, zstd', + ], + ], ); if (!$response->success) { @@ -239,7 +239,7 @@ private function replaceExistingPharFile(string $tempFilename, string $localFile { if (!@rename($tempFilename, $localFilename)) { throw new RuntimeException( - sprintf('Cannot replace existing phar file "%s". Please check permissions.', $localFilename) + sprintf('Cannot replace existing phar file "%s". Please check permissions.', $localFilename), ); } } @@ -259,9 +259,9 @@ private function getChangelog(bool $loadUnstable): string [ 'verify' => true, 'headers' => [ - 'Accept-Encoding' => 'deflate, gzip, br, zstd' - ] - ] + 'Accept-Encoding' => 'deflate, gzip, br, zstd', + ], + ], ); if (!$response->success) { diff --git a/src/N98/Magento/Command/SubCommand/AbstractSubCommand.php b/src/N98/Magento/Command/SubCommand/AbstractSubCommand.php index 1ee9860be..f8dc8fc97 100644 --- a/src/N98/Magento/Command/SubCommand/AbstractSubCommand.php +++ b/src/N98/Magento/Command/SubCommand/AbstractSubCommand.php @@ -95,14 +95,14 @@ final protected function getOptionalBooleanOption($name, $question, $default = t sprintf( '%s [%s]', $question, - $default + $default, ), - $default + $default, ); return $questionHelper->ask( $this->input, $this->output, - $question + $question, ); } diff --git a/src/N98/Magento/Command/System/Check/Filesystem/FilesCheck.php b/src/N98/Magento/Command/System/Check/Filesystem/FilesCheck.php index 37a1619a3..cf305de1a 100644 --- a/src/N98/Magento/Command/System/Check/Filesystem/FilesCheck.php +++ b/src/N98/Magento/Command/System/Check/Filesystem/FilesCheck.php @@ -40,7 +40,7 @@ public function check(ResultCollection $resultCollection): void } else { $result->setStatus(Result::STATUS_ERROR); $result->setMessage( - 'File ' . $file . ' not found! Usage: ' . $comment . '' + 'File ' . $file . ' not found! Usage: ' . $comment . '', ); } } diff --git a/src/N98/Magento/Command/System/Check/Filesystem/FoldersCheck.php b/src/N98/Magento/Command/System/Check/Filesystem/FoldersCheck.php index 321a22030..b49cb9a30 100644 --- a/src/N98/Magento/Command/System/Check/Filesystem/FoldersCheck.php +++ b/src/N98/Magento/Command/System/Check/Filesystem/FoldersCheck.php @@ -40,13 +40,13 @@ public function check(ResultCollection $resultCollection): void $result->setStatus(Result::STATUS_ERROR); $result->setMessage( 'Folder ' . $folder . ' is not writeable! Usage: ' . $comment . - '' + '', ); } } else { $result->setStatus(Result::STATUS_ERROR); $result->setMessage( - 'Folder ' . $folder . ' not found! Usage: ' . $comment . '' + 'Folder ' . $folder . ' not found! Usage: ' . $comment . '', ); } } diff --git a/src/N98/Magento/Command/System/Check/MySQL/EnginesCheck.php b/src/N98/Magento/Command/System/Check/MySQL/EnginesCheck.php index 2d375812c..739c3e896 100644 --- a/src/N98/Magento/Command/System/Check/MySQL/EnginesCheck.php +++ b/src/N98/Magento/Command/System/Check/MySQL/EnginesCheck.php @@ -26,7 +26,7 @@ protected function checkImplementation(Result $result, Varien_Db_Adapter_Interfa } else { $result->setStatus(Result::STATUS_ERROR); $result->setMessage( - 'Required MySQL Storage Engine InnoDB not found!' + 'Required MySQL Storage Engine InnoDB not found!', ); } } diff --git a/src/N98/Magento/Command/System/Check/MySQL/ResourceCheck.php b/src/N98/Magento/Command/System/Check/MySQL/ResourceCheck.php index 1cef5f296..abcd1ec7b 100644 --- a/src/N98/Magento/Command/System/Check/MySQL/ResourceCheck.php +++ b/src/N98/Magento/Command/System/Check/MySQL/ResourceCheck.php @@ -33,7 +33,7 @@ public function check(ResultCollection $resultCollection): void if (!$dbAdapter instanceof Varien_Db_Adapter_Interface) { $result->setStatus($result::STATUS_ERROR); $result->setMessage( - "Mysql Version: Can not check. Unable to obtain resource connection 'core_write'." + "Mysql Version: Can not check. Unable to obtain resource connection 'core_write'.", ); } else { $this->checkImplementation($result, $dbAdapter); diff --git a/src/N98/Magento/Command/System/Check/MySQL/VersionCheck.php b/src/N98/Magento/Command/System/Check/MySQL/VersionCheck.php index db2938846..7502a0e30 100644 --- a/src/N98/Magento/Command/System/Check/MySQL/VersionCheck.php +++ b/src/N98/Magento/Command/System/Check/MySQL/VersionCheck.php @@ -33,7 +33,7 @@ protected function checkImplementation(Result $result, Varien_Db_Adapter_Interfa } else { $result->setStatus(Result::STATUS_ERROR); $result->setMessage( - sprintf('MySQL Version >%s found. Upgrade your MySQL Version.', $mysqlVersion) + sprintf('MySQL Version >%s found. Upgrade your MySQL Version.', $mysqlVersion), ); } } diff --git a/src/N98/Magento/Command/System/Check/PHP/BytecodeCacheExtensionsCheck.php b/src/N98/Magento/Command/System/Check/PHP/BytecodeCacheExtensionsCheck.php index b0e341e34..2229d07ad 100644 --- a/src/N98/Magento/Command/System/Check/PHP/BytecodeCacheExtensionsCheck.php +++ b/src/N98/Magento/Command/System/Check/PHP/BytecodeCacheExtensionsCheck.php @@ -39,7 +39,7 @@ public function check(ResultCollection $resultCollection): void } else { $result->setMessage( "No Bytecode-Cache found! It's recommended to install anyone of " . - implode(', ', $bytecopdeCacheExtensions) . '.' + implode(', ', $bytecopdeCacheExtensions) . '.', ); } } diff --git a/src/N98/Magento/Command/System/Check/Result.php b/src/N98/Magento/Command/System/Check/Result.php index eb8d00be7..aa6b211cb 100644 --- a/src/N98/Magento/Command/System/Check/Result.php +++ b/src/N98/Magento/Command/System/Check/Result.php @@ -58,7 +58,7 @@ public function setStatus($status) if (!in_array($status, [self::STATUS_OK, self::STATUS_ERROR, self::STATUS_WARNING])) { throw new LogicException( - 'Wrong status was given. Use constants: Result::OK, Result::ERROR, Result::WARNING' + 'Wrong status was given. Use constants: Result::OK, Result::ERROR, Result::WARNING', ); } diff --git a/src/N98/Magento/Command/System/Check/Security/LocalConfigAccessableCheck.php b/src/N98/Magento/Command/System/Check/Security/LocalConfigAccessableCheck.php index a5cb8bb3f..f18d0f3d1 100644 --- a/src/N98/Magento/Command/System/Check/Security/LocalConfigAccessableCheck.php +++ b/src/N98/Magento/Command/System/Check/Security/LocalConfigAccessableCheck.php @@ -27,7 +27,7 @@ public function check(ResultCollection $resultCollection): void $result = $resultCollection->createResult(); $filePath = 'app/etc/local.xml'; $defaultUnsecureBaseURL = (string) Mage::getConfig()->getNode( - 'default/' . Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL + 'default/' . Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL, ); $varienHttpAdapterCurl = new Varien_Http_Adapter_Curl(); diff --git a/src/N98/Magento/Command/System/Check/Settings/BaseUrlCheckAbstract.php b/src/N98/Magento/Command/System/Check/Settings/BaseUrlCheckAbstract.php index c0fe83758..cb3f734fa 100644 --- a/src/N98/Magento/Command/System/Check/Settings/BaseUrlCheckAbstract.php +++ b/src/N98/Magento/Command/System/Check/Settings/BaseUrlCheckAbstract.php @@ -34,12 +34,12 @@ protected function checkSettings(Result $result, Mage_Core_Model_Store $mageCore if ($isValid) { $result->setMessage( '' . ucfirst($this->class) . ' BaseURL: ' . $baseUrl . ' of Store: ' . - $mageCoreModelStore->getCode() . ' - OK' + $mageCoreModelStore->getCode() . ' - OK', ); } else { $result->setMessage( 'Invalid ' . ucfirst($this->class) . ' BaseURL: ' . $baseUrl . - ' of Store: ' . $mageCoreModelStore->getCode() . ' ' . $errorMessage . '' + ' of Store: ' . $mageCoreModelStore->getCode() . ' ' . $errorMessage . '', ); } } diff --git a/src/N98/Magento/Command/System/Check/Settings/CheckAbstract.php b/src/N98/Magento/Command/System/Check/Settings/CheckAbstract.php index 37e258741..7433516a5 100644 --- a/src/N98/Magento/Command/System/Check/Settings/CheckAbstract.php +++ b/src/N98/Magento/Command/System/Check/Settings/CheckAbstract.php @@ -33,7 +33,7 @@ protected function registerStoreConfigPath(string $name, string $configPath): vo $this->storeConfigPaths[$name] = $configPath; } - + public function check(ResultCollection $resultCollection, Mage_Core_Model_Store $mageCoreModelStore): void { $result = $resultCollection->createResult(); diff --git a/src/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstract.php b/src/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstract.php index 7d1c31596..cd0af452c 100644 --- a/src/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstract.php +++ b/src/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstract.php @@ -36,19 +36,19 @@ protected function checkSettings(Result $result, Mage_Core_Model_Store $mageCore if ($isValid) { $result->setMessage( 'Cookie Domain (' . $this->class . '): ' . $cookieDomain . - ' of Store: ' . $mageCoreModelStore->getCode() . ' - OK' + ' of Store: ' . $mageCoreModelStore->getCode() . ' - OK', ); } else { $result->setMessage( 'Cookie Domain (' . $this->class . '): ' . $cookieDomain . ' of Store: ' . $mageCoreModelStore->getCode() . ' - ERROR: ' . $errorMessage . - '' + '', ); } } else { $result->setMessage( 'Empty cookie Domain (' . $this->class . ') of Store: ' . $mageCoreModelStore->getCode() . - ' - OK' + ' - OK', ); } } diff --git a/src/N98/Magento/Command/System/CheckCommand.php b/src/N98/Magento/Command/System/CheckCommand.php index 1dc1ba016..ffd0dc46c 100644 --- a/src/N98/Magento/Command/System/CheckCommand.php +++ b/src/N98/Magento/Command/System/CheckCommand.php @@ -97,7 +97,7 @@ protected function _invokeCheckClass(ResultCollection $resultCollection, string default: throw new LogicException( - sprintf('Unhandled check-class "%s"', $checkGroupClass) + sprintf('Unhandled check-class "%s"', $checkGroupClass), ); } } @@ -120,7 +120,7 @@ protected function _printResults(OutputInterface $output, ResultCollection $resu case Result::STATUS_OK: default: $output->write( - '' . Charset::convertInteger(Charset::UNICODE_CHECKMARK_CHAR) . ' ' + '' . Charset::convertInteger(Charset::UNICODE_CHECKMARK_CHAR) . ' ', ); break; } @@ -174,7 +174,7 @@ private function _markCheckWarning(ResultCollection $resultCollection, string $c $result = $resultCollection->createResult(); $result->setMessage( 'No ' . $context . ' configured to run store check: ' . basename($checkGroupClass) . - '' + '', ); $result->setStatus($result::STATUS_WARNING); $resultCollection->addResult($result); diff --git a/src/N98/Magento/Command/System/Cron/AbstractCronCommand.php b/src/N98/Magento/Command/System/Cron/AbstractCronCommand.php index a4e6d6444..61741425e 100644 --- a/src/N98/Magento/Command/System/Cron/AbstractCronCommand.php +++ b/src/N98/Magento/Command/System/Cron/AbstractCronCommand.php @@ -94,7 +94,7 @@ private function getJobConfigElements(): AppendIterator */ private function parseCronExpression($expr) { - if ((string)$expr === 'always') { + if ((string) $expr === 'always') { return array_fill(0, 5, '*'); } diff --git a/src/N98/Magento/Command/System/Cron/HistoryCommand.php b/src/N98/Magento/Command/System/Cron/HistoryCommand.php index 3724ff052..610386d33 100644 --- a/src/N98/Magento/Command/System/Cron/HistoryCommand.php +++ b/src/N98/Magento/Command/System/Cron/HistoryCommand.php @@ -32,7 +32,7 @@ protected function configure(): void 'timezone', null, InputOption::VALUE_OPTIONAL, - 'Timezone to show finished at in' + 'Timezone to show finished at in', ) ->addFormatOption() ; diff --git a/src/N98/Magento/Command/System/Cron/RunCommand.php b/src/N98/Magento/Command/System/Cron/RunCommand.php index b93476137..7a1eb4c3c 100644 --- a/src/N98/Magento/Command/System/Cron/RunCommand.php +++ b/src/N98/Magento/Command/System/Cron/RunCommand.php @@ -117,8 +117,8 @@ private function getCallbackFromRunConfigModel(string $runConfigModel, string $j sprintf( 'Invalid model/method definition "%s" for job "%s", expecting "model/class::method".', $runConfigModel, - $jobCode - ) + $jobCode, + ), ); } @@ -182,7 +182,7 @@ private function executeConfigModel($callback, string $jobCode): void throw new RuntimeException( sprintf('Cron-job "%s" threw exception %s', $jobCode, get_class($exception)), 0, - $exception + $exception, ); } @@ -220,7 +220,7 @@ private function scheduleConfigModel($callback, string $jobCode): void throw new RuntimeException( sprintf('Cron-job "%s" threw exception %s', $jobCode, get_class($exception)), 0, - $exception + $exception, ); } } diff --git a/src/N98/Magento/Command/System/Cron/ServerEnvironment.php b/src/N98/Magento/Command/System/Cron/ServerEnvironment.php index 1e40ba9d5..549ec3b24 100644 --- a/src/N98/Magento/Command/System/Cron/ServerEnvironment.php +++ b/src/N98/Magento/Command/System/Cron/ServerEnvironment.php @@ -8,6 +8,7 @@ * Date: 13.12.16 * Time: 00:08 */ + namespace N98\Magento\Command\System\Cron; use BadMethodCallException; diff --git a/src/N98/Magento/Command/System/InfoCommand.php b/src/N98/Magento/Command/System/InfoCommand.php index d0aa24555..8973739ff 100644 --- a/src/N98/Magento/Command/System/InfoCommand.php +++ b/src/N98/Magento/Command/System/InfoCommand.php @@ -35,13 +35,13 @@ protected function configure(): void ->addArgument( 'key', InputArgument::OPTIONAL, - 'Only output value of named param like "version". Key is case insensitive.' + 'Only output value of named param like "version". Key is case insensitive.', )->setDescription('Prints infos about the current magento system.') ->addFormatOption() ; } - + protected function execute(InputInterface $input, OutputInterface $output): int { $this->detectMagento($output); @@ -166,7 +166,7 @@ protected function findVendors(): void function ($value) use ($codePoolDir) { return str_replace($codePoolDir, '', $value); }, - $vendors + $vendors, ); // @phpstan-ignore argument.type diff --git a/src/N98/Magento/Command/System/Setup/ChangeVersionCommand.php b/src/N98/Magento/Command/System/Setup/ChangeVersionCommand.php index 42c4eab8c..bc3118f3d 100644 --- a/src/N98/Magento/Command/System/Setup/ChangeVersionCommand.php +++ b/src/N98/Magento/Command/System/Setup/ChangeVersionCommand.php @@ -73,8 +73,8 @@ public function updateSetupResource(string $moduleName, string $setupResource, s 'Successfully updated: "%s" - "%s" to version: "%s"', $moduleName, $setupResource, - $version - ) + $version, + ), ); } } diff --git a/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php b/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php index 7b72c0373..57ad0c371 100644 --- a/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php +++ b/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php @@ -32,7 +32,7 @@ protected function configure(): void 'errors-only', null, InputOption::VALUE_NONE, - 'Only display Setup resources where Status equals Error.' + 'Only display Setup resources where Status equals Error.', ) ->addFormatOption() ->setDescription('Compare module version with core_resource table.'); @@ -137,7 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int '<%s>%s', $availableStatus[$status], $status, - $availableStatus[$status] + $availableStatus[$status], ); $row['Status'] = $statusString; }); @@ -160,9 +160,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int '%s error%s %s found!', $errorCounter, $errorCounter === 1 ? '' : 's', - $errorCounter === 1 ? 'was' : 'were' + $errorCounter === 1 ? 'was' : 'were', ), - 'error' + 'error', ); } else { $this->writeSection($output, 'No setup problems were found.', 'info'); @@ -194,9 +194,9 @@ protected function logJUnit(array $data, string $filename, float $duration): voi $testCaseElement->addFailure( sprintf( 'Setup Script Error: [Setup %s]', - $moduleSetup['Setup'] + $moduleSetup['Setup'], ), - 'MagentoSetupScriptVersionException' + 'MagentoSetupScriptVersionException', ); } } diff --git a/src/N98/Magento/Command/System/Setup/IncrementalCommand.php b/src/N98/Magento/Command/System/Setup/IncrementalCommand.php index 8b39586d1..700b46c61 100644 --- a/src/N98/Magento/Command/System/Setup/IncrementalCommand.php +++ b/src/N98/Magento/Command/System/Setup/IncrementalCommand.php @@ -97,7 +97,7 @@ protected function _loadSecondConfig(): void { $mageCoreModelConfig = new Mage_Core_Model_Config(); $mageCoreModelConfig->loadBase(); - //get app/etc + //get app/etc $this->_secondConfig = Mage::getConfig()->loadModulesConfiguration('config.xml', $mageCoreModelConfig); } @@ -151,7 +151,7 @@ protected function _getAvaiableDbFilesFromResource(Mage_Core_Model_Resource_Setu $args[1] = $result[0]['toVersion']; $result = array_merge( $result, - $this->_callProtectedMethodFromObject('_getAvailableDbFiles', $setupResource, $args) + $this->_callProtectedMethodFromObject('_getAvailableDbFiles', $setupResource, $args), ); } @@ -169,7 +169,7 @@ protected function _getAvaiableDataFilesFromResource(Mage_Core_Model_Resource_Se $args[1] = $result[0]['toVersion']; $result = array_merge( $result, - $this->_callProtectedMethodFromObject('_getAvailableDbFiles', $setupResource, $args) + $this->_callProtectedMethodFromObject('_getAvailableDbFiles', $setupResource, $args), ); } @@ -292,7 +292,7 @@ protected function _outputUpdateInformation(array $needsUpdate): void $moduleConfig = $this->_getProtectedPropertyFromObject('_moduleConfig', $setupResource); $output->writeln( - ['+--------------------------------------------------+', 'Resource Name: ' . $name, 'For Module: ' . $moduleConfig->getName(), 'Class: ' . get_class($setupResource), 'Current Structure Version: ' . $dbVersion, 'Current Data Version: ' . $dbDataVersion, 'Configured Version: ' . $configVersion] + ['+--------------------------------------------------+', 'Resource Name: ' . $name, 'For Module: ' . $moduleConfig->getName(), 'Class: ' . get_class($setupResource), 'Current Structure Version: ' . $dbVersion, 'Current Data Version: ' . $dbDataVersion, 'Configured Version: ' . $configVersion], ); $args = ['', (string) $dbVersion, (string) $configVersion]; @@ -387,7 +387,7 @@ protected function _runNamedSetupResource(string $name, array $needsUpdate, stri $setup->addChild('module', $moduleName->__toString()); } else { $output->writeln( - 'No module node configured for ' . $name . ', possible configuration error ' + 'No module node configured for ' . $name . ', possible configuration error ', ); } @@ -528,10 +528,10 @@ protected function _analyzeSetupResourceClasses(): array $needsUpdate = $this->_getAllSetupResourceObjectThatNeedUpdates($setupResources); $output->writeln( - 'Found ' . count($setupResources) . ' configured setup resource(s)' + 'Found ' . count($setupResources) . ' configured setup resource(s)', ); $output->writeln( - 'Found ' . count($needsUpdate) . ' setup resource(s) which need an update' + 'Found ' . count($needsUpdate) . ' setup resource(s) which need an update', ); return $needsUpdate; diff --git a/src/N98/Magento/Command/System/Setup/RemoveCommand.php b/src/N98/Magento/Command/System/Setup/RemoveCommand.php index c2eb9bca7..cb71084da 100644 --- a/src/N98/Magento/Command/System/Setup/RemoveCommand.php +++ b/src/N98/Magento/Command/System/Setup/RemoveCommand.php @@ -76,16 +76,16 @@ public function removeSetupResource(string $moduleName, string $setupResource, O sprintf( 'Successfully removed setup resource: "%s" from module: "%s" ', $setupResource, - $moduleName - ) + $moduleName, + ), ); } else { $output->writeln( sprintf( 'No entry was found for setup resource: "%s" in module: "%s" ', $setupResource, - $moduleName - ) + $moduleName, + ), ); } } diff --git a/src/N98/Magento/Command/System/Setup/RunCommand.php b/src/N98/Magento/Command/System/Setup/RunCommand.php index 8ebcf7e19..f53b26adb 100644 --- a/src/N98/Magento/Command/System/Setup/RunCommand.php +++ b/src/N98/Magento/Command/System/Setup/RunCommand.php @@ -35,7 +35,7 @@ protected function configure(): void '--no-implicit-cache-flush', null, InputOption::VALUE_NONE, - 'Do not flush the cache' + 'Do not flush the cache', ) ->setDescription('Runs all new setup scripts.'); } diff --git a/src/N98/Magento/DbSettings.php b/src/N98/Magento/DbSettings.php index 5fe2583b2..0ec068746 100644 --- a/src/N98/Magento/DbSettings.php +++ b/src/N98/Magento/DbSettings.php @@ -65,7 +65,7 @@ public function setFile(string $file): void { if (!is_readable($file)) { throw new InvalidArgumentException( - sprintf('"app/etc/local.xml"-file %s is not readable', var_export($file, true)) + sprintf('"app/etc/local.xml"-file %s is not readable', var_export($file, true)), ); } @@ -75,7 +75,7 @@ public function setFile(string $file): void if (false === $config) { throw new InvalidArgumentException( - sprintf('Unable to open "app/etc/local.xml"-file %s and parse it as XML', var_export($file, true)) + sprintf('Unable to open "app/etc/local.xml"-file %s and parse it as XML', var_export($file, true)), ); } @@ -89,8 +89,8 @@ public function setFile(string $file): void throw new InvalidArgumentException( sprintf( 'DB settings (%s) was not found in "app/etc/local.xml"-file', - $connectionNode - ) + $connectionNode, + ), ); } @@ -183,7 +183,7 @@ public function getConnection(): PDO $pdo = new PDO( $this->getDsn(), $this->getUsername(), - $this->getPassword() + $this->getPassword(), ); /** @link http://bugs.mysql.com/bug.php?id=18551 */ @@ -244,8 +244,8 @@ private function quoteIdentifier(string $identifier): string sprintf( 'Invalid identifier, must not contain NUL and must be UTF-8 encoded in the BMP: %s (hex: %s)', var_export($identifier, true), - bin2hex($identifier) - ) + bin2hex($identifier), + ), ); } diff --git a/src/N98/Magento/Initialiser.php b/src/N98/Magento/Initialiser.php index 9ad26445c..1bb929284 100644 --- a/src/N98/Magento/Initialiser.php +++ b/src/N98/Magento/Initialiser.php @@ -7,6 +7,7 @@ * * @author Tom Klingenberg */ + namespace N98\Magento; use N98\Util\AutoloadRestorer; diff --git a/src/N98/Magento/Modules.php b/src/N98/Magento/Modules.php index adeccad0a..3d9da5194 100644 --- a/src/N98/Magento/Modules.php +++ b/src/N98/Magento/Modules.php @@ -24,7 +24,7 @@ class Modules implements IteratorAggregate, Countable { private ?array $list; - public function __construct(array $list = null) + public function __construct(?array $list = null) { if (null === $list) { $list = []; diff --git a/src/N98/MagerunBootstrap.php b/src/N98/MagerunBootstrap.php index 59fb48d12..2dd90dbc9 100644 --- a/src/N98/MagerunBootstrap.php +++ b/src/N98/MagerunBootstrap.php @@ -42,7 +42,7 @@ public static function getLoader(): string throw new ErrorException( 'You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -s https://getcomposer.org/installer | php' . PHP_EOL . - 'php composer.phar install' . PHP_EOL + 'php composer.phar install' . PHP_EOL, ); } diff --git a/src/N98/Util/Console/Enabler.php b/src/N98/Util/Console/Enabler.php index 3c663c5f0..bffeef22e 100644 --- a/src/N98/Util/Console/Enabler.php +++ b/src/N98/Util/Console/Enabler.php @@ -48,7 +48,7 @@ private function assert($condition, string $message): void } throw new RuntimeException( - sprintf('Command %s is not available because %s.', $this->command->getName(), $message) + sprintf('Command %s is not available because %s.', $this->command->getName(), $message), ); } } diff --git a/src/N98/Util/Console/Helper/ComposerHelper.php b/src/N98/Util/Console/Helper/ComposerHelper.php index abb213855..4285a622d 100644 --- a/src/N98/Util/Console/Helper/ComposerHelper.php +++ b/src/N98/Util/Console/Helper/ComposerHelper.php @@ -128,7 +128,5 @@ public function getName(): string * * @return void */ - public function setInput(InputInterface $input) - { - } + public function setInput(InputInterface $input) {} } diff --git a/src/N98/Util/Console/Helper/DatabaseHelper.php b/src/N98/Util/Console/Helper/DatabaseHelper.php index eeeaf7f84..6429b5f38 100644 --- a/src/N98/Util/Console/Helper/DatabaseHelper.php +++ b/src/N98/Util/Console/Helper/DatabaseHelper.php @@ -50,7 +50,7 @@ public function detectDbSettings(OutputInterface $output, ?string $connectionNod if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { $output->writeln( - sprintf('Loading database configuration from file %s', $configFile) + sprintf('Loading database configuration from file %s', $configFile), ); } @@ -154,7 +154,7 @@ public function getMysqlVariable(string $name, ?string $type = null) if (!in_array($type, ['@@', '@'], true)) { throw new InvalidArgumentException( - sprintf('Invalid mysql variable type "%s", must be "@@" (system) or "@" (session)', $type) + sprintf('Invalid mysql variable type "%s", must be "@@" (system) or "@" (session)', $type), ); } @@ -171,7 +171,7 @@ public function getMysqlVariable(string $name, ?string $type = null) : 'no error info'; throw new RuntimeException( - sprintf('Failed to query mysql variable %s: %s', var_export($name, true), $reason) + sprintf('Failed to query mysql variable %s: %s', var_export($name, true), $reason), ); } @@ -252,7 +252,7 @@ public function resolveTables(array $list, array $definitions = [], array $resol $tables = $this->resolveTables( $this->resolveRetrieveDefinitionsTablesByCode($definitions, $code), $definitions, - $resolved + $resolved, ); $resolvedList = array_merge($resolvedList, $tables); } @@ -265,13 +265,13 @@ public function resolveTables(array $list, array $definitions = [], array $resol $connection = $this->getConnection(); $sth = $connection->prepare( 'SHOW TABLES LIKE :like', - [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY] + [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY], ); $entry = str_replace('_', '\\_', $entry); $entry = str_replace('*', '%', $entry); $entry = str_replace('?', '_', $entry); $sth->execute( - [':like' => $this->dbSettings['prefix'] . $entry] + [':like' => $this->dbSettings['prefix'] . $entry], ); $rows = $sth->fetchAll(); if ($rows) { @@ -369,7 +369,7 @@ public function getTables(bool $withoutPrefix = false) // @codeCoverageIgnoreStart $this->throwRuntimeException( $statement, - sprintf('Failed to obtain tables from database: %s', var_export($query, true)) + sprintf('Failed to obtain tables from database: %s', var_export($query, true)), ); } // @codeCoverageIgnoreEnd @@ -417,7 +417,7 @@ public function getTablesStatus(bool $withoutPrefix = false): array if (strlen($prefix) > 0) { $statement = $pdo->prepare('SHOW TABLE STATUS LIKE :like', [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]); $statement->execute( - [':like' => $prefix . '%'] + [':like' => $prefix . '%'], ); } else { $statement = $pdo->query('SHOW TABLE STATUS'); @@ -526,10 +526,10 @@ private function runShowCommand(string $command, ?string $variable = null): arra if (null !== $variable) { $statement = $pdo->prepare( 'SHOW /*!50000 GLOBAL */ ' . $command . ' LIKE :like', - [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY] + [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY], ); $statement->execute( - [':like' => $variable] + [':like' => $variable], ); } else { $statement = $pdo->query('SHOW /*!50000 GLOBAL */ ' . $command); @@ -586,7 +586,7 @@ private function getApplication() * * @return OutputInterface */ - private function fallbackOutput(OutputInterface $output = null) + private function fallbackOutput(?OutputInterface $output = null) { if ($output instanceof \Symfony\Component\Console\Output\OutputInterface) { return $output; diff --git a/src/N98/Util/Console/Helper/IoHelper.php b/src/N98/Util/Console/Helper/IoHelper.php index 0fbb20159..726883d96 100644 --- a/src/N98/Util/Console/Helper/IoHelper.php +++ b/src/N98/Util/Console/Helper/IoHelper.php @@ -75,7 +75,7 @@ public function getOutput(): OutputInterface * * @api */ - public function setHelperSet(HelperSet $helperSet = null): void + public function setHelperSet(?HelperSet $helperSet = null): void { $this->helperSet = $helperSet; } diff --git a/src/N98/Util/Console/Helper/MagentoHelper.php b/src/N98/Util/Console/Helper/MagentoHelper.php index 2b013a93d..ee588f413 100644 --- a/src/N98/Util/Console/Helper/MagentoHelper.php +++ b/src/N98/Util/Console/Helper/MagentoHelper.php @@ -54,7 +54,7 @@ public function getName(): string return 'magento'; } - public function __construct(InputInterface $input = null, OutputInterface $output = null) + public function __construct(?InputInterface $input = null, ?OutputInterface $output = null) { if (!$input instanceof InputInterface) { $input = new ArgvInput(); @@ -150,7 +150,7 @@ protected function checkModman(array $folders): array if (!is_readable($searchFolder)) { if (OutputInterface::VERBOSITY_DEBUG <= $this->output->getVerbosity()) { $this->output->writeln( - 'Folder ' . $searchFolder . ' is not readable. Skip.' + 'Folder ' . $searchFolder . ' is not readable. Skip.', ); } @@ -172,7 +172,7 @@ protected function checkModman(array $folders): array $baseFolderContent = trim((string) file_get_contents($searchFolder . DIRECTORY_SEPARATOR . '.basedir')); if (OutputInterface::VERBOSITY_DEBUG <= $this->output->getVerbosity()) { $this->output->writeln( - 'Found modman .basedir file with content ' . $baseFolderContent . '' + 'Found modman .basedir file with content ' . $baseFolderContent . '', ); } @@ -194,7 +194,7 @@ protected function checkMagerunFile(array $folders): array if (!is_readable($searchFolder)) { if (OutputInterface::VERBOSITY_DEBUG <= $this->output->getVerbosity()) { $this->output->writeln( - sprintf('Folder %s is not readable. Skip.', $searchFolder) + sprintf('Folder %s is not readable. Skip.', $searchFolder), ); } @@ -222,7 +222,7 @@ protected function checkMagerunFile(array $folders): array $message = sprintf( "Found stopfile '%s' file with content %s", $stopFile, - $magerunFileContent + $magerunFileContent, ); $this->output->writeln($message); } @@ -269,7 +269,7 @@ protected function _search(string $searchFolder): bool if (OutputInterface::VERBOSITY_DEBUG <= $this->output->getVerbosity()) { $this->output->writeln( - 'Found Magento in folder ' . $this->_magentoRootFolder . '' + 'Found Magento in folder ' . $this->_magentoRootFolder . '', ); } diff --git a/src/N98/Util/Console/Helper/ParameterHelper.php b/src/N98/Util/Console/Helper/ParameterHelper.php index ce50bfd68..1cad62c2b 100644 --- a/src/N98/Util/Console/Helper/ParameterHelper.php +++ b/src/N98/Util/Console/Helper/ParameterHelper.php @@ -85,7 +85,7 @@ public function askStore( $choices[] = sprintf( '%s - %s', $store->getCode(), - $store->getName() + $store->getName(), ); } @@ -178,7 +178,7 @@ private function websitesQuestion(Mage_Core_Model_App $storeManager): array public function askEmail(InputInterface $input, OutputInterface $output, string $argumentName = 'email'): string { $collection = new Collection( - ['email' => [new NotBlank(), new Email()]] + ['email' => [new NotBlank(), new Email()]], ); return $this->validateArgument($input, $output, $argumentName, $input->getArgument($argumentName), $collection); @@ -203,7 +203,7 @@ public function askPassword( $validators[] = new Length(['min' => 6]); $collection = new Collection( - ['password' => $validators] + ['password' => $validators], ); return $this->validateArgument($input, $output, $argumentName, $input->getArgument($argumentName), $collection); @@ -252,7 +252,7 @@ function ($inputValue) use ($constraints, $name) { } return $inputValue; - } + }, ); } diff --git a/src/N98/Util/Console/Helper/Table/Renderer/RendererFactory.php b/src/N98/Util/Console/Helper/Table/Renderer/RendererFactory.php index 53a30c9ce..4ea60fa48 100644 --- a/src/N98/Util/Console/Helper/Table/Renderer/RendererFactory.php +++ b/src/N98/Util/Console/Helper/Table/Renderer/RendererFactory.php @@ -42,8 +42,8 @@ public static function render(string $format, OutputInterface $output, array $ro sprintf( 'Unknown format %s, known formats are: %s', var_export($format, true), - implode(',', self::getFormats()) - ) + implode(',', self::getFormats()), + ), ); } diff --git a/src/N98/Util/Console/Helper/Table/Renderer/XmlRenderer.php b/src/N98/Util/Console/Helper/Table/Renderer/XmlRenderer.php index d63949c63..13669f697 100644 --- a/src/N98/Util/Console/Helper/Table/Renderer/XmlRenderer.php +++ b/src/N98/Util/Console/Helper/Table/Renderer/XmlRenderer.php @@ -34,16 +34,16 @@ public function render(OutputInterface $output, array $rows): void $rows && $this->setHeadersFrom($rows); $table = $domDocument->createElement(self::NAME_ROOT); - if ($table) { + if ($table) { $table = $domDocument->appendChild($table); $this->appendHeaders($table, $this->headers); $this->appendRows($table, $rows); - } + } - $xml = $domDocument->saveXML($domDocument, LIBXML_NOEMPTYTAG); - if ($xml) { - $output->write($xml, false, $output::OUTPUT_RAW); - } + $xml = $domDocument->saveXML($domDocument, LIBXML_NOEMPTYTAG); + if ($xml) { + $output->write($xml, false, $output::OUTPUT_RAW); + } } private function appendRows(DOMNode $domElement, array $rows): void @@ -73,7 +73,7 @@ private function appendRowFields(DOMElement $domElement, array $fields): void } } - private function appendHeaders(DOMNode $domElement, array $headers = null): void + private function appendHeaders(DOMNode $domElement, ?array $headers = null): void { if ($headers === null || $headers === []) { return; @@ -117,8 +117,8 @@ private function getName(string $string): string throw new RuntimeException( sprintf( 'Encoding error, only US-ASCII and UTF-8 supported, can not process %s', - var_export($string, true) - ) + var_export($string, true), + ), ); } diff --git a/src/N98/Util/DateTime.php b/src/N98/Util/DateTime.php index 01dc28529..4097f6b90 100644 --- a/src/N98/Util/DateTime.php +++ b/src/N98/Util/DateTime.php @@ -36,7 +36,7 @@ public static function difference(PhpDateTime $time1, PhpDateTime $time2): strin . ($days ? $days . 'd ' : '') . ($hours ? $hours . 'h ' : '') . ($minutes ? $minutes . 'm ' : '') - . ($seconds ? $seconds . 's ' : '') + . ($seconds ? $seconds . 's ' : ''), ); if ($differenceString === '') { diff --git a/src/N98/Util/Exec.php b/src/N98/Util/Exec.php index 4ca88d704..2548ed50b 100644 --- a/src/N98/Util/Exec.php +++ b/src/N98/Util/Exec.php @@ -46,7 +46,7 @@ public static function run(string $command, ?string &$output = null, ?int &$retu if ($returnCode !== self::CODE_CLEAN_EXIT) { throw new RuntimeException( - sprintf('Exit status %d for command %s. Output was: %s', $returnCode, $command, $output) + sprintf('Exit status %d for command %s. Output was: %s', $returnCode, $command, $output), ); } } diff --git a/src/N98/Util/Filesystem.php b/src/N98/Util/Filesystem.php index 9d1f0002f..b643ad265 100644 --- a/src/N98/Util/Filesystem.php +++ b/src/N98/Util/Filesystem.php @@ -100,7 +100,7 @@ public function recursiveRemoveDirectory(string $directory, bool $empty = false) // we call this function with the new path $this->recursiveRemoveDirectory($path); - // if the new path is a file + // if the new path is a file } else { // we remove the file unlink($path); @@ -124,7 +124,7 @@ public function recursiveRemoveDirectory(string $directory, bool $empty = false) public static function humanFileSize(int $bytes, int $decimals = 2): string { $units = ['B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']; - $factor = floor((strlen((string)$bytes) - 1) / 3); + $factor = floor((strlen((string) $bytes) - 1) / 3); return sprintf('%.%df' . $decimals, $bytes / 1024 ** $factor, $units[$factor]); } diff --git a/src/N98/Util/ProcessArguments.php b/src/N98/Util/ProcessArguments.php index 052a123f8..eb2c8e179 100644 --- a/src/N98/Util/ProcessArguments.php +++ b/src/N98/Util/ProcessArguments.php @@ -48,7 +48,7 @@ public function addArgs(array $arguments, string $separator = '=', string $prefi { foreach ($arguments as $key => $value) { $this->addArg( - $this->conditional($key, $value, $separator, $prefix) + $this->conditional($key, $value, $separator, $prefix), ); } diff --git a/src/N98/Util/Template/Twig.php b/src/N98/Util/Template/Twig.php index d272e091e..a9784bffc 100644 --- a/src/N98/Util/Template/Twig.php +++ b/src/N98/Util/Template/Twig.php @@ -46,7 +46,7 @@ protected function addFilters(Environment $twigEnvironment): void { // cast_to_array $twigEnvironment->addFilter( - new TwigFilter('cast_to_array', [$this, 'filterCastToArray']) + new TwigFilter('cast_to_array', [$this, 'filterCastToArray']), ); } diff --git a/src/N98/Util/Unicode/Charset.php b/src/N98/Util/Unicode/Charset.php index f32ac753f..7bcc1c6da 100644 --- a/src/N98/Util/Unicode/Charset.php +++ b/src/N98/Util/Unicode/Charset.php @@ -14,17 +14,17 @@ class Charset /** * @var int */ - const UNICODE_CHECKMARK_CHAR = 10004; + public const UNICODE_CHECKMARK_CHAR = 10004; /** * @var int */ - const UNICODE_CROSS_CHAR = 10006; + public const UNICODE_CROSS_CHAR = 10006; /** * @var int */ - const UNICODE_WHITE_SQUARE_CHAR = 9633; + public const UNICODE_WHITE_SQUARE_CHAR = 9633; /** * @param int|array $codes diff --git a/src/N98/Util/VerifyOrDie.php b/src/N98/Util/VerifyOrDie.php index 7919c3765..82328fd9a 100644 --- a/src/N98/Util/VerifyOrDie.php +++ b/src/N98/Util/VerifyOrDie.php @@ -52,7 +52,7 @@ public static function argumentType(string $name, string $internalType, $subject $actual = gettype($subject); if ($actual !== $internalType) { throw new InvalidArgumentException( - sprintf('Parameter %s must be of type %s, %s given', $name, $internalType, $actual) + sprintf('Parameter %s must be of type %s, %s given', $name, $internalType, $actual), ); } } diff --git a/src/N98/Util/WindowsSystem.php b/src/N98/Util/WindowsSystem.php index 1cebd64ad..6c8bae994 100644 --- a/src/N98/Util/WindowsSystem.php +++ b/src/N98/Util/WindowsSystem.php @@ -32,9 +32,7 @@ private static function getInstance(): WindowsSystem return self::$windowsSystem; } - private function __construct() - { - } + private function __construct() {} /** * @return array keys are uppercase extensions incl. dot @@ -45,7 +43,7 @@ private function getExecutableExtensions(): array $paths = getenv('PATHEXT'); $paths = explode(self::PATH_SEPARATOR, $paths); $this->extensions || $this->extensions = array_flip( - array_map('strtoupper', $paths) + array_map('strtoupper', $paths), ); return $this->extensions; diff --git a/tests/N98/Magento/ApplicationTest.php b/tests/N98/Magento/ApplicationTest.php index 5eba4c184..edab4417f 100644 --- a/tests/N98/Magento/ApplicationTest.php +++ b/tests/N98/Magento/ApplicationTest.php @@ -48,7 +48,7 @@ public function testExecute() $application->init(ArrayFunctions::mergeArrays($distConfigArray, $configArray)); $application->run(new StringInput('list'), new NullOutput()); - // Check if autoloaders, commands and aliases are registered + // Check if autoloader, commands and aliases are registered $prefixes = $loader->getPrefixes(); self::assertArrayHasKey('N98MagerunTest', $prefixes); @@ -57,7 +57,7 @@ public function testExecute() $commandTester = new CommandTester($testDummyCommand); $commandTester->execute( - ['command' => $testDummyCommand->getName()] + ['command' => $testDummyCommand->getName()], ); self::assertStringContainsString('dummy', $commandTester->getDisplay()); self::assertTrue($application->getDefinition()->hasOption('root-dir')); @@ -95,7 +95,7 @@ public function testComposer() { vfsStream::setup('root'); vfsStream::create( - ['htdocs' => ['app' => ['Mage.php' => '']], 'vendor' => ['acme' => ['magerun-test-module' => ['n98-magerun.yaml' => file_get_contents(__DIR__ . '/_ApplicationTestComposer/n98-magerun.yaml'), 'src' => ['Acme' => ['FooCommand.php' => file_get_contents(__DIR__ . '/_ApplicationTestComposer/FooCommand.php')]]]], 'n98' => ['magerun' => ['src' => ['N98' => ['Magento' => ['Command' => ['ConfigurationLoader.php' => '']]]]]]]] + ['htdocs' => ['app' => ['Mage.php' => '']], 'vendor' => ['acme' => ['magerun-test-module' => ['n98-magerun.yaml' => file_get_contents(__DIR__ . '/_ApplicationTestComposer/n98-magerun.yaml'), 'src' => ['Acme' => ['FooCommand.php' => file_get_contents(__DIR__ . '/_ApplicationTestComposer/FooCommand.php')]]]], 'n98' => ['magerun' => ['src' => ['N98' => ['Magento' => ['Command' => ['ConfigurationLoader.php' => '']]]]]]]], ); /** @var ConfigurationLoader|MockObject $configurationLoader */ diff --git a/tests/N98/Magento/Command/Admin/User/ChangePasswordCommandTest.php b/tests/N98/Magento/Command/Admin/User/ChangePasswordCommandTest.php index b3fbb8fe4..66207e9ad 100644 --- a/tests/N98/Magento/Command/Admin/User/ChangePasswordCommandTest.php +++ b/tests/N98/Magento/Command/Admin/User/ChangePasswordCommandTest.php @@ -57,7 +57,7 @@ public function testCanChangePassword() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'username' => 'aydin', 'password' => 'password'] + ['command' => $command->getName(), 'username' => 'aydin', 'password' => 'password'], ); self::assertStringContainsString('Password successfully changed', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Admin/User/ChangeStatusCommandTest.php b/tests/N98/Magento/Command/Admin/User/ChangeStatusCommandTest.php index 9157adeba..ff48e700d 100644 --- a/tests/N98/Magento/Command/Admin/User/ChangeStatusCommandTest.php +++ b/tests/N98/Magento/Command/Admin/User/ChangeStatusCommandTest.php @@ -84,7 +84,7 @@ public function testCanEnableByUser() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => $username] + ['command' => $command->getName(), 'id' => $username], ); self::assertStringContainsString("User $username is now active", $commandTester->getDisplay()); @@ -143,7 +143,7 @@ public function testCanDisableUser() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => $username] + ['command' => $command->getName(), 'id' => $username], ); self::assertStringContainsString("User $username is now inactive", $commandTester->getDisplay()); @@ -207,7 +207,7 @@ public function testCanToggleUserByEmail() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => $username] + ['command' => $command->getName(), 'id' => $username], ); self::assertStringContainsString("User $username is now active", $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Admin/User/DeleteUserCommandTest.php b/tests/N98/Magento/Command/Admin/User/DeleteUserCommandTest.php index 0c8059685..0006fbf03 100644 --- a/tests/N98/Magento/Command/Admin/User/DeleteUserCommandTest.php +++ b/tests/N98/Magento/Command/Admin/User/DeleteUserCommandTest.php @@ -63,7 +63,7 @@ public function testCanDeleteByUserName() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => 'aydin', '--force' => true] + ['command' => $command->getName(), 'id' => 'aydin', '--force' => true], ); self::assertStringContainsString('User was successfully deleted', $commandTester->getDisplay()); @@ -103,7 +103,7 @@ public function testCanDeleteByEmail() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => 'aydin@hotmail.co.uk', '--force' => true] + ['command' => $command->getName(), 'id' => 'aydin@hotmail.co.uk', '--force' => true], ); self::assertStringContainsString('User was successfully deleted', $commandTester->getDisplay()); @@ -179,7 +179,7 @@ public function testMessageIsPrintedIfErrorDeleting() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => 'aydin@hotmail.co.uk', '--force' => true] + ['command' => $command->getName(), 'id' => 'aydin@hotmail.co.uk', '--force' => true], ); self::assertStringContainsString('Error!', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Cache/CleanCommandTest.php b/tests/N98/Magento/Command/Cache/CleanCommandTest.php index 92c1945c0..ec131b0f6 100644 --- a/tests/N98/Magento/Command/Cache/CleanCommandTest.php +++ b/tests/N98/Magento/Command/Cache/CleanCommandTest.php @@ -29,8 +29,9 @@ public function getApplication() self::markTestSkipped( sprintf( 'Test skipped because it fails after new install of a Magento 1.9+ version (Magento version is: ' . - '%s) which is the case on travis where we always have a new install.', $version - ) + '%s) which is the case on travis where we always have a new install.', + $version, + ), ); } diff --git a/tests/N98/Magento/Command/Cache/DisableCommandTest.php b/tests/N98/Magento/Command/Cache/DisableCommandTest.php index e5cdca618..f27249ddb 100644 --- a/tests/N98/Magento/Command/Cache/DisableCommandTest.php +++ b/tests/N98/Magento/Command/Cache/DisableCommandTest.php @@ -28,7 +28,7 @@ public function testExecuteMultipleCaches() $command = $this->getApplication()->find('cache:disable'); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'code' => 'eav,config'] + ['command' => $command->getName(), 'code' => 'eav,config'], ); self::assertMatchesRegularExpression('/Cache config disabled/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Cache/EnableCommandTest.php b/tests/N98/Magento/Command/Cache/EnableCommandTest.php index 0cb85aa45..a8f53f060 100644 --- a/tests/N98/Magento/Command/Cache/EnableCommandTest.php +++ b/tests/N98/Magento/Command/Cache/EnableCommandTest.php @@ -28,7 +28,7 @@ public function testExecuteMultipleCaches() $command = $this->getApplication()->find('cache:enable'); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'code' => 'eav,config'] + ['command' => $command->getName(), 'code' => 'eav,config'], ); self::assertMatchesRegularExpression('/Cache config enabled/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Cache/ReportCommandTest.php b/tests/N98/Magento/Command/Cache/ReportCommandTest.php index 6634eed32..a315725fe 100644 --- a/tests/N98/Magento/Command/Cache/ReportCommandTest.php +++ b/tests/N98/Magento/Command/Cache/ReportCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--tags' => true, '--mtime' => true] + ['command' => $command->getName(), '--tags' => true, '--mtime' => true], ); self::assertMatchesRegularExpression('/ID/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Cache/ViewCommandTest.php b/tests/N98/Magento/Command/Cache/ViewCommandTest.php index 72dcb5130..be5379793 100644 --- a/tests/N98/Magento/Command/Cache/ViewCommandTest.php +++ b/tests/N98/Magento/Command/Cache/ViewCommandTest.php @@ -18,7 +18,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => 'n98-magerun-unittest'] + ['command' => $command->getName(), 'id' => 'n98-magerun-unittest'], ); self::assertMatchesRegularExpression('/TEST n98-magerun/', $commandTester->getDisplay()); @@ -35,7 +35,7 @@ public function testExecuteUnserialize() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => 'n98-magerun-unittest', '--unserialize' => true] + ['command' => $command->getName(), 'id' => 'n98-magerun-unittest', '--unserialize' => true], ); self::assertEquals(print_r($cacheData, true) . "\n", $commandTester->getDisplay(true)); diff --git a/tests/N98/Magento/Command/Category/Create/DummyCommandTest.php b/tests/N98/Magento/Command/Category/Create/DummyCommandTest.php index 478065312..127095b66 100644 --- a/tests/N98/Magento/Command/Category/Create/DummyCommandTest.php +++ b/tests/N98/Magento/Command/Category/Create/DummyCommandTest.php @@ -20,7 +20,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'store-id' => 1, 'children-categories-number' => 1, 'category-name-prefix' => 'My Awesome Category', 'category-number' => 1] + ['command' => $command->getName(), 'store-id' => 1, 'children-categories-number' => 1, 'category-name-prefix' => 'My Awesome Category', 'category-number' => 1], ); self::assertMatchesRegularExpression('/CATEGORY: \'My Awesome Category (.+)\' WITH ID: \'(.+)\' CREATED!/', $commandTester->getDisplay()); @@ -68,7 +68,7 @@ public function testmanageArguments() ->with( self::isInstanceOf(InputInterface::class), self::isInstanceOf(OutputInterface::class), - self::isInstanceOf(Question::class) + self::isInstanceOf(Question::class), ) ->willReturn(1); @@ -78,7 +78,7 @@ public function testmanageArguments() ->with( self::isInstanceOf(InputInterface::class), self::isInstanceOf(OutputInterface::class), - self::isInstanceOf(Question::class) + self::isInstanceOf(Question::class), ) ->willReturn(0); @@ -88,7 +88,7 @@ public function testmanageArguments() ->with( self::isInstanceOf(InputInterface::class), self::isInstanceOf(OutputInterface::class), - self::isInstanceOf(Question::class) + self::isInstanceOf(Question::class), ) ->willReturn('My Awesome Category '); @@ -98,7 +98,7 @@ public function testmanageArguments() ->with( self::isInstanceOf(InputInterface::class), self::isInstanceOf(OutputInterface::class), - self::isInstanceOf(Question::class) + self::isInstanceOf(Question::class), ) ->willReturn(0); @@ -110,7 +110,7 @@ public function testmanageArguments() $commandTester->execute( [ 'command' => $command->getName(), - ] + ], ); $arguments = $commandTester->getInput()->getArguments(); diff --git a/tests/N98/Magento/Command/Cms/Block/ToggleCommandTest.php b/tests/N98/Magento/Command/Cms/Block/ToggleCommandTest.php index 61c9c6a4a..b6ff684f6 100644 --- a/tests/N98/Magento/Command/Cms/Block/ToggleCommandTest.php +++ b/tests/N98/Magento/Command/Cms/Block/ToggleCommandTest.php @@ -25,7 +25,7 @@ public function testExecute() 'command' => $command->getName(), // id should work 'block_id' => $victim->getId(), - ] + ], ); self::assertStringContainsString('disabled', $commandTester->getDisplay()); $commandTester->execute( @@ -33,7 +33,7 @@ public function testExecute() 'command' => $command->getName(), // identifier should work 'block_id' => $victim->getIdentifier(), - ] + ], ); self::assertStringContainsString('enabled', $commandTester->getDisplay()); } diff --git a/tests/N98/Magento/Command/Config/DeleteCommandTest.php b/tests/N98/Magento/Command/Config/DeleteCommandTest.php index 0a666184f..817359305 100644 --- a/tests/N98/Magento/Command/Config/DeleteCommandTest.php +++ b/tests/N98/Magento/Command/Config/DeleteCommandTest.php @@ -20,13 +20,13 @@ public function testExecute() */ $commandTester = new CommandTester($setCommand); $commandTester->execute( - ['command' => $setCommand->getName(), 'path' => 'n98_magerun/foo/bar', 'value' => '1234'] + ['command' => $setCommand->getName(), 'path' => 'n98_magerun/foo/bar', 'value' => '1234'], ); self::assertStringContainsString('n98_magerun/foo/bar => 1234', $commandTester->getDisplay()); $commandTester = new CommandTester($deleteCommand); $commandTester->execute( - ['command' => $deleteCommand->getName(), 'path' => 'n98_magerun/foo/bar'] + ['command' => $deleteCommand->getName(), 'path' => 'n98_magerun/foo/bar'], ); self::assertStringContainsString('| n98_magerun/foo/bar | default | 0 |', $commandTester->getDisplay()); @@ -43,13 +43,13 @@ public function testExecute() 'path' => 'n98_magerun/foo/bar', '--scope' => 'stores', '--scope-id' => $store->getId(), - 'value' => 'store-' . $store->getId()] + 'value' => 'store-' . $store->getId()], ); } $commandTester = new CommandTester($deleteCommand); $commandTester->execute( - ['command' => $deleteCommand->getName(), 'path' => 'n98_magerun/foo/bar', '--all' => true] + ['command' => $deleteCommand->getName(), 'path' => 'n98_magerun/foo/bar', '--all' => true], ); foreach (Mage::app()->getStores() as $store) { diff --git a/tests/N98/Magento/Command/Config/DumpCommandTest.php b/tests/N98/Magento/Command/Config/DumpCommandTest.php index b2c738c37..669c9dd96 100644 --- a/tests/N98/Magento/Command/Config/DumpCommandTest.php +++ b/tests/N98/Magento/Command/Config/DumpCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'xpath' => 'global/install'] + ['command' => $command->getName(), 'xpath' => 'global/install'], ); self::assertStringContainsString('date', $commandTester->getDisplay()); } diff --git a/tests/N98/Magento/Command/Config/GetCommandTest.php b/tests/N98/Magento/Command/Config/GetCommandTest.php index 26b088f38..4797236a4 100644 --- a/tests/N98/Magento/Command/Config/GetCommandTest.php +++ b/tests/N98/Magento/Command/Config/GetCommandTest.php @@ -17,22 +17,22 @@ public function nullValues() $this->assertDisplayRegExp( ['command' => 'config:set', '--no-null' => null, 'path' => 'n98_magerun/foo/bar', 'value' => 'NULL'], - '~^n98_magerun/foo/bar => NULL$~' + '~^n98_magerun/foo/bar => NULL$~', ); $this->assertDisplayContains( ['command' => 'config:get', '--magerun-script' => null, 'path' => 'n98_magerun/foo/bar'], - 'config:set --no-null --scope-id=0 --scope=default' + 'config:set --no-null --scope-id=0 --scope=default', ); $this->assertDisplayContains( ['command' => 'config:set', 'path' => 'n98_magerun/foo/bar', 'value' => 'NULL'], - 'n98_magerun/foo/bar => NULL (NULL/"unknown" value)' + 'n98_magerun/foo/bar => NULL (NULL/"unknown" value)', ); $this->assertDisplayContains( ['command' => 'config:get', 'path' => 'n98_magerun/foo/bar'], - '| n98_magerun/foo/bar | default | 0 | NULL (NULL/"unknown" value) |' + '| n98_magerun/foo/bar | default | 0 | NULL (NULL/"unknown" value) |', ); $this->assertDisplayContains( @@ -42,7 +42,7 @@ public function nullValues() # needed to not use the previous output cache 'path' => 'n98_magerun/foo/bar', ], - 'config:set --scope-id=0 --scope=default -- \'n98_magerun/foo/bar\' NULL' + 'config:set --scope-id=0 --scope=default -- \'n98_magerun/foo/bar\' NULL', ); } @@ -62,12 +62,12 @@ public function nullWithFormat($format, $expected) $this->assertDisplayContains( ['command' => 'config:set', 'path' => 'n98_magerun/foo/bar', 'value' => 'NULL'], - 'n98_magerun/foo/bar => NULL (NULL/"unknown" value)' + 'n98_magerun/foo/bar => NULL (NULL/"unknown" value)', ); $this->assertDisplayRegExp( ['command' => 'config:get', '--format' => $format, 'path' => 'n98_magerun/foo/bar'], - $expected + $expected, ); } @@ -78,22 +78,22 @@ public function testExecute() */ $this->assertDisplayContains( ['command' => 'config:set', 'path' => 'n98_magerun/foo/bar', 'value' => '1234'], - 'n98_magerun/foo/bar => 1234' + 'n98_magerun/foo/bar => 1234', ); $this->assertDisplayContains( ['command' => 'config:get', 'path' => 'n98_magerun/foo/bar'], - '| n98_magerun/foo/bar | default | 0 | 1234 |' + '| n98_magerun/foo/bar | default | 0 | 1234 |', ); $this->assertDisplayContains( ['command' => 'config:get', 'path' => 'n98_magerun/foo/bar', '--update-script' => true], - "\$installer->setConfigData('n98_magerun/foo/bar', '1234');" + "\$installer->setConfigData('n98_magerun/foo/bar', '1234');", ); $this->assertDisplayContains( ['command' => 'config:get', 'path' => 'n98_magerun/foo/bar', '--magerun-script' => true], - "config:set --scope-id=0 --scope=default -- 'n98_magerun/foo/bar' '1234'" + "config:set --scope-id=0 --scope=default -- 'n98_magerun/foo/bar' '1234'", ); /** @@ -115,7 +115,7 @@ public function testExecute() */ $this->assertDisplayRegExp( ['command' => 'config:get', 'path' => 'n98_magerun/foo/bar', '--format' => 'json'], - '/"Value":\s*"1234"/' + '/"Value":\s*"1234"/', ); } @@ -146,8 +146,8 @@ private function skipMagentoMinimumVersion($community, $enterprise) sprintf( 'Test requires minimum Magento version of "%s", version "%s" is in use', $community, - $magentoVersion - ) + $magentoVersion, + ), ); } break; @@ -157,8 +157,8 @@ private function skipMagentoMinimumVersion($community, $enterprise) sprintf( 'Test requires minimum Magento version of "%s", version "%s" is in use', $enterprise, - $magentoVersion - ) + $magentoVersion, + ), ); } break; @@ -166,8 +166,8 @@ private function skipMagentoMinimumVersion($community, $enterprise) self::markTestSkipped( sprintf( 'Test requires community or enterprise edition, Magento edition "%s" given', - $magentoEdition - ) + $magentoEdition, + ), ); } } diff --git a/tests/N98/Magento/Command/Config/SearchCommandTest.php b/tests/N98/Magento/Command/Config/SearchCommandTest.php index 27bac88a0..ae3b5e4f5 100644 --- a/tests/N98/Magento/Command/Config/SearchCommandTest.php +++ b/tests/N98/Magento/Command/Config/SearchCommandTest.php @@ -15,13 +15,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'text' => 'This message will be shown'] + ['command' => $command->getName(), 'text' => 'This message will be shown'], ); self::assertStringContainsString('Found a field with a match', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'text' => 'xyz1234567890'] + ['command' => $command->getName(), 'text' => 'xyz1234567890'], ); self::assertStringContainsString('No matches for xyz1234567890', $commandTester->getDisplay()); } diff --git a/tests/N98/Magento/Command/Customer/DeleteCommandTest.php b/tests/N98/Magento/Command/Customer/DeleteCommandTest.php index 41e921e4e..231566f7b 100644 --- a/tests/N98/Magento/Command/Customer/DeleteCommandTest.php +++ b/tests/N98/Magento/Command/Customer/DeleteCommandTest.php @@ -129,7 +129,7 @@ public function testCanDeleteById() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => '1', '--force' => true] + ['command' => $command->getName(), 'id' => '1', '--force' => true], ); self::assertStringContainsString('successfully deleted', $commandTester->getDisplay()); @@ -176,7 +176,7 @@ public function testCanDeleteByEmail() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => 'mike@testing.com', '--force' => true] + ['command' => $command->getName(), 'id' => 'mike@testing.com', '--force' => true], ); self::assertStringContainsString('successfully deleted', $commandTester->getDisplay()); @@ -214,7 +214,7 @@ public function testCustomerNotFound() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'id' => 'mike@testing.com', '--force' => true] + ['command' => $command->getName(), 'id' => 'mike@testing.com', '--force' => true], ); self::assertStringContainsString('No customer found!', $commandTester->getDisplay()); @@ -255,7 +255,7 @@ public function testDeleteFailed() $command->getHelperSet()->set($this->questionHelper, 'question'); $commandTester->execute( - ['command' => $command->getName(), 'id' => '1', '--force' => true] + ['command' => $command->getName(), 'id' => '1', '--force' => true], ); self::assertStringContainsString('Failed to save', $commandTester->getDisplay()); @@ -306,7 +306,7 @@ public function testPromptForCustomerIdAndDelete() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--force' => true] + ['command' => $command->getName(), '--force' => true], ); self::assertStringContainsString('successfully deleted', $commandTester->getDisplay()); @@ -332,7 +332,7 @@ public function testBatchDeleteGetsCustomerCollection() $command->getHelperSet()->set($this->questionHelper, 'question'); $commandTester->execute( - ['command' => $command->getName(), '--all' => true] + ['command' => $command->getName(), '--all' => true], ); self::assertStringContainsString('Aborting delete', $commandTester->getDisplay()); @@ -377,7 +377,7 @@ public function testRangeDeleteGetsCustomerCollection() $command->getHelperSet()->set($this->questionHelper, 'question'); $commandTester->execute( - ['command' => $command->getName(), '--range' => true] + ['command' => $command->getName(), '--range' => true], ); self::assertStringContainsString('Aborting delete', $commandTester->getDisplay()); @@ -422,7 +422,7 @@ public function testShouldRemoveStopsDeletion() $command->getHelperSet()->set($this->questionHelper, 'question'); $commandTester->execute( - ['command' => $command->getName(), 'id' => '1'] + ['command' => $command->getName(), 'id' => '1'], ); self::assertStringContainsString('Aborting delete', $commandTester->getDisplay()); @@ -467,7 +467,7 @@ public function testShouldRemovePromptAllowsDeletion() $command->getHelperSet()->set($this->questionHelper, 'question'); $commandTester->execute( - ['command' => $command->getName(), 'id' => '1'] + ['command' => $command->getName(), 'id' => '1'], ); self::assertStringContainsString('successfully deleted', $commandTester->getDisplay()); @@ -488,7 +488,7 @@ public function testPromptDeleteAllAndDeleteRangeAndAbort() $command->getHelperSet()->set($this->questionHelper, 'question'); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertStringContainsString('nothing to do', $commandTester->getDisplay()); @@ -519,7 +519,7 @@ public function testPromptAllCanDeleteAll() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--force' => true] + ['command' => $command->getName(), '--force' => true], ); self::assertStringContainsString('Successfully deleted 3 customer/s', $commandTester->getDisplay()); @@ -568,7 +568,7 @@ public function testPromptRangeCanDeleteRange() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--force' => true] + ['command' => $command->getName(), '--force' => true], ); self::assertStringContainsString('Successfully deleted 3 customer/s', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Database/DumpCommandTest.php b/tests/N98/Magento/Command/Database/DumpCommandTest.php index b30d6c7fc..f53250280 100644 --- a/tests/N98/Magento/Command/Database/DumpCommandTest.php +++ b/tests/N98/Magento/Command/Database/DumpCommandTest.php @@ -36,7 +36,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--compression' => 'gz'] + ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--compression' => 'gz'], ); self::assertMatchesRegularExpression('/mysqldump/', $commandTester->getDisplay()); @@ -94,7 +94,7 @@ public function testWithStripOption() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--strip' => '@development not_existing_table_1', '--compression' => 'gzip'] + ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--strip' => '@development not_existing_table_1', '--compression' => 'gzip'], ); $dbConfig = $this->getDatabaseConnection()->getConfig(); @@ -113,7 +113,7 @@ public function testWithStripOption() */ $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--strip' => '@development'] + ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--strip' => '@development'], ); self::assertStringNotContainsString('.sql.gz', $commandTester->getDisplay()); } @@ -130,7 +130,7 @@ public function testWithIncludeExcludeOptions() */ $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--exclude' => 'core_config_data', '--compression' => 'gzip'] + ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--exclude' => 'core_config_data', '--compression' => 'gzip'], ); self::assertMatchesRegularExpression("/--ignore-table=$db\.core_config_data/", $commandTester->getDisplay()); @@ -139,7 +139,7 @@ public function testWithIncludeExcludeOptions() */ $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--include' => 'core_config_data', '--compression' => 'gzip'] + ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--include' => 'core_config_data', '--compression' => 'gzip'], ); self::assertDoesNotMatchRegularExpression("/--ignore-table=$db\.core_config_data/", $commandTester->getDisplay()); self::assertMatchesRegularExpression("/--ignore-table=$db\.catalog_product_entity/", $commandTester->getDisplay()); @@ -156,7 +156,7 @@ public function testIncludeExcludeMutualExclusivity() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--include' => 'core_config_data', '--exclude' => 'catalog_product_entity', '--compression' => 'gzip'] + ['command' => $command->getName(), '--add-time' => true, '--only-command' => true, '--force' => true, '--include' => 'core_config_data', '--exclude' => 'catalog_product_entity', '--compression' => 'gzip'], ); } @@ -170,12 +170,12 @@ public function realDump() if ($dumpFile->isReadable()) { self::assertTrue(unlink($dumpFile), 'Precondition to unlink that the file does not exists'); } - self::assertIsNotReadable((string)$dumpFile, 'Precondition that the file does not exists'); + self::assertIsNotReadable((string) $dumpFile, 'Precondition that the file does not exists'); $command = $this->getCommand(); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--strip' => '@stripped', 'filename' => $dumpFile] + ['command' => $command->getName(), '--strip' => '@stripped', 'filename' => $dumpFile], ); self::assertTrue($dumpFile->isReadable(), 'File was created'); diff --git a/tests/N98/Magento/Command/Database/InfoCommandTest.php b/tests/N98/Magento/Command/Database/InfoCommandTest.php index 8e9aeb45a..cc9d86f2b 100644 --- a/tests/N98/Magento/Command/Database/InfoCommandTest.php +++ b/tests/N98/Magento/Command/Database/InfoCommandTest.php @@ -27,7 +27,7 @@ public function testExecuteWithSettingArgument() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'setting' => 'MySQL-Cli-String'] + ['command' => $command->getName(), 'setting' => 'MySQL-Cli-String'], ); self::assertDoesNotMatchRegularExpression('/MySQL-Cli-String/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Database/Maintain/CheckTablesCommandTest.php b/tests/N98/Magento/Command/Database/Maintain/CheckTablesCommandTest.php index 25e9ced50..be68304b4 100644 --- a/tests/N98/Magento/Command/Database/Maintain/CheckTablesCommandTest.php +++ b/tests/N98/Magento/Command/Database/Maintain/CheckTablesCommandTest.php @@ -17,17 +17,17 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--format' => 'csv', '--type' => 'quick', '--table' => 'catalogsearch_*'] + ['command' => $command->getName(), '--format' => 'csv', '--type' => 'quick', '--table' => 'catalogsearch_*'], ); self::assertStringContainsString('catalogsearch_fulltext,check,quick,OK', $commandTester->getDisplay()); $timeRegex = '"\s+[0-9]+\srows","[0-9\.]+\ssecs"'; self::assertMatchesRegularExpression( '~catalogsearch_query,"ENGINE InnoDB",' . $timeRegex . '~', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); self::assertMatchesRegularExpression( '~catalogsearch_result,"ENGINE InnoDB",' . $timeRegex . '~', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } diff --git a/tests/N98/Magento/Command/Database/QueryCommandTest.php b/tests/N98/Magento/Command/Database/QueryCommandTest.php index 5260fd219..a133c1356 100644 --- a/tests/N98/Magento/Command/Database/QueryCommandTest.php +++ b/tests/N98/Magento/Command/Database/QueryCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'query' => 'SHOW TABLES;'] + ['command' => $command->getName(), 'query' => 'SHOW TABLES;'], ); self::assertStringContainsString('admin_user', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Database/StatusCommandTest.php b/tests/N98/Magento/Command/Database/StatusCommandTest.php index 4204c1a1d..238767888 100644 --- a/tests/N98/Magento/Command/Database/StatusCommandTest.php +++ b/tests/N98/Magento/Command/Database/StatusCommandTest.php @@ -20,7 +20,7 @@ protected function getCommand(array $options) $commandTester = new CommandTester($command); $commandTester->execute( - array_merge(['command' => $command->getName()], $options) + array_merge(['command' => $command->getName()], $options), ); return $commandTester; } @@ -54,7 +54,7 @@ public function testRounding() $commandTester = $this->getCommand(['--format' => 'csv', '--rounding' => '2', 'search' => '%size%']); self::assertMatchesRegularExpression( '~Innodb_page_size,[0-9\.]+K,~', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } } diff --git a/tests/N98/Magento/Command/Database/VariablesCommandTest.php b/tests/N98/Magento/Command/Database/VariablesCommandTest.php index 65caba25d..d4ee9a3d8 100644 --- a/tests/N98/Magento/Command/Database/VariablesCommandTest.php +++ b/tests/N98/Magento/Command/Database/VariablesCommandTest.php @@ -28,7 +28,7 @@ protected function getCommand(array $options) $commandTester = new CommandTester($command); $commandTester->execute( - array_merge(['command' => $command->getName()], $options) + array_merge(['command' => $command->getName()], $options), ); return $commandTester; diff --git a/tests/N98/Magento/Command/Design/DemoNoticeCommandTest.php b/tests/N98/Magento/Command/Design/DemoNoticeCommandTest.php index a43a362d4..09b59e61d 100644 --- a/tests/N98/Magento/Command/Design/DemoNoticeCommandTest.php +++ b/tests/N98/Magento/Command/Design/DemoNoticeCommandTest.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'store' => 'admin', '--on' => true] + ['command' => $command->getName(), 'store' => 'admin', '--on' => true], ); self::assertMatchesRegularExpression('/Demo Notice enabled/', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'store' => 'admin', '--off' => true] + ['command' => $command->getName(), 'store' => 'admin', '--off' => true], ); self::assertMatchesRegularExpression('/Demo Notice disabled/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/ClassLookupCommandTest.php b/tests/N98/Magento/Command/Developer/ClassLookupCommandTest.php index 25e936fd6..0b1f83645 100644 --- a/tests/N98/Magento/Command/Developer/ClassLookupCommandTest.php +++ b/tests/N98/Magento/Command/Developer/ClassLookupCommandTest.php @@ -25,7 +25,7 @@ public function testExecute($type, $name, $expected, $exists) $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'type' => $type, 'name' => $name] + ['command' => $command->getName(), 'type' => $type, 'name' => $name], ); $output = $commandTester->getDisplay(); diff --git a/tests/N98/Magento/Command/Developer/Ide/PhpStorm/MetaCommandTest.php b/tests/N98/Magento/Command/Developer/Ide/PhpStorm/MetaCommandTest.php index e2dc21dd1..fd94555e6 100644 --- a/tests/N98/Magento/Command/Developer/Ide/PhpStorm/MetaCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Ide/PhpStorm/MetaCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--stdout' => true] + ['command' => $command->getName(), '--stdout' => true], ); $fileContent = $commandTester->getDisplay(true); @@ -35,7 +35,7 @@ public function testExecute() self::assertStringNotContainsString( '\'payment/paygate_request\' => \Mage_Payment_Model_Paygate_Request', - $fileContent + $fileContent, ); } } diff --git a/tests/N98/Magento/Command/Developer/Log/LogCommand.php b/tests/N98/Magento/Command/Developer/Log/LogCommand.php index c46cd7e74..96ca77dbd 100644 --- a/tests/N98/Magento/Command/Developer/Log/LogCommand.php +++ b/tests/N98/Magento/Command/Developer/Log/LogCommand.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--global' => true, '--on' => true] + ['command' => $command->getName(), '--global' => true, '--on' => true], ); self::assertMatchesRegularExpression('/Development Log/', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--global' => true, '--off' => true] + ['command' => $command->getName(), '--global' => true, '--off' => true], ); self::assertMatchesRegularExpression('/Development Log/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/MergeCssCommandTest.php b/tests/N98/Magento/Command/Developer/MergeCssCommandTest.php index fd8842e28..ccc3e5a31 100644 --- a/tests/N98/Magento/Command/Developer/MergeCssCommandTest.php +++ b/tests/N98/Magento/Command/Developer/MergeCssCommandTest.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--on' => true, 'store' => 'admin'] + ['command' => $command->getName(), '--on' => true, 'store' => 'admin'], ); self::assertMatchesRegularExpression('/CSS Merging enabled/', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--off' => true, 'store' => 'admin'] + ['command' => $command->getName(), '--off' => true, 'store' => 'admin'], ); self::assertMatchesRegularExpression('/CSS Merging disabled/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/MergeJsCommandTest.php b/tests/N98/Magento/Command/Developer/MergeJsCommandTest.php index a7ab4d160..d71a624cd 100644 --- a/tests/N98/Magento/Command/Developer/MergeJsCommandTest.php +++ b/tests/N98/Magento/Command/Developer/MergeJsCommandTest.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--on' => true, 'store' => 'admin'] + ['command' => $command->getName(), '--on' => true, 'store' => 'admin'], ); self::assertMatchesRegularExpression('/JS Merging enabled/', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--off' => true, 'store' => 'admin'] + ['command' => $command->getName(), '--off' => true, 'store' => 'admin'], ); self::assertMatchesRegularExpression('/JS Merging disabled/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Module/CreateCommandTest.php b/tests/N98/Magento/Command/Developer/Module/CreateCommandTest.php index f9199ffcb..950a03c42 100644 --- a/tests/N98/Magento/Command/Developer/Module/CreateCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Module/CreateCommandTest.php @@ -25,7 +25,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--add-all' => true, '--add-setup' => true, '--add-readme' => true, '--add-composer' => true, '--modman' => true, '--description' => 'Unit Test Description', '--author-name' => 'Unit Test', '--author-email' => 'n98-magerun@example.com', 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'] + ['command' => $command->getName(), '--add-all' => true, '--add-setup' => true, '--add-readme' => true, '--add-composer' => true, '--modman' => true, '--description' => 'Unit Test Description', '--author-name' => 'Unit Test', '--author-email' => 'n98-magerun@example.com', 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'], ); self::assertFileExists($root . '/N98Magerun_UnitTest/composer.json'); diff --git a/tests/N98/Magento/Command/Developer/Module/ListCommandTest.php b/tests/N98/Magento/Command/Developer/Module/ListCommandTest.php index 2607c0b7e..81c9c5a5f 100644 --- a/tests/N98/Magento/Command/Developer/Module/ListCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Module/ListCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertMatchesRegularExpression('/Mage_Core/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Module/Observer/ListCommandTest.php b/tests/N98/Magento/Command/Developer/Module/Observer/ListCommandTest.php index 1bdf40b05..ce8e9f684 100644 --- a/tests/N98/Magento/Command/Developer/Module/Observer/ListCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Module/Observer/ListCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'type' => 'global'] + ['command' => $command->getName(), 'type' => 'global'], ); self::assertStringContainsString('controller_front_init_routers', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommandTest.php b/tests/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommandTest.php index 1278ef1bd..4e359714d 100644 --- a/tests/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommandTest.php @@ -24,7 +24,7 @@ public function testExecute() */ $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertStringContainsString('No rewrite conflicts were found', $commandTester->getDisplay()); @@ -33,7 +33,7 @@ public function testExecute() */ $commandTester = new CommandTester($command); $result = $commandTester->execute( - ['command' => $command->getName(), '--log-junit' => '_output.xml'] + ['command' => $command->getName(), '--log-junit' => '_output.xml'], ); self::assertEquals(0, $result); self::assertEquals('', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar.php b/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar.php index eb64c09c1..220647e32 100644 --- a/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar.php +++ b/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar.php @@ -7,6 +7,4 @@ * Class definition that will cause a warning when the non-existing parent-class is included from the same directory */ -class Le_Foo_Le_Bar extends Le_Foo_Le_Bar_Nexiste_Pas -{ -} +class Le_Foo_Le_Bar extends Le_Foo_Le_Bar_Nexiste_Pas {} diff --git a/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_Fine.php b/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_Fine.php index 13c4e9923..8dae04369 100644 --- a/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_Fine.php +++ b/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_Fine.php @@ -7,6 +7,4 @@ * Class definition that just works when it is included from the same directory */ -class Le_Foo_Le_Bar_Fine -{ -} +class Le_Foo_Le_Bar_Fine {} diff --git a/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_R1.php b/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_R1.php index bf3b80137..ce24cf5c9 100644 --- a/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_R1.php +++ b/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_R1.php @@ -8,11 +8,7 @@ */ if (true) { - class Le_Foo_Le_Bar_R1 extends Le_Foo_Le_Bar_R2 - { - } + class Le_Foo_Le_Bar_R1 extends Le_Foo_Le_Bar_R2 {} } else { - class Le_Foo_Le_Bar_R1 extends Le_Foo_Le_Bar_Nexiste_Pas - { - } + class Le_Foo_Le_Bar_R1 extends Le_Foo_Le_Bar_Nexiste_Pas {} } diff --git a/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_R2.php b/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_R2.php index 5c1f8ed76..02f1b7283 100644 --- a/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_R2.php +++ b/tests/N98/Magento/Command/Developer/Module/Rewrite/fixture/Le_Foo_Le_Bar_R2.php @@ -8,6 +8,4 @@ * Class definition that will cause a warning when the non-existing parent-class is included from the same directory */ -class Le_Foo_Le_Bar_R2 extends Le_Foo_Le_Bar_Nexiste_Pas -{ -} +class Le_Foo_Le_Bar_R2 extends Le_Foo_Le_Bar_Nexiste_Pas {} diff --git a/tests/N98/Magento/Command/Developer/Module/UpdateCommandTest.php b/tests/N98/Magento/Command/Developer/Module/UpdateCommandTest.php index 477f1373b..128a49a02 100644 --- a/tests/N98/Magento/Command/Developer/Module/UpdateCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Module/UpdateCommandTest.php @@ -25,7 +25,7 @@ public function testExecute() $commandTester = new CommandTester($createCommand); $commandTester->execute( - ['command' => $createCommand->getName(), '--add-all' => true, '--modman' => true, '--description' => 'Unit Test Description', '--author-name' => 'Unit Test', '--author-email' => 'n98-magerun@example.com', 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'] + ['command' => $createCommand->getName(), '--add-all' => true, '--modman' => true, '--description' => 'Unit Test Description', '--author-name' => 'Unit Test', '--author-email' => 'n98-magerun@example.com', 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'], ); $commandTester = new CommandTester($updateCommand); @@ -87,7 +87,7 @@ protected function _getConfigXmlContents($moduleBaseFolder) protected function _setVersionOptionTest($commandTester, $updateCommand, $moduleBaseFolder) { $commandTester->execute( - ['command' => $updateCommand->getName(), '--set-version' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'] + ['command' => $updateCommand->getName(), '--set-version' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'], ); self::assertFileExists($moduleBaseFolder . 'etc/config.xml'); @@ -107,7 +107,7 @@ protected function _addResourceModelOptionTest($dialog, $commandTester, $updateC { $dialog->setInputStream($this->getInputStream("y\nentity1\nentity1table\nentity2\nentity2table\n\n")); $commandTester->execute( - ['command' => $updateCommand->getName(), '--add-resource-model' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'] + ['command' => $updateCommand->getName(), '--add-resource-model' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'], ); $configXmlContent = $this->_getConfigXmlContents($moduleBaseFolder); @@ -131,7 +131,7 @@ protected function _addRoutersOptionTest($dialog, $commandTester, $updateCommand { $dialog->setInputStream($this->getInputStream("admin\nstandard\nn98magerun\n")); $commandTester->execute( - ['command' => $updateCommand->getName(), '--add-routers' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'] + ['command' => $updateCommand->getName(), '--add-routers' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'], ); $configXmlContent = $this->_getConfigXmlContents($moduleBaseFolder); @@ -154,7 +154,7 @@ protected function _addEventsOptionTest($dialog, $commandTester, $updateCommand, { $dialog->setInputStream($this->getInputStream("frontend\ncontroller_action_postdispatch\nn98mageruntest_observer\nn98magerun_unittest/observer\ncontrollerActionPostdispatch")); $commandTester->execute( - ['command' => $updateCommand->getName(), '--add-events' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'] + ['command' => $updateCommand->getName(), '--add-events' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'], ); $configXmlContent = $this->_getConfigXmlContents($moduleBaseFolder); self::assertStringContainsString('', $configXmlContent); @@ -174,7 +174,7 @@ protected function _addLayoutUpdatesOptionTest($dialog, $commandTester, $updateC { $dialog->setInputStream($this->getInputStream("adminhtml\nn98magerun_unittest\nn98magerun_unittest.xml")); $commandTester->execute( - ['command' => $updateCommand->getName(), '--add-layout-updates' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'] + ['command' => $updateCommand->getName(), '--add-layout-updates' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'], ); $configXmlContent = $this->_getConfigXmlContents($moduleBaseFolder); self::assertStringContainsString('', $configXmlContent); @@ -194,7 +194,7 @@ protected function _addTranslateOptionTest($dialog, $commandTester, $updateComma { $dialog->setInputStream($this->getInputStream("adminhtml\nN98magerun_UnitTest.csv")); $commandTester->execute( - ['command' => $updateCommand->getName(), '--add-translate' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'] + ['command' => $updateCommand->getName(), '--add-translate' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'], ); $configXmlContent = $this->_getConfigXmlContents($moduleBaseFolder); self::assertStringContainsString('', $configXmlContent); @@ -215,7 +215,7 @@ protected function _addDefaultOptionTest($dialog, $commandTester, $updateCommand { $dialog->setInputStream($this->getInputStream("sectiontest\ngrouptest\nfieldname\nfieldvalue")); $commandTester->execute( - ['command' => $updateCommand->getName(), '--add-default' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'] + ['command' => $updateCommand->getName(), '--add-default' => true, 'vendorNamespace' => 'N98Magerun', 'moduleName' => 'UnitTest'], ); $configXmlContent = $this->_getConfigXmlContents($moduleBaseFolder); self::assertStringContainsString('', $configXmlContent); diff --git a/tests/N98/Magento/Command/Developer/ProfilerCommandTest.php b/tests/N98/Magento/Command/Developer/ProfilerCommandTest.php index d2500d9eb..2397f3c7e 100644 --- a/tests/N98/Magento/Command/Developer/ProfilerCommandTest.php +++ b/tests/N98/Magento/Command/Developer/ProfilerCommandTest.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--global' => true, '--on' => true] + ['command' => $command->getName(), '--global' => true, '--on' => true], ); self::assertMatchesRegularExpression('/Profiler enabled/', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--global' => true, '--off' => true] + ['command' => $command->getName(), '--global' => true, '--off' => true], ); self::assertMatchesRegularExpression('/Profiler disabled/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Setup/Script/AttributeCommandTest.php b/tests/N98/Magento/Command/Developer/Setup/Script/AttributeCommandTest.php index d360d75b2..d1d23513f 100644 --- a/tests/N98/Magento/Command/Developer/Setup/Script/AttributeCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Setup/Script/AttributeCommandTest.php @@ -16,12 +16,12 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => 'sku'] + ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => 'sku'], ); self::assertStringContainsString("'type' => 'static',", $commandTester->getDisplay()); self::assertStringContainsString( "Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', 'sku');", - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } } diff --git a/tests/N98/Magento/Command/Developer/SymlinksCommandTest.php b/tests/N98/Magento/Command/Developer/SymlinksCommandTest.php index a31d818f1..508320115 100644 --- a/tests/N98/Magento/Command/Developer/SymlinksCommandTest.php +++ b/tests/N98/Magento/Command/Developer/SymlinksCommandTest.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--global' => true, '--on' => true] + ['command' => $command->getName(), '--global' => true, '--on' => true], ); self::assertMatchesRegularExpression('/Symlinks allowed/', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--global' => true, '--off' => true] + ['command' => $command->getName(), '--global' => true, '--off' => true], ); self::assertMatchesRegularExpression('/Symlinks denied/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/TemplateHintsBlocksCommandTest.php b/tests/N98/Magento/Command/Developer/TemplateHintsBlocksCommandTest.php index 0593bbd78..19fe682ba 100644 --- a/tests/N98/Magento/Command/Developer/TemplateHintsBlocksCommandTest.php +++ b/tests/N98/Magento/Command/Developer/TemplateHintsBlocksCommandTest.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--on' => true, 'store' => 'admin'] + ['command' => $command->getName(), '--on' => true, 'store' => 'admin'], ); self::assertMatchesRegularExpression('/Template Hints Blocks enabled/', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--off' => true, 'store' => 'admin'] + ['command' => $command->getName(), '--off' => true, 'store' => 'admin'], ); self::assertMatchesRegularExpression('/Template Hints Blocks disabled/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/TemplateHintsCommandTest.php b/tests/N98/Magento/Command/Developer/TemplateHintsCommandTest.php index 6dbb1e358..b259dcec7 100644 --- a/tests/N98/Magento/Command/Developer/TemplateHintsCommandTest.php +++ b/tests/N98/Magento/Command/Developer/TemplateHintsCommandTest.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--on' => true, 'store' => 'admin'] + ['command' => $command->getName(), '--on' => true, 'store' => 'admin'], ); self::assertMatchesRegularExpression('/Template Hints enabled/', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--off' => true, 'store' => 'admin'] + ['command' => $command->getName(), '--off' => true, 'store' => 'admin'], ); self::assertMatchesRegularExpression('/Template Hints disabled/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Theme/DuplicatesCommandTest.php b/tests/N98/Magento/Command/Developer/Theme/DuplicatesCommandTest.php index c2d2cdb71..91c61a015 100644 --- a/tests/N98/Magento/Command/Developer/Theme/DuplicatesCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Theme/DuplicatesCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'theme' => 'base/default', 'originalTheme' => 'base/default'] + ['command' => $command->getName(), 'theme' => 'base/default', 'originalTheme' => 'base/default'], ); $display = $commandTester->getDisplay(); diff --git a/tests/N98/Magento/Command/Developer/Theme/InfoCommandTest.php b/tests/N98/Magento/Command/Developer/Theme/InfoCommandTest.php index 551293ab6..70fe8fea1 100644 --- a/tests/N98/Magento/Command/Developer/Theme/InfoCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Theme/InfoCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertStringContainsString('base/default', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Theme/ListCommandTest.php b/tests/N98/Magento/Command/Developer/Theme/ListCommandTest.php index 1c6a620ff..15f429276 100644 --- a/tests/N98/Magento/Command/Developer/Theme/ListCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Theme/ListCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertStringContainsString('base/default', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Translate/InlineAdminCommandTest.php b/tests/N98/Magento/Command/Developer/Translate/InlineAdminCommandTest.php index 893589925..f223e40e2 100644 --- a/tests/N98/Magento/Command/Developer/Translate/InlineAdminCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Translate/InlineAdminCommandTest.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--on' => true] + ['command' => $command->getName(), '--on' => true], ); self::assertStringContainsString('Inline Translation (Admin) enabled', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--off' => true] + ['command' => $command->getName(), '--off' => true], ); self::assertStringContainsString('Inline Translation (Admin) disabled', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Translate/InlineShopCommandTest.php b/tests/N98/Magento/Command/Developer/Translate/InlineShopCommandTest.php index ff71874a3..6fdac6857 100644 --- a/tests/N98/Magento/Command/Developer/Translate/InlineShopCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Translate/InlineShopCommandTest.php @@ -16,13 +16,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'store' => 'admin', '--on' => true] + ['command' => $command->getName(), 'store' => 'admin', '--on' => true], ); self::assertStringContainsString('Inline Translation enabled', $commandTester->getDisplay()); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'store' => 'admin', '--off' => true] + ['command' => $command->getName(), 'store' => 'admin', '--off' => true], ); self::assertStringContainsString('Inline Translation disabled', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Developer/Translate/SetCommandTest.php b/tests/N98/Magento/Command/Developer/Translate/SetCommandTest.php index fbafd6ae1..655a21c67 100644 --- a/tests/N98/Magento/Command/Developer/Translate/SetCommandTest.php +++ b/tests/N98/Magento/Command/Developer/Translate/SetCommandTest.php @@ -16,7 +16,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'string' => 'foo', 'translate' => 'bar', 'store' => 'admin'] + ['command' => $command->getName(), 'string' => 'foo', 'translate' => 'bar', 'store' => 'admin'], ); self::assertStringContainsString('foo => bar', $commandTester->getDisplay()); } diff --git a/tests/N98/Magento/Command/Eav/Attribute/Create/DummyCommandTest.php b/tests/N98/Magento/Command/Eav/Attribute/Create/DummyCommandTest.php index 715cdd909..38c602c93 100644 --- a/tests/N98/Magento/Command/Eav/Attribute/Create/DummyCommandTest.php +++ b/tests/N98/Magento/Command/Eav/Attribute/Create/DummyCommandTest.php @@ -19,7 +19,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'locale' => 'en_US', 'attribute-id' => 92, 'values-type' => 'int', 'values-number' => 1] + ['command' => $command->getName(), 'locale' => 'en_US', 'attribute-id' => 92, 'values-type' => 'int', 'values-number' => 1], ); self::assertMatchesRegularExpression('/ATTRIBUTE VALUE: \'(.+)\' ADDED!/', $commandTester->getDisplay()); @@ -42,7 +42,7 @@ public function testmanageArguments() ->with( self::isInstanceOf(InputInterface::class), self::isInstanceOf(OutputInterface::class), - self::isInstanceOf(Question::class) + self::isInstanceOf(Question::class), ) ->willReturn(92); @@ -52,7 +52,7 @@ public function testmanageArguments() ->with( self::isInstanceOf(InputInterface::class), self::isInstanceOf(OutputInterface::class), - self::isInstanceOf(Question::class) + self::isInstanceOf(Question::class), ) ->willReturn('int'); @@ -62,7 +62,7 @@ public function testmanageArguments() ->with( self::isInstanceOf(InputInterface::class), self::isInstanceOf(OutputInterface::class), - self::isInstanceOf(Question::class) + self::isInstanceOf(Question::class), ) ->willReturn(1); @@ -72,7 +72,7 @@ public function testmanageArguments() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); $arguments = $commandTester->getInput()->getArguments(); diff --git a/tests/N98/Magento/Command/Eav/Attribute/ListCommandTest.php b/tests/N98/Magento/Command/Eav/Attribute/ListCommandTest.php index ffad51ba0..9d8da2482 100644 --- a/tests/N98/Magento/Command/Eav/Attribute/ListCommandTest.php +++ b/tests/N98/Magento/Command/Eav/Attribute/ListCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--filter-type' => 'catalog_product', '--add-source' => true] + ['command' => $command->getName(), '--filter-type' => 'catalog_product', '--add-source' => true], ); self::assertStringContainsString('eav/entity_attribute_source_boolean', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Eav/Attribute/RemoveCommandTest.php b/tests/N98/Magento/Command/Eav/Attribute/RemoveCommandTest.php index 80d9c43f5..b058bf1c6 100644 --- a/tests/N98/Magento/Command/Eav/Attribute/RemoveCommandTest.php +++ b/tests/N98/Magento/Command/Eav/Attribute/RemoveCommandTest.php @@ -25,7 +25,7 @@ public function testCommandThrowsExceptionIfInvalidEntityType() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'entityType' => 'not_a_valid_type', 'attributeCode' => ['someAttribute']] + ['command' => $command->getName(), 'entityType' => 'not_a_valid_type', 'attributeCode' => ['someAttribute']], ); } @@ -38,12 +38,12 @@ public function testCommandPrintsErrorIfAttributeNotExists() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => ['not_an_attribute']] + ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => ['not_an_attribute']], ); self::assertStringContainsString( 'Attribute: "not_an_attribute" does not exist for entity type: "catalog_product"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -61,7 +61,7 @@ public function testAttributeIsSuccessfullyRemoved() self::assertTrue($this->attributeExists($entityType, $attributeCode)); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'entityType' => $entityType, 'attributeCode' => [$attributeCode]] + ['command' => $command->getName(), 'entityType' => $entityType, 'attributeCode' => [$attributeCode]], ); self::assertFalse($this->attributeExists($entityType, $attributeCode)); @@ -84,7 +84,7 @@ public function testOrderAttributeIsSuccessfullyRemoved($entityTypeCode) self::assertTrue($this->attributeExists($entityTypeCode, $attributeCode)); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'entityType' => $entityTypeCode, 'attributeCode' => [$attributeCode]] + ['command' => $command->getName(), 'entityType' => $entityTypeCode, 'attributeCode' => [$attributeCode]], ); self::assertFalse($this->attributeExists($entityTypeCode, $attributeCode)); @@ -107,7 +107,7 @@ public function testCanRemoveMultipleAttributes() self::assertTrue($this->attributeExists('catalog_product', $attributeCode2)); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => [$attributeCode1, $attributeCode2]] + ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => [$attributeCode1, $attributeCode2]], ); self::assertFalse($this->attributeExists('catalog_product', $attributeCode1)); @@ -115,12 +115,12 @@ public function testCanRemoveMultipleAttributes() self::assertStringContainsString( 'Successfully removed attribute: "crazyCoolAttribute1" from entity type: "catalog_product"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); self::assertStringContainsString( 'Successfully removed attribute: "crazyCoolAttribute2" from entity type: "catalog_product"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -139,7 +139,7 @@ public function testCanRemoveMultipleAttributesIfSomeNotExist() self::assertFalse($this->attributeExists('catalog_product', $attributeCode2)); $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => [$attributeCode1, $attributeCode2]] + ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => [$attributeCode1, $attributeCode2]], ); self::assertFalse($this->attributeExists('catalog_product', $attributeCode1)); @@ -147,12 +147,12 @@ public function testCanRemoveMultipleAttributesIfSomeNotExist() self::assertStringContainsString( 'Attribute: "crazyCoolAttribute2" does not exist for entity type: "catalog_product"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); self::assertStringContainsString( 'Successfully removed attribute: "crazyCoolAttribute1" from entity type: "catalog_product"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } diff --git a/tests/N98/Magento/Command/Eav/Attribute/ViewCommandTest.php b/tests/N98/Magento/Command/Eav/Attribute/ViewCommandTest.php index f4979e177..bccf9cd6c 100644 --- a/tests/N98/Magento/Command/Eav/Attribute/ViewCommandTest.php +++ b/tests/N98/Magento/Command/Eav/Attribute/ViewCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => 'sku'] + ['command' => $command->getName(), 'entityType' => 'catalog_product', 'attributeCode' => 'sku'], ); self::assertStringContainsString('sku', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/HelpCommandTest.php b/tests/N98/Magento/Command/HelpCommandTest.php index e977e453f..9fe34aa77 100644 --- a/tests/N98/Magento/Command/HelpCommandTest.php +++ b/tests/N98/Magento/Command/HelpCommandTest.php @@ -12,7 +12,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => 'help'] + ['command' => 'help'], ); self::assertStringContainsString('The help command displays help for a given command', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Indexer/ReindexAllCommandTest.php b/tests/N98/Magento/Command/Indexer/ReindexAllCommandTest.php index ede929457..51475dadd 100644 --- a/tests/N98/Magento/Command/Indexer/ReindexAllCommandTest.php +++ b/tests/N98/Magento/Command/Indexer/ReindexAllCommandTest.php @@ -17,7 +17,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertStringContainsString('Successfully reindexed catalog_product_attribute', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Indexer/ReindexCommandTest.php b/tests/N98/Magento/Command/Indexer/ReindexCommandTest.php index 9fddd8076..57142019c 100644 --- a/tests/N98/Magento/Command/Indexer/ReindexCommandTest.php +++ b/tests/N98/Magento/Command/Indexer/ReindexCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'index_code' => 'tag_summary,tag_summary'] + ['command' => $command->getName(), 'index_code' => 'tag_summary,tag_summary'], ); self::assertStringContainsString('Successfully reindexed tag_summary', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Installer/InstallCommandPackageVersionTest.php b/tests/N98/Magento/Command/Installer/InstallCommandPackageVersionTest.php index aaad373e2..f87a37f41 100644 --- a/tests/N98/Magento/Command/Installer/InstallCommandPackageVersionTest.php +++ b/tests/N98/Magento/Command/Installer/InstallCommandPackageVersionTest.php @@ -57,7 +57,7 @@ private function assertOngoingPackageVersions(array $packages, $namespacesMinimu self::assertArrayNotHasKey( $name, $nameConstraint, - sprintf('duplicate package "%s"', $name) + sprintf('duplicate package "%s"', $name), ); $nameConstraint[$name] = 1; @@ -80,7 +80,7 @@ private function assertOngoingPackageVersions(array $packages, $namespacesMinimu $message = sprintf( "Check order of versions for package \"$namespace\", higher comes first, but got %s before %s", $nameStack[$namespace], - $version + $version, ); self::assertGreaterThan(0, $comparison, $message); } @@ -154,7 +154,8 @@ private function isVersionNumber($buffer) * @param string $buffer * @return bool */ - private function isTripartiteOpenMageVersionNumber($buffer) { + private function isTripartiteOpenMageVersionNumber($buffer) + { if (!preg_match('~^(?:19|2\d)\.\d+\.\d+$~', $buffer)) { return false; } diff --git a/tests/N98/Magento/Command/Installer/InstallCommandTest.php b/tests/N98/Magento/Command/Installer/InstallCommandTest.php index 05be3c506..8fb1de652 100644 --- a/tests/N98/Magento/Command/Installer/InstallCommandTest.php +++ b/tests/N98/Magento/Command/Installer/InstallCommandTest.php @@ -24,7 +24,7 @@ public function setup(): void $result = rmdir($installDir); if (!$result) { throw new RuntimeException( - sprintf('Failed to remove temporary install dir "%s"', $installDir) + sprintf('Failed to remove temporary install dir "%s"', $installDir), ); } } @@ -55,8 +55,8 @@ public function testInstallFailsWithInvalidDbConfigWhenAllOptionsArePassedIn() '--dbHost' => 'hostWhichDoesNotExists', '--dbUser' => 'user', '--dbPass' => 'pa$$w0rd', - '--dbName' => 'magento' - ] + '--dbName' => 'magento', + ], ); } catch (InvalidArgumentException $e) { self::assertEquals('Database configuration is invalid', $e->getMessage()); diff --git a/tests/N98/Magento/Command/Installer/UninstallCommandTest.php b/tests/N98/Magento/Command/Installer/UninstallCommandTest.php index e88dc5fc5..9939c90b6 100644 --- a/tests/N98/Magento/Command/Installer/UninstallCommandTest.php +++ b/tests/N98/Magento/Command/Installer/UninstallCommandTest.php @@ -50,7 +50,7 @@ public function testUninstallForceActuallyRemoves() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--force' => true, '--installationFolder' => $this->getTestMagentoRoot()] + ['command' => $command->getName(), '--force' => true, '--installationFolder' => $this->getTestMagentoRoot()], ); self::assertStringContainsString('Dropped database', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/ListCommandTest.php b/tests/N98/Magento/Command/ListCommandTest.php index afea0d266..55d2f73d6 100644 --- a/tests/N98/Magento/Command/ListCommandTest.php +++ b/tests/N98/Magento/Command/ListCommandTest.php @@ -12,12 +12,12 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => 'list'] + ['command' => 'list'], ); self::assertStringContainsString( sprintf('n98-magerun %s by valantic CEC', $this->getApplication()->getVersion()), - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } } diff --git a/tests/N98/Magento/Command/LocalConfig/GenerateCommandTest.php b/tests/N98/Magento/Command/LocalConfig/GenerateCommandTest.php index 90949612c..71c677170 100644 --- a/tests/N98/Magento/Command/LocalConfig/GenerateCommandTest.php +++ b/tests/N98/Magento/Command/LocalConfig/GenerateCommandTest.php @@ -36,7 +36,7 @@ public function setUp(): void copy( sprintf('%s/app/etc/local.xml.template', $this->getTestMagentoRoot()), - sprintf('%s/local.xml.template', dirname($this->configFile)) + sprintf('%s/local.xml.template', dirname($this->configFile)), ); parent::setUp(); @@ -58,13 +58,13 @@ public function testErrorIsPrintedIfConfigFileExists() 'session-save' => 'my_session_save', 'admin-frontname' => 'my_admin_frontname', 'encryption-key' => 'key123456789', - ] + ], ); self::assertFileExists($this->configFile); self::assertStringContainsString( sprintf('local.xml file already exists in folder "%s/app/etc"', dirname($this->configFile)), - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -83,12 +83,12 @@ public function testErrorIsPrintedIfConfigTemplateNotExists() 'session-save' => 'my_session_save', 'admin-frontname' => 'my_admin_frontname', 'encryption-key' => 'key123456789', - ] + ], ); self::assertStringContainsString( sprintf('File %s/local.xml.template does not exist', dirname($this->configFile)), - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -110,12 +110,12 @@ public function testErrorIsPrintedIfAppEtcDirNotWriteable() 'session-save' => 'my_session_save', 'admin-frontname' => 'my_admin_frontname', 'encryption-key' => 'key123456789', - ] + ], ); self::assertStringContainsString( sprintf('Folder %s is not writeable', dirname($this->configFile)), - $commandTester->getDisplay() + $commandTester->getDisplay(), ); chmod(dirname($this->configFile), $originalMode); @@ -135,7 +135,7 @@ public function testRandomMd5IsUsedIfNoEncryptionKeyParamPassed() 'db-name' => 'my_db_name', 'session-save' => 'my_session_save', 'admin-frontname' => 'my_admin_frontname', - ] + ], ); self::assertFileExists($this->configFile); @@ -167,7 +167,7 @@ public function testExecuteWithCliParameters() 'session-save' => 'my_session_save', 'admin-frontname' => 'my_admin_frontname', 'encryption-key' => 'key123456789', - ] + ], ); self::assertFileExists($this->configFile); @@ -200,7 +200,7 @@ public function testInteractiveInputUsesDefaultValuesIfNoValueEntered() ], [ 'interactive' => false, - ] + ], ); self::assertFileExists($this->configFile); @@ -252,8 +252,8 @@ public function testRequiredOptionsThrowExceptionIfNotSet($param, $prompt, $defa self::isInstanceOf(StreamOutput::class), new Question( sprintf('Please enter the %s: ', $prompt), - $default - ) + $default, + ), ) ->willReturn(null); @@ -305,8 +305,8 @@ public function testExecuteInteractively() self::isInstanceOf(StreamOutput::class), new Question( sprintf('Please enter the %s: ', $prompt), - $default - ) + $default, + ), ) ->willReturn($returnValue); } @@ -342,7 +342,7 @@ public function testIfPasswordOmittedItIsWrittenBlank() ->with( self::isInstanceOf(InputInterface::class), self::isInstanceOf(StreamOutput::class), - new Question('Please enter the database password: ') + new Question('Please enter the database password: '), ) ->willReturn(null); @@ -358,7 +358,7 @@ public function testIfPasswordOmittedItIsWrittenBlank() 'session-save' => 'my_session_save', 'admin-frontname' => 'my_admin_frontname', 'encryption-key' => 'key123456789', - ] + ], ); self::assertFileExists($this->configFile); @@ -389,8 +389,8 @@ public function testCdataTagIsNotAddedIfPresentInInput() self::isInstanceOf(InputInterface::class), self::isInstanceOf(StreamOutput::class), new Question( - 'Please enter the database host: ' - ) + 'Please enter the database host: ', + ), ) ->willReturn('CDATAdatabasehost'); @@ -406,7 +406,7 @@ public function testCdataTagIsNotAddedIfPresentInInput() 'session-save' => 'my_session_save', 'admin-frontname' => 'my_admin_frontname', 'encryption-key' => 'key123456789', - ] + ], ); self::assertFileExists($this->configFile); diff --git a/tests/N98/Magento/Command/MagentoConnect/ListExtensionsCommandTest.php b/tests/N98/Magento/Command/MagentoConnect/ListExtensionsCommandTest.php index 78d53c46e..cd053aebe 100644 --- a/tests/N98/Magento/Command/MagentoConnect/ListExtensionsCommandTest.php +++ b/tests/N98/Magento/Command/MagentoConnect/ListExtensionsCommandTest.php @@ -26,7 +26,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'search' => 'Mage_All_Latest'] + ['command' => $command->getName(), 'search' => 'Mage_All_Latest'], ); self::assertContains('Package', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/MagentoConnect/ValidateExtensionCommandTest.php b/tests/N98/Magento/Command/MagentoConnect/ValidateExtensionCommandTest.php index 8b7091a44..9f0fd0655 100644 --- a/tests/N98/Magento/Command/MagentoConnect/ValidateExtensionCommandTest.php +++ b/tests/N98/Magento/Command/MagentoConnect/ValidateExtensionCommandTest.php @@ -35,7 +35,7 @@ public function testSetup() $commandTester = new CommandTester($commandMock); $commandTester->execute( - ['command' => $commandMock->getName(), 'package' => 'Mage_All_Latest', '--include-default' => true] + ['command' => $commandMock->getName(), 'package' => 'Mage_All_Latest', '--include-default' => true], ); $output = $commandTester->getDisplay(); diff --git a/tests/N98/Magento/Command/Media/DumpCommand.php b/tests/N98/Magento/Command/Media/DumpCommand.php index 30b7f37ec..de3da5900 100644 --- a/tests/N98/Magento/Command/Media/DumpCommand.php +++ b/tests/N98/Magento/Command/Media/DumpCommand.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'filename' => tempnam('media_'), '--strip' => true] + ['command' => $command->getName(), 'filename' => tempnam('media_'), '--strip' => true], ); self::assertContains('Compress directory', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Script/Repository/ListCommandTest.php b/tests/N98/Magento/Command/Script/Repository/ListCommandTest.php index ab4bbcf7f..a78170a96 100644 --- a/tests/N98/Magento/Command/Script/Repository/ListCommandTest.php +++ b/tests/N98/Magento/Command/Script/Repository/ListCommandTest.php @@ -19,7 +19,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertStringContainsString('Cache Flush Command Test (Hello World)', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/Script/Repository/RunCommandTest.php b/tests/N98/Magento/Command/Script/Repository/RunCommandTest.php index e70133a4a..033ef10b9 100644 --- a/tests/N98/Magento/Command/Script/Repository/RunCommandTest.php +++ b/tests/N98/Magento/Command/Script/Repository/RunCommandTest.php @@ -22,7 +22,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'script' => 'hello-world'] + ['command' => $command->getName(), 'script' => 'hello-world'], ); // Runs sys:info -> Check for any output @@ -30,7 +30,7 @@ public function testExecute() self::assertStringContainsString( $testDir . '/hello-world.magerun', - $this->normalizePathSeparators($commandTester->getDisplay()) + $this->normalizePathSeparators($commandTester->getDisplay()), ); } diff --git a/tests/N98/Magento/Command/ScriptCommandTest.php b/tests/N98/Magento/Command/ScriptCommandTest.php index d98f992e9..cfb4a9baa 100644 --- a/tests/N98/Magento/Command/ScriptCommandTest.php +++ b/tests/N98/Magento/Command/ScriptCommandTest.php @@ -16,7 +16,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'filename' => __DIR__ . '/_files/test.mr'] + ['command' => $command->getName(), 'filename' => __DIR__ . '/_files/test.mr'], ); // Check pre defined vars diff --git a/tests/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstractTest.php b/tests/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstractTest.php index c1f71ffca..5f520a1e5 100644 --- a/tests/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstractTest.php +++ b/tests/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstractTest.php @@ -8,6 +8,7 @@ namespace N98\Magento\Command\System\Check\Settings; use PHPUnit\Framework\TestCase; + /** * Class CookieDomainCheckAbstractTest * diff --git a/tests/N98/Magento/Command/System/Cron/HistoryCommandTest.php b/tests/N98/Magento/Command/System/Cron/HistoryCommandTest.php index 26033ff80..943ec4c3f 100644 --- a/tests/N98/Magento/Command/System/Cron/HistoryCommandTest.php +++ b/tests/N98/Magento/Command/System/Cron/HistoryCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertMatchesRegularExpression('/Last executed jobs/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/System/Cron/RunCommandTest.php b/tests/N98/Magento/Command/System/Cron/RunCommandTest.php index 158b822c7..024f7be23 100644 --- a/tests/N98/Magento/Command/System/Cron/RunCommandTest.php +++ b/tests/N98/Magento/Command/System/Cron/RunCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'job' => 'log_clean'] + ['command' => $command->getName(), 'job' => 'log_clean'], ); self::assertMatchesRegularExpression('/Run Mage_Log_Model_Cron::logClean done/', $commandTester->getDisplay()); @@ -32,7 +32,7 @@ public function urlBuildingWhileCron() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), 'job' => 'log_clean'] + ['command' => $command->getName(), 'job' => 'log_clean'], ); self::assertMatchesRegularExpression('/Run Mage_Log_Model_Cron::logClean done/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/System/InfoCommandTest.php b/tests/N98/Magento/Command/System/InfoCommandTest.php index e0515f9f4..9586bd5d8 100644 --- a/tests/N98/Magento/Command/System/InfoCommandTest.php +++ b/tests/N98/Magento/Command/System/InfoCommandTest.php @@ -22,7 +22,7 @@ public function testExecute() // Settings argument $commandTester->execute( - ['command' => $command->getName(), 'key' => 'version'] + ['command' => $command->getName(), 'key' => 'version'], ); $commandResult = $commandTester->getDisplay(); diff --git a/tests/N98/Magento/Command/System/MaintenanceCommandTest.php b/tests/N98/Magento/Command/System/MaintenanceCommandTest.php index 903249799..e8fea36bf 100644 --- a/tests/N98/Magento/Command/System/MaintenanceCommandTest.php +++ b/tests/N98/Magento/Command/System/MaintenanceCommandTest.php @@ -20,13 +20,13 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--on' => ''] + ['command' => $command->getName(), '--on' => ''], ); self::assertMatchesRegularExpression('/Maintenance mode on/', $commandTester->getDisplay()); self::assertFileExists($magentoRootFolder . '/maintenance.flag'); $commandTester->execute( - ['command' => $command->getName(), '--off' => ''] + ['command' => $command->getName(), '--off' => ''], ); self::assertMatchesRegularExpression('/Maintenance mode off/', $commandTester->getDisplay()); self::assertFileDoesNotExist($magentoRootFolder . '/maintenance.flag'); diff --git a/tests/N98/Magento/Command/System/Setup/ChangeVersionCommandTest.php b/tests/N98/Magento/Command/System/Setup/ChangeVersionCommandTest.php index a52f7b7ba..e518f1350 100644 --- a/tests/N98/Magento/Command/System/Setup/ChangeVersionCommandTest.php +++ b/tests/N98/Magento/Command/System/Setup/ChangeVersionCommandTest.php @@ -43,7 +43,7 @@ public function testChangeVersion() self::assertStringContainsString( 'Successfully updated: "Mage_Weee" - "weee_setup" to version: "1.6.0.0"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -82,7 +82,7 @@ public function testUpdateBySetupName() self::assertStringContainsString( 'Successfully updated: "Mage_Weee" - "weee_setup" to version: "1.6.0.0"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -95,7 +95,7 @@ public function testSetupNameNotFound() $commandTester = new CommandTester($command); $this->expectException( - InvalidArgumentException::class + InvalidArgumentException::class, ); $commandTester->execute(['command' => $command->getName(), 'module' => 'Mage_Weee', 'version' => '1.6.0.0', 'setup' => 'no_setup_exists']); @@ -133,7 +133,7 @@ public function testCommandReturnsEarlyIfNoSetupResourcesForModule() self::assertStringContainsString( 'No setup resources found for module: "Mage_Weee"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } } diff --git a/tests/N98/Magento/Command/System/Setup/CompareVersionsCommandTest.php b/tests/N98/Magento/Command/System/Setup/CompareVersionsCommandTest.php index b1c63f21c..d13d86499 100644 --- a/tests/N98/Magento/Command/System/Setup/CompareVersionsCommandTest.php +++ b/tests/N98/Magento/Command/System/Setup/CompareVersionsCommandTest.php @@ -16,7 +16,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertMatchesRegularExpression('/Setup/', $commandTester->getDisplay()); @@ -35,7 +35,7 @@ public function testJunit() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName(), '--log-junit' => vfsStream::url('root/junit.xml')] + ['command' => $command->getName(), '--log-junit' => vfsStream::url('root/junit.xml')], ); self::assertFileExists(vfsStream::url('root/junit.xml')); diff --git a/tests/N98/Magento/Command/System/Setup/RemoveCommandTest.php b/tests/N98/Magento/Command/System/Setup/RemoveCommandTest.php index 3951ad62e..5a06f546f 100644 --- a/tests/N98/Magento/Command/System/Setup/RemoveCommandTest.php +++ b/tests/N98/Magento/Command/System/Setup/RemoveCommandTest.php @@ -47,7 +47,7 @@ public function testRemoveModule() self::assertStringContainsString( 'Successfully removed setup resource: "weee_setup" from module: "Mage_Weee"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -89,7 +89,7 @@ public function testRemoveBySetupName() self::assertStringContainsString( 'Successfully removed setup resource: "weee_setup" from module: "Mage_Weee"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -132,7 +132,7 @@ public function testRemoveBySetupNameFailure() self::assertStringContainsString( 'No entry was found for setup resource: "weee_setup" in module: "Mage_Weee"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } @@ -145,7 +145,7 @@ public function testSetupNameNotFound() $commandTester = new CommandTester($command); $this->expectException( - InvalidArgumentException::class + InvalidArgumentException::class, ); $commandTester->execute(['command' => $command->getName(), 'module' => 'Mage_Weee', 'setup' => 'no_setup_exists']); @@ -187,7 +187,7 @@ public function testCommandReturnsEarlyIfNoSetupResourcesForModule() self::assertStringContainsString( 'No setup resources found for module: "Mage_Weee"', - $commandTester->getDisplay() + $commandTester->getDisplay(), ); } } diff --git a/tests/N98/Magento/Command/System/Setup/RunCommandTest.php b/tests/N98/Magento/Command/System/Setup/RunCommandTest.php index 2219388cb..c27a45c3e 100644 --- a/tests/N98/Magento/Command/System/Setup/RunCommandTest.php +++ b/tests/N98/Magento/Command/System/Setup/RunCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertMatchesRegularExpression('/done/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/System/Store/Config/BaseUrlListCommandTest.php b/tests/N98/Magento/Command/System/Store/Config/BaseUrlListCommandTest.php index 4d5434f87..b392e043c 100644 --- a/tests/N98/Magento/Command/System/Store/Config/BaseUrlListCommandTest.php +++ b/tests/N98/Magento/Command/System/Store/Config/BaseUrlListCommandTest.php @@ -15,7 +15,7 @@ public function testExecute() $commandTester = new CommandTester($command); $commandTester->execute( - ['command' => $command->getName()] + ['command' => $command->getName()], ); self::assertMatchesRegularExpression('/secure_baseurl/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/Command/System/Url/ListCommandTest.php b/tests/N98/Magento/Command/System/Url/ListCommandTest.php index b6166ee7e..98f0f5d93 100644 --- a/tests/N98/Magento/Command/System/Url/ListCommandTest.php +++ b/tests/N98/Magento/Command/System/Url/ListCommandTest.php @@ -23,7 +23,7 @@ public function testExecute() '--add-categories' => true, '--add-products' => true, '--add-cmspages' => true, - ] + ], ); self::assertMatchesRegularExpression('/prefix/', $commandTester->getDisplay()); diff --git a/tests/N98/Magento/MagerunCommandTester.php b/tests/N98/Magento/MagerunCommandTester.php index efac9c199..2a0582bf4 100644 --- a/tests/N98/Magento/MagerunCommandTester.php +++ b/tests/N98/Magento/MagerunCommandTester.php @@ -122,12 +122,12 @@ private function getCommandInternal() $test->assertSame( $command->getName(), $this->commandName, - 'Verifying that test is done against main command name' + 'Verifying that test is done against main command name', ); if (!$command instanceof Command) { throw new InvalidArgumentException( - sprintf('Command "%s" is not a console command', $this->commandName) + sprintf('Command "%s" is not a console command', $this->commandName), ); } diff --git a/tests/N98/Magento/ModulesTest.php b/tests/N98/Magento/ModulesTest.php index 60072186d..d2fe8cc9b 100644 --- a/tests/N98/Magento/ModulesTest.php +++ b/tests/N98/Magento/ModulesTest.php @@ -37,7 +37,7 @@ public function filteringCountAndIterating() $modules = new Modules(); $result = $modules->filterModules( - $this->filter() + $this->filter(), ); self::assertInstanceOf(__NAMESPACE__ . '\Modules', $result); self::assertCount(0, $result); diff --git a/tests/N98/Magento/TestApplication.php b/tests/N98/Magento/TestApplication.php index 4387b86ad..28449b409 100644 --- a/tests/N98/Magento/TestApplication.php +++ b/tests/N98/Magento/TestApplication.php @@ -67,7 +67,7 @@ public static function getTestMagentoRootFromEnvironment($varname, $basename) # directory test if (!is_dir($root)) { throw new RuntimeException( - sprintf("%s path '%s' is not a directory (cwd: '%s', stopfile: '%s')", $varname, $root, getcwd(), $stopfile ?? '') + sprintf("%s path '%s' is not a directory (cwd: '%s', stopfile: '%s')", $varname, $root, getcwd(), $stopfile ?? ''), ); } @@ -75,7 +75,7 @@ public static function getTestMagentoRootFromEnvironment($varname, $basename) $rootRealpath = realpath($root); if (false === $rootRealpath) { throw new RuntimeException( - sprintf("Failed to resolve %s path '%s' with realpath()", $varname, $root) + sprintf("Failed to resolve %s path '%s' with realpath()", $varname, $root), ); } @@ -132,7 +132,7 @@ public function getTestMagentoRoot() if (null === $root) { throw new SkippedTestError( - "Please specify environment variable $varname with path to your test magento installation!" + "Please specify environment variable $varname with path to your test magento installation!", ); } diff --git a/tests/N98/Magento/TestApplicationTest.php b/tests/N98/Magento/TestApplicationTest.php index 9c9c9b940..d5565d0ab 100644 --- a/tests/N98/Magento/TestApplicationTest.php +++ b/tests/N98/Magento/TestApplicationTest.php @@ -8,6 +8,7 @@ namespace N98\Magento; use PHPUnit\Framework\TestCase; + class TestApplicationTest extends TestCase { /** diff --git a/tests/N98/Magento/_ApplicationTestSrc/N98MagerunTest/AlternativeConfigModel.php b/tests/N98/Magento/_ApplicationTestSrc/N98MagerunTest/AlternativeConfigModel.php index d158c2608..c3044efba 100644 --- a/tests/N98/Magento/_ApplicationTestSrc/N98MagerunTest/AlternativeConfigModel.php +++ b/tests/N98/Magento/_ApplicationTestSrc/N98MagerunTest/AlternativeConfigModel.php @@ -3,6 +3,5 @@ namespace N98MagerunTest; use Mage_Core_Model_Config; -class AlternativeConfigModel extends Mage_Core_Model_Config -{ -} + +class AlternativeConfigModel extends Mage_Core_Model_Config {} diff --git a/tests/N98/Util/ArrayFunctionsTest.php b/tests/N98/Util/ArrayFunctionsTest.php index c53d5e162..8165c31c3 100644 --- a/tests/N98/Util/ArrayFunctionsTest.php +++ b/tests/N98/Util/ArrayFunctionsTest.php @@ -3,6 +3,7 @@ namespace N98\Util; use PHPUnit\Framework\TestCase; + /** * Class ArrayFunctionsTest * diff --git a/tests/N98/Util/AutoloadHandlerTest.php b/tests/N98/Util/AutoloadHandlerTest.php index 2564958cc..4f8cc635e 100644 --- a/tests/N98/Util/AutoloadHandlerTest.php +++ b/tests/N98/Util/AutoloadHandlerTest.php @@ -9,6 +9,7 @@ use PHPUnit\Framework\TestCase; use BadMethodCallException; + /** * Class AutoloadHandlerTest * diff --git a/tests/N98/Util/AutoloadRestorerTest.php b/tests/N98/Util/AutoloadRestorerTest.php index 26488c69c..cde1f217c 100644 --- a/tests/N98/Util/AutoloadRestorerTest.php +++ b/tests/N98/Util/AutoloadRestorerTest.php @@ -8,6 +8,7 @@ namespace N98\Util; use PHPUnit\Framework\TestCase; + /** * Class AutoloadRestorerTest * @@ -30,8 +31,7 @@ public function creation() */ public function restoration() { - $callbackStub = function () { - }; + $callbackStub = function () {}; self::assertTrue(spl_autoload_register($callbackStub)); diff --git a/tests/N98/Util/BinaryStringTest.php b/tests/N98/Util/BinaryStringTest.php index 1660c21d4..24dc4d8f9 100644 --- a/tests/N98/Util/BinaryStringTest.php +++ b/tests/N98/Util/BinaryStringTest.php @@ -3,6 +3,7 @@ namespace N98\Util; use PHPUnit\Framework\TestCase; + /** * Class BinaryStringTest * diff --git a/tests/N98/Util/Console/Helper/DatabaseHelperTest.php b/tests/N98/Util/Console/Helper/DatabaseHelperTest.php index 467d5258e..27855700a 100644 --- a/tests/N98/Util/Console/Helper/DatabaseHelperTest.php +++ b/tests/N98/Util/Console/Helper/DatabaseHelperTest.php @@ -133,7 +133,7 @@ public function getMysqlVariable() // test against the mysql error message self::assertEquals( 'Invalid mysql variable type "@@@", must be "@@" (system) or "@" (session)', - $invalidArgumentException->getMessage() + $invalidArgumentException->getMessage(), ); } } @@ -192,7 +192,7 @@ public function resolveTables() $tables = $this->getHelper()->resolveTables( ['@wild_1', '@wild_2', '@dataflow'], - $definitions + $definitions, ); self::assertContains('catalog_product_entity', $tables); self::assertContains('core_config_data', $tables); diff --git a/tests/N98/Util/Console/Helper/MagentoHelper.php b/tests/N98/Util/Console/Helper/MagentoHelper.php index b90bcef44..521a0c320 100644 --- a/tests/N98/Util/Console/Helper/MagentoHelper.php +++ b/tests/N98/Util/Console/Helper/MagentoHelper.php @@ -33,7 +33,7 @@ public function detectMagentoInStandardFolder() { vfsStream::setup('root'); vfsStream::create( - ['app' => ['Mage.php' => '']] + ['app' => ['Mage.php' => '']], ); $helper = $this->getHelper(); @@ -49,7 +49,7 @@ public function detectMagentoInHtdocsSubfolder() { vfsStream::setup('root'); vfsStream::create( - ['htdocs' => ['app' => ['Mage.php' => '']]] + ['htdocs' => ['app' => ['Mage.php' => '']]], ); $helper = $this->getHelper(); @@ -57,7 +57,7 @@ public function detectMagentoInHtdocsSubfolder() // vfs cannot resolve relative path so we do 'root/htdocs' etc. $helper->detect( vfsStream::url('root'), - [vfsStream::url('root/www'), vfsStream::url('root/public'), vfsStream::url('root/htdocs')] + [vfsStream::url('root/www'), vfsStream::url('root/public'), vfsStream::url('root/htdocs')], ); self::assertEquals(vfsStream::url('root/htdocs'), $helper->getRootFolder()); @@ -70,14 +70,14 @@ public function detectMagentoFailed() { vfsStream::setup('root'); vfsStream::create( - ['htdocs' => []] + ['htdocs' => []], ); $helper = $this->getHelper(); // vfs cannot resolve relative path so we do 'root/htdocs' etc. $helper->detect( - vfsStream::url('root') + vfsStream::url('root'), ); self::assertNull($helper->getRootFolder()); @@ -90,14 +90,14 @@ public function detectMagentoInModmanInfrastructure() { vfsStream::setup('root'); vfsStream::create( - ['.basedir' => 'root/htdocs/magento_root', 'htdocs' => ['magento_root' => ['app' => ['Mage.php' => '']]]] + ['.basedir' => 'root/htdocs/magento_root', 'htdocs' => ['magento_root' => ['app' => ['Mage.php' => '']]]], ); $helper = $this->getHelper(); // vfs cannot resolve relative path so we do 'root/htdocs' etc. $helper->detect( - vfsStream::url('root') + vfsStream::url('root'), ); // Verify if this could be checked with more elegance diff --git a/tests/N98/Util/Console/Helper/Table/Renderer/RenderFactoryTest.php b/tests/N98/Util/Console/Helper/Table/Renderer/RenderFactoryTest.php index c31821cb3..bb1ee3ddc 100644 --- a/tests/N98/Util/Console/Helper/Table/Renderer/RenderFactoryTest.php +++ b/tests/N98/Util/Console/Helper/Table/Renderer/RenderFactoryTest.php @@ -3,6 +3,7 @@ namespace N98\Util\Console\Helper\Table\Renderer; use PHPUnit\Framework\TestCase; + class RenderFactoryTest extends TestCase { /** diff --git a/tests/N98/Util/DateTimeTest.php b/tests/N98/Util/DateTimeTest.php index 22613d2b5..752e0c143 100644 --- a/tests/N98/Util/DateTimeTest.php +++ b/tests/N98/Util/DateTimeTest.php @@ -5,6 +5,7 @@ use PHPUnit\Framework\TestCase; use DateTime; use DateTimeZone; + class DateTimeTest extends TestCase { /** diff --git a/tests/N98/Util/ExecTest.php b/tests/N98/Util/ExecTest.php index de8e7b7d8..06896f378 100644 --- a/tests/N98/Util/ExecTest.php +++ b/tests/N98/Util/ExecTest.php @@ -4,6 +4,7 @@ use PHPUnit\Framework\TestCase; use RuntimeException; + /** * Class ExecTest * diff --git a/tests/N98/Util/FilesystemTest.php b/tests/N98/Util/FilesystemTest.php index 2faa25133..6dd3c4a61 100644 --- a/tests/N98/Util/FilesystemTest.php +++ b/tests/N98/Util/FilesystemTest.php @@ -9,6 +9,7 @@ use PHPUnit\Framework\TestCase; use RuntimeException; + /** * Class FilesystemTest * @package N98\Util diff --git a/tests/N98/Util/OperatingSystemTest.php b/tests/N98/Util/OperatingSystemTest.php index f57f61759..e684d3c69 100644 --- a/tests/N98/Util/OperatingSystemTest.php +++ b/tests/N98/Util/OperatingSystemTest.php @@ -8,6 +8,7 @@ namespace N98\Util; use PHPUnit\Framework\TestCase; + /** * Class OperatingSystemTest * diff --git a/tests/N98/Util/Unicode/CharsetTest.php b/tests/N98/Util/Unicode/CharsetTest.php index 90e140c3c..d76fcd938 100644 --- a/tests/N98/Util/Unicode/CharsetTest.php +++ b/tests/N98/Util/Unicode/CharsetTest.php @@ -3,6 +3,7 @@ namespace N98\Util\Unicode; use PHPUnit\Framework\TestCase; + class CharsetTest extends TestCase { public function testConvertInteger() diff --git a/tests/N98/Util/WindowsSystemTest.php b/tests/N98/Util/WindowsSystemTest.php index 841c3c78a..6610b9f22 100644 --- a/tests/N98/Util/WindowsSystemTest.php +++ b/tests/N98/Util/WindowsSystemTest.php @@ -8,6 +8,7 @@ namespace N98\Util; use PHPUnit\Framework\TestCase; + /** * Class WindowsSystemTest * diff --git a/tests/check-coverage.php b/tests/check-coverage.php index cb8725ee1..52fe102f9 100644 --- a/tests/check-coverage.php +++ b/tests/check-coverage.php @@ -11,8 +11,8 @@ throw new InvalidArgumentException( sprintf( 'Invalid input file %s provided as first parameter. The file does not exists.', - var_export($inputFile, true) - ) + var_export($inputFile, true), + ), ); }