diff --git a/.php_cs b/.php_cs
index ef1b60a2a..5dcdabe7d 100644
--- a/.php_cs
+++ b/.php_cs
@@ -1,37 +1,30 @@
in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
;
-return Symfony\CS\Config::create()
- ->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
- ->fixers(
- array_merge(
- explode(
- ',',
- 'single_blank_line_before_namespace,no_blank_lines_after_class_opening,unused_use,ordered_use,' .
- 'concat_with_spaces,spaces_cast,trailing_spaces,unalign_equals'
- ),
- array(
- 'array_element_no_space_before_comma', 'array_element_white_space_after_comma',
- 'multiline_array_trailing_comma',
- 'align_double_arrow',
- 'trim_array_spaces',
- 'spaces_cast',
- 'function_typehint_space', 'join_function',
- 'blankline_after_open_tag', 'duplicate_semicolon',
- 'extra_empty_lines', 'no_blank_lines_after_class_opening',
- 'operators_spaces',
- 'remove_leading_slash_use',
- 'remove_lines_between_uses',
- 'newline_after_open_tag',
- 'ordered_use',
- 'standardize_not_equal',
- )
- )
- )
- ->finder($finder)
- ->setUsingCache(true)
-;
+return PhpCsFixer\Config::create()
+ ->setFinder($finder)
+ ->setRules([
+ '@PSR2' => true,
+ 'array_syntax' => ['syntax' => 'short'],
+ 'concat_space' => ['spacing' => 'one'],
+ 'include' => true,
+ 'new_with_braces' => true,
+ 'no_empty_statement' => true,
+ 'no_extra_consecutive_blank_lines' => true,
+ 'no_leading_import_slash' => true,
+ 'no_leading_namespace_whitespace' => true,
+ 'no_multiline_whitespace_around_double_arrow' => true,
+ 'no_multiline_whitespace_before_semicolons' => true,
+ 'no_singleline_whitespace_before_semicolons' => true,
+ 'no_trailing_comma_in_singleline_array' => true,
+ 'no_unused_imports' => true,
+ 'no_whitespace_in_blank_line' => true,
+ 'object_operator_without_whitespace' => true,
+ 'ordered_imports' => true,
+ 'standardize_not_equals' => true,
+ 'ternary_operator_spaces' => true,
+ ]);
\ No newline at end of file
diff --git a/captainhook.json b/captainhook.json
index 5e15c1a63..19f6ada66 100644
--- a/captainhook.json
+++ b/captainhook.json
@@ -19,7 +19,7 @@
"options": []
},
{
- "action": "vendor/bin/php-cs-fixer fix -q --config-file=.php_cs",
+ "action": "vendor/bin/php-cs-fixer fix -q --config=.php_cs",
"options": []
}
]
diff --git a/composer.json b/composer.json
index 18bea8cbe..f9eb6a347 100644
--- a/composer.json
+++ b/composer.json
@@ -25,7 +25,7 @@
"fzaninotto/faker": "~1.4",
"n98/junit-xml": "~1.0",
"psy/psysh": "~0.7",
- "symfony/console": "~2.3",
+ "symfony/console": "~3.0",
"symfony/event-dispatcher": "~2.3",
"symfony/finder": "~2.3||~3.0",
"symfony/process": "~2.3",
@@ -37,7 +37,7 @@
"require-dev": {
"ext-xdebug": "*",
"bamarni/symfony-console-autocomplete": "^1.2.0",
- "friendsofphp/php-cs-fixer": "~1.12.0",
+ "friendsofphp/php-cs-fixer": "~2.2.1",
"phing/phing": "~2.10.0",
"phpunit/phpunit": "~6.2.0",
"seld/phar-utils": "~1.0.1",
diff --git a/composer.lock b/composer.lock
index 29c81c48f..802c238d8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "580f11aa6c5a7396aa506ea725503fb1",
+ "content-hash": "33db31258860f8c436ffdd23dbc08869",
"packages": [
{
"name": "composer/ca-bundle",
@@ -894,37 +894,45 @@
},
{
"name": "symfony/console",
- "version": "v2.8.47",
+ "version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "48ed63767c4add573fb3e9e127d3426db27f78e8"
+ "reference": "b0878233cb5c4391347e5495089c7af11b8e6201"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/48ed63767c4add573fb3e9e127d3426db27f78e8",
- "reference": "48ed63767c4add573fb3e9e127d3426db27f78e8",
+ "url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201",
+ "reference": "b0878233cb5c4391347e5495089c7af11b8e6201",
"shasum": ""
},
"require": {
- "php": ">=5.3.9",
- "symfony/debug": "^2.7.2|~3.0.0",
+ "php": ">=5.5.9",
+ "symfony/debug": "~2.8|~3.0",
"symfony/polyfill-mbstring": "~1.0"
},
+ "conflict": {
+ "symfony/dependency-injection": "<3.3"
+ },
"require-dev": {
"psr/log": "~1.0",
- "symfony/event-dispatcher": "~2.1|~3.0.0",
- "symfony/process": "~2.1|~3.0.0"
+ "symfony/config": "~3.3",
+ "symfony/dependency-injection": "~3.3",
+ "symfony/event-dispatcher": "~2.8|~3.0",
+ "symfony/filesystem": "~2.8|~3.0",
+ "symfony/http-kernel": "~2.8|~3.0",
+ "symfony/process": "~2.8|~3.0"
},
"suggest": {
- "psr/log-implementation": "For using the console logger",
+ "psr/log": "For using the console logger",
"symfony/event-dispatcher": "",
+ "symfony/filesystem": "",
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.8-dev"
+ "dev-master": "3.3-dev"
}
},
"autoload": {
@@ -951,7 +959,7 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2018-10-30T14:26:34+00:00"
+ "time": "2017-07-29T21:27:59+00:00"
},
{
"name": "symfony/debug",
@@ -1819,6 +1827,74 @@
],
"time": "2018-08-31T19:07:57+00:00"
},
+ {
+ "name": "doctrine/annotations",
+ "version": "v1.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/annotations.git",
+ "reference": "54cacc9b81758b14e3ce750f205a393d52339e97"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97",
+ "reference": "54cacc9b81758b14e3ce750f205a393d52339e97",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/lexer": "1.*",
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "doctrine/cache": "1.*",
+ "phpunit/phpunit": "^5.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Docblock Annotations Parser",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "parser"
+ ],
+ "time": "2017-02-24T16:22:25+00:00"
+ },
{
"name": "doctrine/instantiator",
"version": "1.0.5",
@@ -1873,37 +1949,117 @@
],
"time": "2015-06-14T21:17:01+00:00"
},
+ {
+ "name": "doctrine/lexer",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/lexer.git",
+ "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8",
+ "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.",
+ "homepage": "https://www.doctrine-project.org/projects/lexer.html",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "lexer",
+ "parser",
+ "php"
+ ],
+ "time": "2019-06-08T11:03:04+00:00"
+ },
{
"name": "friendsofphp/php-cs-fixer",
- "version": "v1.12.4",
+ "version": "v2.2.20",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
- "reference": "c5a9d66dd27f02a3ffba4ec451ce27702604cdc8"
+ "reference": "f1631f0747ad2a9dd3de8d7873b71f6573f8d0c2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/c5a9d66dd27f02a3ffba4ec451ce27702604cdc8",
- "reference": "c5a9d66dd27f02a3ffba4ec451ce27702604cdc8",
+ "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/f1631f0747ad2a9dd3de8d7873b71f6573f8d0c2",
+ "reference": "f1631f0747ad2a9dd3de8d7873b71f6573f8d0c2",
"shasum": ""
},
"require": {
+ "composer/semver": "^1.4",
+ "composer/xdebug-handler": "^1.0",
+ "doctrine/annotations": "^1.2",
+ "ext-json": "*",
"ext-tokenizer": "*",
- "php": "^5.3.6 || >=7.0 <7.2",
- "sebastian/diff": "^1.1",
- "symfony/console": "^2.3 || ^3.0",
- "symfony/event-dispatcher": "^2.1 || ^3.0",
- "symfony/filesystem": "^2.1 || ^3.0",
- "symfony/finder": "^2.1 || ^3.0",
- "symfony/process": "^2.3 || ^3.0",
- "symfony/stopwatch": "^2.5 || ^3.0"
+ "php": "^5.3.6 || >=7.0 <7.3",
+ "sebastian/diff": "^1.4",
+ "symfony/console": "^2.4 || ^3.0 || ^4.0",
+ "symfony/event-dispatcher": "^2.1 || ^3.0 || ^4.0",
+ "symfony/filesystem": "^2.4 || ^3.0 || ^4.0",
+ "symfony/finder": "^2.2 || ^3.0 || ^4.0",
+ "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0",
+ "symfony/polyfill-php54": "^1.0",
+ "symfony/polyfill-php55": "^1.3",
+ "symfony/polyfill-php70": "^1.0",
+ "symfony/polyfill-php72": "^1.4",
+ "symfony/process": "^2.3 || ^3.0 || ^4.0",
+ "symfony/stopwatch": "^2.5 || ^3.0 || ^4.0"
},
"conflict": {
- "hhvm": "<3.9"
+ "hhvm": "<3.18"
},
"require-dev": {
- "phpunit/phpunit": "^4.5|^5",
- "satooshi/php-coveralls": "^1.0"
+ "johnkary/phpunit-speedtrap": "^1.0.1 || ^2.0 || ^3.0",
+ "justinrainbow/json-schema": "^5.0",
+ "keradus/cli-executor": "^1.1",
+ "mikey179/vfsstream": "^1.6",
+ "php-coveralls/php-coveralls": "^1.0.2",
+ "phpunit/phpunit": "^4.8.35 || ^5.4.3",
+ "symfony/phpunit-bridge": "^3.2.2 || ^4.0"
+ },
+ "suggest": {
+ "ext-mbstring": "For handling non-UTF8 characters in cache signature.",
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.",
+ "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible."
},
"bin": [
"php-cs-fixer"
@@ -1911,8 +2067,18 @@
"type": "application",
"autoload": {
"psr-4": {
- "Symfony\\CS\\": "Symfony/CS/"
- }
+ "PhpCsFixer\\": "src/"
+ },
+ "classmap": [
+ "tests/Test/AbstractFixerTestCase.php",
+ "tests/Test/AbstractIntegrationCaseFactory.php",
+ "tests/Test/AbstractIntegrationTestCase.php",
+ "tests/Test/IntegrationCase.php",
+ "tests/Test/IntegrationCaseFactory.php",
+ "tests/Test/IntegrationCaseFactoryInterface.php",
+ "tests/Test/InternalIntegrationCaseFactory.php",
+ "tests/TestCase.php"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1929,7 +2095,49 @@
}
],
"description": "A tool to automatically fix PHP code style",
- "time": "2016-11-15T09:10:47+00:00"
+ "time": "2018-06-02T17:26:04+00:00"
+ },
+ {
+ "name": "ircmaxell/password-compat",
+ "version": "v1.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ircmaxell/password_compat.git",
+ "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c",
+ "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c",
+ "shasum": ""
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "lib/password.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Anthony Ferrara",
+ "email": "ircmaxell@php.net",
+ "homepage": "http://blog.ircmaxell.com"
+ }
+ ],
+ "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash",
+ "homepage": "https://github.com/ircmaxell/password_compat",
+ "keywords": [
+ "hashing",
+ "password"
+ ],
+ "time": "2014-11-20T16:49:30+00:00"
},
{
"name": "mikey179/vfsstream",
@@ -2022,6 +2230,51 @@
],
"time": "2017-10-19T19:58:43+00:00"
},
+ {
+ "name": "paragonie/random_compat",
+ "version": "v9.99.99",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/paragonie/random_compat.git",
+ "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
+ "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*|5.*",
+ "vimeo/psalm": "^1"
+ },
+ "suggest": {
+ "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
+ },
+ "type": "library",
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Paragon Initiative Enterprises",
+ "email": "security@paragonie.com",
+ "homepage": "https://paragonie.com"
+ }
+ ],
+ "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
+ "keywords": [
+ "csprng",
+ "polyfill",
+ "pseudorandom",
+ "random"
+ ],
+ "time": "2018-07-02T15:55:56+00:00"
+ },
{
"name": "phar-io/manifest",
"version": "1.0.1",
@@ -3691,6 +3944,288 @@
],
"time": "2018-12-19T11:58:45+00:00"
},
+ {
+ "name": "symfony/options-resolver",
+ "version": "v3.3.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/options-resolver.git",
+ "reference": "ff48982d295bcac1fd861f934f041ebc73ae40f0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/ff48982d295bcac1fd861f934f041ebc73ae40f0",
+ "reference": "ff48982d295bcac1fd861f934f041ebc73ae40f0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\OptionsResolver\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony OptionsResolver Component",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "config",
+ "configuration",
+ "options"
+ ],
+ "time": "2017-04-12T14:14:56+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php54",
+ "version": "v1.13.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php54.git",
+ "reference": "dd1618047426412036e98d159940d58a81fc392c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/dd1618047426412036e98d159940d58a81fc392c",
+ "reference": "dd1618047426412036e98d159940d58a81fc392c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.13-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php54\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ],
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2019-11-27T13:56:44+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php55",
+ "version": "v1.13.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php55.git",
+ "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b0d838f225725e2951af1aafc784d2e5ea7b656e",
+ "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e",
+ "shasum": ""
+ },
+ "require": {
+ "ircmaxell/password-compat": "~1.0",
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.13-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php55\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2019-11-27T13:56:44+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php70",
+ "version": "v1.13.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php70.git",
+ "reference": "af23c7bb26a73b850840823662dda371484926c4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/af23c7bb26a73b850840823662dda371484926c4",
+ "reference": "af23c7bb26a73b850840823662dda371484926c4",
+ "shasum": ""
+ },
+ "require": {
+ "paragonie/random_compat": "~1.0|~2.0|~9.99",
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.13-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php70\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ],
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2019-11-27T13:56:44+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php72",
+ "version": "v1.13.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php72.git",
+ "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/66fea50f6cb37a35eea048d75a7d99a45b586038",
+ "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.13-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php72\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2019-11-27T13:56:44+00:00"
+ },
{
"name": "symfony/stopwatch",
"version": "v3.3.6",
diff --git a/src/N98/Magento/Application.php b/src/N98/Magento/Application.php
index f52123079..6c0865caf 100644
--- a/src/N98/Magento/Application.php
+++ b/src/N98/Magento/Application.php
@@ -45,7 +45,7 @@ class Application extends BaseApplication
/**
* @var string
*/
- const APP_VERSION = '3.2.0';
+ const APP_VERSION = '3.3.0';
/**
* @var int
diff --git a/src/N98/Magento/Application/Config.php b/src/N98/Magento/Application/Config.php
index 508333ff1..e194f14af 100644
--- a/src/N98/Magento/Application/Config.php
+++ b/src/N98/Magento/Application/Config.php
@@ -30,12 +30,12 @@ class Config
/**
* @var array config data
*/
- private $config = array();
+ private $config = [];
/**
* @var array
*/
- private $partialConfig = array();
+ private $partialConfig = [];
/**
* @var ConfigurationLoader
@@ -64,7 +64,7 @@ class Config
* @param bool $isPharMode
* @param OutputInterface $output [optional]
*/
- public function __construct(array $initConfig = array(), $isPharMode = false, OutputInterface $output = null)
+ public function __construct(array $initConfig = [], $isPharMode = false, OutputInterface $output = null)
{
$this->initConfig = $initConfig;
$this->isPharMode = (bool) $isPharMode;
@@ -79,7 +79,7 @@ public function __construct(array $initConfig = array(), $isPharMode = false, Ou
*/
public function checkConfigCommandAlias(InputInterface $input)
{
- foreach ($this->getArray(array('commands', 'aliases')) as $alias) {
+ foreach ($this->getArray(['commands', 'aliases']) as $alias) {
if (!is_array($alias)) {
continue;
}
@@ -110,7 +110,7 @@ public function checkConfigCommandAlias(InputInterface $input)
*/
public function registerConfigCommandAlias(Command $command)
{
- foreach ($this->getArray(array('commands', 'aliases')) as $alias) {
+ foreach ($this->getArray(['commands', 'aliases']) as $alias) {
if (!is_array($alias)) {
continue;
}
@@ -122,7 +122,7 @@ public function registerConfigCommandAlias(Command $command)
continue;
}
- $command->setAliases(array_merge($command->getAliases(), array($aliasCommandName)));
+ $command->setAliases(array_merge($command->getAliases(), [$aliasCommandName]));
}
}
@@ -131,7 +131,7 @@ public function registerConfigCommandAlias(Command $command)
*/
public function registerCustomCommands(Application $application)
{
- foreach ($this->getArray(array('commands', 'customCommands')) as $commandClass) {
+ foreach ($this->getArray(['commands', 'customCommands']) as $commandClass) {
$commandName = null;
if (is_array($commandClass)) {
// Support for key => value (name -> class)
@@ -268,7 +268,7 @@ public function getDetectSubFolders()
return $this->partialConfig['detect']['subFolders'];
}
- return array();
+ return [];
}
/**
@@ -305,7 +305,7 @@ private function debugWriteln($message)
* @param array $default [optional]
* @return array
*/
- private function getArray($key, $default = array())
+ private function getArray($key, $default = [])
{
$result = $this->traverse((array) $key);
if (null === $result) {
diff --git a/src/N98/Magento/Application/ConfigFile.php b/src/N98/Magento/Application/ConfigFile.php
index 59b772893..e500aa7cc 100644
--- a/src/N98/Magento/Application/ConfigFile.php
+++ b/src/N98/Magento/Application/ConfigFile.php
@@ -77,10 +77,10 @@ public function setBuffer($buffer)
*/
public function applyVariables($magentoRootFolder, SplFileInfo $file = null)
{
- $replace = array(
+ $replace = [
'%module%' => $file ? $file->getPath() : '',
'%root%' => $magentoRootFolder,
- );
+ ];
$this->buffer = strtr($this->buffer, $replace);
}
diff --git a/src/N98/Magento/Application/ConfigLocator.php b/src/N98/Magento/Application/ConfigLocator.php
index ce7363c99..9f7067357 100644
--- a/src/N98/Magento/Application/ConfigLocator.php
+++ b/src/N98/Magento/Application/ConfigLocator.php
@@ -122,7 +122,7 @@ public function getStopFileConfigFile($magerunStopFileFolder)
*/
private function getUserConfigFilePaths()
{
- $paths = array();
+ $paths = [];
$homeDirectory = OperatingSystem::getHomeDir();
diff --git a/src/N98/Magento/Application/ConfigurationLoader.php b/src/N98/Magento/Application/ConfigurationLoader.php
index a6153f75c..1e88dd36a 100644
--- a/src/N98/Magento/Application/ConfigurationLoader.php
+++ b/src/N98/Magento/Application/ConfigurationLoader.php
@@ -188,7 +188,7 @@ public function loadSystemConfig(array $config)
$this->logDebug('Load system config ' . $systemWideConfigFile . '');
$this->_systemConfig = Yaml::parse($systemWideConfigFile);
} else {
- $this->_systemConfig = array();
+ $this->_systemConfig = [];
}
}
@@ -208,8 +208,8 @@ public function loadSystemConfig(array $config)
public function loadPluginConfig(array $config, $magentoRootFolder)
{
if ($this->_pluginConfig == null) {
- $this->_pluginConfig = array();
- $moduleBaseFolders = array();
+ $this->_pluginConfig = [];
+ $moduleBaseFolders = [];
$customFilename = $this->_customConfigFilename;
$customName = pathinfo($customFilename, PATHINFO_FILENAME);
if (OperatingSystem::isWindows()) {
@@ -276,10 +276,10 @@ public function loadPluginConfig(array $config, $magentoRootFolder)
*/
protected function applyVariables($rawConfig, $magentoRootFolder, SplFileInfo $file = null)
{
- $replace = array(
+ $replace = [
'%module%' => $file ? $file->getPath() : '',
'%root%' => $magentoRootFolder,
- );
+ ];
return str_replace(array_keys($replace), $replace, $rawConfig);
}
@@ -295,7 +295,7 @@ protected function applyVariables($rawConfig, $magentoRootFolder, SplFileInfo $f
public function loadUserConfig(array $config, $magentoRootFolder = null)
{
if (null === $this->_userConfig) {
- $this->_userConfig = array();
+ $this->_userConfig = [];
$locator = new ConfigLocator($this->_customConfigFilename, $magentoRootFolder);
if ($userConfigFile = $locator->getUserConfigFile()) {
$this->_userConfig = $userConfigFile->toArray();
@@ -322,7 +322,7 @@ public function loadProjectConfig($magentoRootFolder, $magerunStopFileFolder, ar
return ArrayFunctions::mergeArrays($config, $this->_projectConfig);
}
- $this->_projectConfig = array();
+ $this->_projectConfig = [];
$locator = new ConfigLocator($this->_customConfigFilename, $magentoRootFolder);
diff --git a/src/N98/Magento/Application/Console/EventSubscriber/CheckRootUser.php b/src/N98/Magento/Application/Console/EventSubscriber/CheckRootUser.php
index d355c5244..4b476f037 100644
--- a/src/N98/Magento/Application/Console/EventSubscriber/CheckRootUser.php
+++ b/src/N98/Magento/Application/Console/EventSubscriber/CheckRootUser.php
@@ -25,9 +25,9 @@ class CheckRootUser implements EventSubscriberInterface
*/
public static function getSubscribedEvents()
{
- return array(
+ return [
Events::RUN_BEFORE => 'checkRunningAsRootUser',
- );
+ ];
}
/**
@@ -51,11 +51,11 @@ public function checkRunningAsRootUser(Event $event)
if (OperatingSystem::isRoot()) {
$output = $event->getOutput();
- $output->writeln(array(
+ $output->writeln([
'',
self::WARNING_ROOT_USER,
'',
- ));
+ ]);
}
}
diff --git a/src/N98/Magento/Application/DetectionResult.php b/src/N98/Magento/Application/DetectionResult.php
index 57f44ec66..2a26b8125 100644
--- a/src/N98/Magento/Application/DetectionResult.php
+++ b/src/N98/Magento/Application/DetectionResult.php
@@ -33,7 +33,7 @@ class DetectionResult implements DetectionResultInterface
* @param string $folder
* @param array $subFolders
*/
- public function __construct(MagentoHelper $helper, $folder, array $subFolders = array())
+ public function __construct(MagentoHelper $helper, $folder, array $subFolders = [])
{
$this->helper = $helper;
$this->detected = $helper->detect($folder, $subFolders); // @TODO Constructor should not run "detect" method
diff --git a/src/N98/Magento/Command/AbstractMagentoCommand.php b/src/N98/Magento/Command/AbstractMagentoCommand.php
index 20beb3067..b531f0964 100644
--- a/src/N98/Magento/Command/AbstractMagentoCommand.php
+++ b/src/N98/Magento/Command/AbstractMagentoCommand.php
@@ -56,12 +56,12 @@ abstract class AbstractMagentoCommand extends Command
/**
* @var array
*/
- protected $_deprecatedAlias = array();
+ protected $_deprecatedAlias = [];
/**
* @var array
*/
- protected $_websiteCodeMap = array();
+ protected $_websiteCodeMap = [];
/**
* @var ObjectManager
@@ -117,11 +117,11 @@ protected function writeSection(OutputInterface $output, $text, $style = 'bg=blu
/** @var $formatter FormatterHelper */
$formatter = $this->getHelper('formatter');
- $output->writeln(array(
+ $output->writeln([
'',
$formatter->formatBlock($text, $style, true),
'',
- ));
+ ]);
}
/**
@@ -266,7 +266,7 @@ protected function checkRepository(PackageInterface $package, $targetFolder)
*/
public function isSourceTypeRepository($type)
{
- return in_array($type, array('git', 'hg'));
+ return in_array($type, ['git', 'hg']);
}
/**
@@ -280,11 +280,11 @@ public function isSourceTypeRepository($type)
public function getComposer(InputInterface $input, OutputInterface $output)
{
$io = new ConsoleIO($input, $output, $this->getHelperSet());
- $config = array(
- 'config' => array(
+ $config = [
+ 'config' => [
'secure-http' => false,
- ),
- );
+ ],
+ ];
return ComposerFactory::create($io, $config);
}
@@ -321,7 +321,7 @@ protected function checkDeprecatedAliases(InputInterface $input, OutputInterface
*/
protected function _parseBoolOption($value)
{
- return in_array(strtolower($value), array('y', 'yes', 1, 'true'));
+ return in_array(strtolower($value), ['y', 'yes', 1, 'true']);
}
/**
@@ -339,7 +339,7 @@ public function parseBoolOption($value)
*/
public function formatActive($value)
{
- if (in_array($value, array(1, 'true'))) {
+ if (in_array($value, [1, 'true'])) {
return 'active';
}
@@ -400,7 +400,7 @@ protected function createSubCommandFactory(
$commandConfig = $this->getCommandConfig();
if (empty($commandConfig)) {
- $commandConfig = array();
+ $commandConfig = [];
}
return new SubCommandFactory(
diff --git a/src/N98/Magento/Command/AbstractMagentoStoreConfigCommand.php b/src/N98/Magento/Command/AbstractMagentoStoreConfigCommand.php
index f81631e09..41375672e 100644
--- a/src/N98/Magento/Command/AbstractMagentoStoreConfigCommand.php
+++ b/src/N98/Magento/Command/AbstractMagentoStoreConfigCommand.php
@@ -82,8 +82,7 @@ protected function configure()
->setName($this->commandName)
->addOption('on', null, InputOption::VALUE_NONE, 'Switch on')
->addOption('off', null, InputOption::VALUE_NONE, 'Switch off')
- ->setDescription($this->commandDescription)
- ;
+ ->setDescription($this->commandDescription);
if ($this->scope == self::SCOPE_STORE_VIEW_GLOBAL) {
$this->addOption('global', null, InputOption::VALUE_NONE, 'Set value on default scope');
diff --git a/src/N98/Magento/Command/Admin/User/ChangePasswordCommand.php b/src/N98/Magento/Command/Admin/User/ChangePasswordCommand.php
index dd736d541..bc93a7fb5 100644
--- a/src/N98/Magento/Command/Admin/User/ChangePasswordCommand.php
+++ b/src/N98/Magento/Command/Admin/User/ChangePasswordCommand.php
@@ -16,8 +16,7 @@ protected function configure()
->setName('admin:user:change-password')
->addArgument('username', InputArgument::OPTIONAL, 'Username')
->addArgument('password', InputArgument::OPTIONAL, 'Password')
- ->setDescription('Changes the password of a adminhtml user.')
- ;
+ ->setDescription('Changes the password of a adminhtml user.');
}
/**
diff --git a/src/N98/Magento/Command/Admin/User/DeleteUserCommand.php b/src/N98/Magento/Command/Admin/User/DeleteUserCommand.php
index 7520f978c..47cb45ab7 100644
--- a/src/N98/Magento/Command/Admin/User/DeleteUserCommand.php
+++ b/src/N98/Magento/Command/Admin/User/DeleteUserCommand.php
@@ -22,8 +22,7 @@ protected function configure()
->setName('admin:user:delete')
->addArgument('id', InputArgument::OPTIONAL, 'Username or Email')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force')
- ->setDescription('Delete the account of a adminhtml user.')
- ;
+ ->setDescription('Delete the account of a adminhtml user.');
}
/**
diff --git a/src/N98/Magento/Command/Admin/User/ListCommand.php b/src/N98/Magento/Command/Admin/User/ListCommand.php
index 3b1349ea9..6620ea60e 100644
--- a/src/N98/Magento/Command/Admin/User/ListCommand.php
+++ b/src/N98/Magento/Command/Admin/User/ListCommand.php
@@ -19,8 +19,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
/**
@@ -37,17 +36,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$userList = $this->userModel->getCollection();
- $table = array();
+ $table = [];
foreach ($userList as $user) {
- $table[] = array(
+ $table[] = [
$user->getId(),
$user->getUsername(),
$user->getEmail(),
$user->getIsActive() ? 'active' : 'inactive',
- );
+ ];
}
$this->getHelper('table')
- ->setHeaders(array('id', 'username', 'email', 'status'))
+ ->setHeaders(['id', 'username', 'email', 'status'])
->renderByFormat($output, $table, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/Cache/CleanCommand.php b/src/N98/Magento/Command/Cache/CleanCommand.php
index 95f726d44..edb939895 100644
--- a/src/N98/Magento/Command/Cache/CleanCommand.php
+++ b/src/N98/Magento/Command/Cache/CleanCommand.php
@@ -13,8 +13,7 @@ protected function configure()
$this
->setName('cache:clean')
->addArgument('type', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Cache type code like "config"')
- ->setDescription('Clean magento cache')
- ;
+ ->setDescription('Clean magento cache');
$help = <<clean(array($type));
+ $cacheManager->clean([$type]);
$eventManager->dispatch('adminhtml_cache_refresh_type', ['type' => $type]);
$output->writeln('' . $type . ' cache cleaned');
}
diff --git a/src/N98/Magento/Command/Cache/DisableCommand.php b/src/N98/Magento/Command/Cache/DisableCommand.php
index e0cb67097..861b09fc7 100644
--- a/src/N98/Magento/Command/Cache/DisableCommand.php
+++ b/src/N98/Magento/Command/Cache/DisableCommand.php
@@ -33,7 +33,6 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
}
diff --git a/src/N98/Magento/Command/Cache/FlushCommand.php b/src/N98/Magento/Command/Cache/FlushCommand.php
index 91accef0f..f7f4164c3 100644
--- a/src/N98/Magento/Command/Cache/FlushCommand.php
+++ b/src/N98/Magento/Command/Cache/FlushCommand.php
@@ -13,8 +13,7 @@ protected function configure()
$this
->setName('cache:flush')
->addArgument('type', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Cache type code like "config"')
- ->setDescription('Flush magento cache storage')
- ;
+ ->setDescription('Flush magento cache storage');
}
/**
@@ -37,11 +36,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
$eventManager->dispatch('adminhtml_cache_flush_all');
$typesToClean = $input->getArgument('type');
-
+
$availableTypes = $cacheManager->getAvailableTypes();
foreach ($availableTypes as $cacheType) {
if (count($typesToClean) == 0 || in_array($cacheType, $typesToClean)) {
- $cacheManager->flush(array($cacheType));
+ $cacheManager->flush([$cacheType]);
$output->writeln('' . $cacheType . ' cache flushed');
}
}
diff --git a/src/N98/Magento/Command/Cache/ListCommand.php b/src/N98/Magento/Command/Cache/ListCommand.php
index af1fef602..2d7893858 100644
--- a/src/N98/Magento/Command/Cache/ListCommand.php
+++ b/src/N98/Magento/Command/Cache/ListCommand.php
@@ -40,8 +40,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
public function inject(
@@ -82,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$this->getHelper('table')
- ->setHeaders(array('Name', 'Type', 'Enabled'))
+ ->setHeaders(['Name', 'Type', 'Enabled'])
->renderByFormat($output, $tableData, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/ComposerWrapper/EventSubscriber.php b/src/N98/Magento/Command/ComposerWrapper/EventSubscriber.php
index d89343bc0..527223f89 100644
--- a/src/N98/Magento/Command/ComposerWrapper/EventSubscriber.php
+++ b/src/N98/Magento/Command/ComposerWrapper/EventSubscriber.php
@@ -18,7 +18,7 @@ class EventSubscriber implements EventSubscriberInterface
*/
public static function getSubscribedEvents()
{
- return array('console.command' => 'registerComposer');
+ return ['console.command' => 'registerComposer'];
}
/**
diff --git a/src/N98/Magento/Command/Config/AbstractConfigCommand.php b/src/N98/Magento/Command/Config/AbstractConfigCommand.php
index 9c062b869..b1dc1e056 100644
--- a/src/N98/Magento/Command/Config/AbstractConfigCommand.php
+++ b/src/N98/Magento/Command/Config/AbstractConfigCommand.php
@@ -22,7 +22,7 @@ abstract class AbstractConfigCommand extends AbstractMagentoCommand
/**
* @var array
*/
- protected $_scopes = array();
+ protected $_scopes = [];
/**
* @return \Magento\Framework\Encryption\EncryptorInterface
@@ -125,7 +125,7 @@ protected function _validateScopeParam($scope)
*/
protected function _convertScopeIdParam($scope, $scopeId)
{
- if (null === $scopeId && in_array($scope, array('websites', 'stores'), true)) {
+ if (null === $scopeId && in_array($scope, ['websites', 'stores'], true)) {
return $scopeId;
}
diff --git a/src/N98/Magento/Command/Config/Data/AclCommand.php b/src/N98/Magento/Command/Config/Data/AclCommand.php
index 086675a66..0a9752911 100644
--- a/src/N98/Magento/Command/Config/Data/AclCommand.php
+++ b/src/N98/Magento/Command/Config/Data/AclCommand.php
@@ -19,8 +19,7 @@ protected function configure()
{
$this
->setName('config:data:acl')
- ->setDescription('Prints acl.xml data as table')
- ;
+ ->setDescription('Prints acl.xml data as table');
}
/**
diff --git a/src/N98/Magento/Command/Config/Data/DiCommand.php b/src/N98/Magento/Command/Config/Data/DiCommand.php
index 69366a218..358918fd7 100644
--- a/src/N98/Magento/Command/Config/Data/DiCommand.php
+++ b/src/N98/Magento/Command/Config/Data/DiCommand.php
@@ -25,8 +25,7 @@ protected function configure()
'Config scope (global, adminhtml, frontend, webapi_rest, webapi_soap, ...)',
'global'
)
- ->setDescription('Dump dependency injection config')
- ;
+ ->setDescription('Dump dependency injection config');
}
/**
diff --git a/src/N98/Magento/Command/Config/Store/DeleteCommand.php b/src/N98/Magento/Command/Config/Store/DeleteCommand.php
index 59ac8b273..cd41666a1 100644
--- a/src/N98/Magento/Command/Config/Store/DeleteCommand.php
+++ b/src/N98/Magento/Command/Config/Store/DeleteCommand.php
@@ -20,11 +20,11 @@ class DeleteCommand extends AbstractConfigCommand
/**
* @var array
*/
- protected $_scopes = array(
+ protected $_scopes = [
'default',
'websites',
'stores',
- );
+ ];
protected function configure()
{
@@ -40,8 +40,7 @@ protected function configure()
'default'
)
->addOption('scope-id', null, InputOption::VALUE_OPTIONAL, 'The config value\'s scope ID')
- ->addOption('all', null, InputOption::VALUE_NONE, 'Delete all entries by path')
- ;
+ ->addOption('all', null, InputOption::VALUE_NONE, 'Delete all entries by path');
$help = <<_validateScopeParam($input->getOption('scope'));
$scopeId = $this->_convertScopeIdParam($input->getOption('scope'), $input->getOption('scope-id'));
- $deleted = array();
+ $deleted = [];
$paths = $this->resolvePaths($input->getArgument('path'), $scopeId);
@@ -86,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (count($deleted) > 0) {
$this->getHelper('table')
- ->setHeaders(array('deleted path', 'scope', 'id'))
+ ->setHeaders(['deleted path', 'scope', 'id'])
->setRows($deleted)
->render($output);
}
@@ -101,12 +100,12 @@ private function resolvePaths($path, $scopeId)
return (array) $path;
}
- $paths = array();
+ $paths = [];
$collection = clone $this->collection;
$searchPath = str_replace('*', '%', $path);
- $collection->addFieldToFilter('path', array('like' => $searchPath));
+ $collection->addFieldToFilter('path', ['like' => $searchPath]);
if ($scopeId) {
$collection->addFieldToFilter('scope_id', $scopeId);
@@ -137,18 +136,18 @@ protected function _deletePath(
$path,
$scopeId
) {
- $deleted = array();
+ $deleted = [];
if ($input->getOption('all')) {
$storeManager = $this->getObjectManager()->get('Magento\Store\Model\StoreManager');
// Delete default
$this->delete($configWriter, $deleted, $path, 'default', 0);
- $deleted[] = array(
+ $deleted[] = [
'path' => $path,
'scope' => 'default',
'scopeId' => 0,
- );
+ ];
// Delete websites
foreach ($storeManager->getWebsites() as $website) {
@@ -172,11 +171,11 @@ private function delete(WriterInterface $configWriter, &$deleted, $path, $scope,
{
$configWriter->delete($path, $scope, $scopeId);
- $deleted[] = array(
+ $deleted[] = [
'path' => $path,
'scope' => $scope,
'scopeId' => $scopeId,
- );
+ ];
}
/**
@@ -188,24 +187,24 @@ private function delete(WriterInterface $configWriter, &$deleted, $path, $scope,
*/
private function resolveScopeIds($path, $scope, $scopeId)
{
- $result = array();
+ $result = [];
if ($scopeId !== null) {
- $result[] = array($path, $scope, $scopeId);
+ $result[] = [$path, $scope, $scopeId];
return $result;
}
$collection = clone $this->collection;
- $collection->addFieldToFilter('path', array('eq' => $path));
- $collection->addFieldToFilter('scope', array('eq' => $scope));
+ $collection->addFieldToFilter('path', ['eq' => $path]);
+ $collection->addFieldToFilter('scope', ['eq' => $scope]);
$collection->addOrder('scope_id', 'ASC');
$collection->clear();
foreach ($collection as $item) {
- $result[] = array($item->getPath(), $item->getScope(), $item->getScopeId());
+ $result[] = [$item->getPath(), $item->getScope(), $item->getScopeId()];
}
return $result;
diff --git a/src/N98/Magento/Command/Config/Store/GetCommand.php b/src/N98/Magento/Command/Config/Store/GetCommand.php
index a2114fb93..ed7f270b8 100644
--- a/src/N98/Magento/Command/Config/Store/GetCommand.php
+++ b/src/N98/Magento/Command/Config/Store/GetCommand.php
@@ -85,18 +85,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
$searchPath .= '*';
}
- $collection->addFieldToFilter('path', array(
+ $collection->addFieldToFilter('path', [
'like' => str_replace('*', '%', $searchPath),
- ));
+ ]);
if ($scope = $input->getOption('scope')) {
- $collection->addFieldToFilter('scope', array('eq' => $scope));
+ $collection->addFieldToFilter('scope', ['eq' => $scope]);
}
if (strlen($scopeId = $input->getOption('scope-id'))) {
$collection->addFieldToFilter(
'scope_id',
- array('eq' => $scopeId)
+ ['eq' => $scopeId]
);
}
@@ -115,7 +115,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
foreach ($collection as $item) {
- $table[] = array(
+ $table[] = [
'path' => $item->getPath(),
'scope' => $item->getScope(),
'scope_id' => $item->getScopeId(),
@@ -123,7 +123,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$item->getValue(),
$input->getOption('decrypt') ? 'decrypt' : ''
),
- );
+ ];
}
ksort($table);
@@ -144,20 +144,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
*/
protected function renderAsTable(OutputInterface $output, $table, $format)
{
- $formattedTable = array();
+ $formattedTable = [];
foreach ($table as $row) {
- $formattedTable[] = array(
+ $formattedTable[] = [
$row['path'],
$row['scope'],
$row['scope_id'],
$this->renderTableValue($row['value'], $format),
- );
+ ];
}
/* @var $tableHelper \N98\Util\Console\Helper\TableHelper */
$tableHelper = $this->getHelper('table');
$tableHelper
- ->setHeaders(array('Path', 'Scope', 'Scope-ID', 'Value'))
+ ->setHeaders(['Path', 'Scope', 'Scope-ID', 'Value'])
->setRows($formattedTable)
->renderByFormat($output, $formattedTable, $format);
}
@@ -227,7 +227,7 @@ protected function renderAsMagerunScript(OutputInterface $output, $table)
foreach ($table as $row) {
$value = $row['value'];
if ($value !== null) {
- $value = str_replace(array("\n", "\r"), array('\n', '\r'), $value);
+ $value = str_replace(["\n", "\r"], ['\n', '\r'], $value);
}
$disaplayValue = $value === null ? 'NULL' : escapeshellarg($value);
diff --git a/src/N98/Magento/Command/Config/Store/SetCommand.php b/src/N98/Magento/Command/Config/Store/SetCommand.php
index 8a7807b4f..3d56a73e8 100644
--- a/src/N98/Magento/Command/Config/Store/SetCommand.php
+++ b/src/N98/Magento/Command/Config/Store/SetCommand.php
@@ -13,11 +13,11 @@ class SetCommand extends AbstractConfigCommand
/**
* @var array
*/
- protected $_scopes = array(
+ protected $_scopes = [
'default',
'websites',
'stores',
- );
+ ];
protected function configure()
{
@@ -45,8 +45,7 @@ protected function configure()
null,
InputOption::VALUE_NONE,
'Do not treat value NULL as ' . self::DISPLAY_NULL_UNKNOWN_VALUE . ' value'
- )
- ;
+ );
$help = <<_formatValue($value, ($input->getOption('encrypt') ? 'encrypt' : ''));
}
diff --git a/src/N98/Magento/Command/Customer/ChangePasswordCommand.php b/src/N98/Magento/Command/Customer/ChangePasswordCommand.php
index cd632afcd..509d2d819 100644
--- a/src/N98/Magento/Command/Customer/ChangePasswordCommand.php
+++ b/src/N98/Magento/Command/Customer/ChangePasswordCommand.php
@@ -42,8 +42,7 @@ protected function configure()
->addArgument('email', InputArgument::OPTIONAL, 'Email')
->addArgument('password', InputArgument::OPTIONAL, 'Password')
->addArgument('website', InputArgument::OPTIONAL, 'Website of the customer')
- ->setDescription('Changes the password of a customer.')
- ;
+ ->setDescription('Changes the password of a customer.');
$help = <<getOption('format') === null;
- $table = array();
+ $table = [];
$isError = false;
if (!$customer->getId()) {
@@ -121,12 +121,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
)
);
} else {
- $table[] = array(
+ $table[] = [
$email,
$password,
$firstname,
$lastname,
- );
+ ];
}
} catch (\Exception $e) {
$isError = true;
@@ -138,7 +138,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (!$outputPlain) {
$this->getHelper('table')
- ->setHeaders(array('email', 'password', 'firstname', 'lastname'))
+ ->setHeaders(['email', 'password', 'firstname', 'lastname'])
->renderByFormat($output, $table, $input->getOption('format'));
}
diff --git a/src/N98/Magento/Command/Customer/InfoCommand.php b/src/N98/Magento/Command/Customer/InfoCommand.php
index 8f738182b..963fa0af6 100644
--- a/src/N98/Magento/Command/Customer/InfoCommand.php
+++ b/src/N98/Magento/Command/Customer/InfoCommand.php
@@ -15,10 +15,10 @@ class InfoCommand extends AbstractCustomerCommand
/**
* @var array
*/
- protected $blacklist = array(
+ protected $blacklist = [
'password_hash',
'increment_id',
- );
+ ];
protected function configure()
{
diff --git a/src/N98/Magento/Command/Database/AbstractDatabaseCommand.php b/src/N98/Magento/Command/Database/AbstractDatabaseCommand.php
index 9499894fe..0eb2eb028 100644
--- a/src/N98/Magento/Command/Database/AbstractDatabaseCommand.php
+++ b/src/N98/Magento/Command/Database/AbstractDatabaseCommand.php
@@ -82,7 +82,7 @@ public function __get($name)
*/
protected function getCompressionHelp()
{
- $messages = array();
+ $messages = [];
$messages[] = '';
$messages[] = 'Compression option';
$messages[] = ' Supported compression: gzip';
diff --git a/src/N98/Magento/Command/Database/AbstractShowCommand.php b/src/N98/Magento/Command/Database/AbstractShowCommand.php
index 9fd05173d..78efd72b5 100644
--- a/src/N98/Magento/Command/Database/AbstractShowCommand.php
+++ b/src/N98/Magento/Command/Database/AbstractShowCommand.php
@@ -26,21 +26,21 @@ abstract class AbstractShowCommand extends AbstractDatabaseCommand
/**
* @var array
*/
- protected $_importantVars = array();
+ protected $_importantVars = [];
/**
* Key = variable name => value method name in this class
*
* @var array
*/
- protected $_specialFormat = array();
+ protected $_specialFormat = [];
/**
* Contains all variables
*
* @var array
*/
- protected $_allVariables = array();
+ protected $_allVariables = [];
protected function configure()
{
@@ -93,7 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
reset($this->_importantVars);
$hasDescription = isset($this->_importantVars[key($this->_importantVars)]['desc']) &&
false === $this->_input->getOption('no-description');
- $header = array('Variable Name', 'Value');
+ $header = ['Variable Name', 'Value'];
if (true === $hasDescription) {
$header[] = 'Description';
}
@@ -109,10 +109,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
*/
protected function generateRows(array $outputVars, $hasDescription)
{
- $rows = array();
+ $rows = [];
$i = 0;
foreach ($outputVars as $name => $value) {
- $rows[$i] = array($name, $value);
+ $rows[$i] = [$name, $value];
if (
true === $hasDescription &&
isset($this->_importantVars[$name]['desc'])
@@ -198,7 +198,7 @@ protected function formatVariables(array $vars)
if (isset($this->_specialFormat[$k])) {
$formatter = $this->_specialFormat[$k];
if (is_string($formatter) && method_exists($this, $formatter)) {
- $formatter = array($this, $formatter);
+ $formatter = [$this, $formatter];
}
$v = call_user_func($formatter, $v);
}
diff --git a/src/N98/Magento/Command/Database/Compressor/AbstractCompressor.php b/src/N98/Magento/Command/Database/Compressor/AbstractCompressor.php
index 9f1ce28c1..2ad59b10a 100644
--- a/src/N98/Magento/Command/Database/Compressor/AbstractCompressor.php
+++ b/src/N98/Magento/Command/Database/Compressor/AbstractCompressor.php
@@ -17,11 +17,11 @@ public static function create($type)
switch ($type) {
case null:
case 'none':
- return new Uncompressed;
+ return new Uncompressed();
case 'gz':
case 'gzip':
- return new Gzip;
+ return new Gzip();
default:
throw new InvalidArgumentException("Compression type '{$type}' is not supported.");
diff --git a/src/N98/Magento/Command/Database/ConsoleCommand.php b/src/N98/Magento/Command/Database/ConsoleCommand.php
index 24ec891a4..8ddc0aa26 100644
--- a/src/N98/Magento/Command/Database/ConsoleCommand.php
+++ b/src/N98/Magento/Command/Database/ConsoleCommand.php
@@ -12,9 +12,8 @@ protected function configure()
parent::configure();
$this
->setName('db:console')
- ->setAliases(array('mysql-client'))
- ->setDescription('Opens mysql client by database config from env.php')
- ;
+ ->setAliases(['mysql-client'])
+ ->setDescription('Opens mysql client by database config from env.php');
}
/**
@@ -27,15 +26,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$this->detectDbSettings($output);
- $descriptorSpec = array(
+ $descriptorSpec = [
0 => STDIN,
1 => STDOUT,
2 => STDERR,
- );
+ ];
$exec = 'mysql ' . $this->getHelper('database')->getMysqlClientToolConnectionString();
- $pipes = array();
+ $pipes = [];
$process = proc_open($exec, $descriptorSpec, $pipes);
if (is_resource($process)) {
diff --git a/src/N98/Magento/Command/Database/CreateCommand.php b/src/N98/Magento/Command/Database/CreateCommand.php
index 6fbea38f5..42f00da5e 100644
--- a/src/N98/Magento/Command/Database/CreateCommand.php
+++ b/src/N98/Magento/Command/Database/CreateCommand.php
@@ -12,8 +12,7 @@ protected function configure()
parent::configure();
$this
->setName('db:create')
- ->setDescription('Create currently configured database')
- ;
+ ->setDescription('Create currently configured database');
$help = <<getTableDefinitions();
- $list = array();
+ $list = [];
$maxNameLen = 0;
foreach ($definitions as $id => $definition) {
$name = '@' . $id;
@@ -191,7 +191,7 @@ public function getTableDefinitionHelp()
if ($nameLen > $maxNameLen) {
$maxNameLen = $nameLen;
}
- $list[] = array($name, $description);
+ $list[] = [$name, $description];
}
$decrSize = 78 - $maxNameLen - 3;
@@ -201,7 +201,7 @@ public function getTableDefinitionHelp()
$delta = max(0, $maxNameLen - strlen($name));
$spacer = $delta ? str_repeat(' ', $delta) : '';
$buffer = wordwrap($description, $decrSize);
- $buffer = strtr($buffer, array("\n" => "\n" . str_repeat(' ', 3 + $maxNameLen)));
+ $buffer = strtr($buffer, ["\n" => "\n" . str_repeat(' ', 3 + $maxNameLen)]);
$messages .= sprintf(" %s%s %s\n", $name, $spacer, $buffer);
}
@@ -321,7 +321,7 @@ private function runExecs(Execs $execs, InputInterface $input, OutputInterface $
);
}
- $commands = $input->getOption('dry-run') ? array() : $execs->getCommands();
+ $commands = $input->getOption('dry-run') ? [] : $execs->getCommands();
foreach ($commands as $command) {
if (!$this->runExec($command, $input, $output)) {
@@ -374,7 +374,7 @@ private function runExec($command, InputInterface $input, OutputInterface $outpu
private function stripTables(InputInterface $input, OutputInterface $output)
{
if (!$input->getOption('strip')) {
- return array();
+ return [];
}
$stripTables = $this->resolveDatabaseTables($input->getOption('strip'));
@@ -397,7 +397,7 @@ private function stripTables(InputInterface $input, OutputInterface $output)
private function excludeTables(InputInterface $input, OutputInterface $output)
{
if (!$input->getOption('exclude')) {
- return array();
+ return [];
}
$excludeTables = $this->resolveDatabaseTables($input->getOption('exclude'));
@@ -515,12 +515,12 @@ private function getFileNamePrefixSuffix($optionAddTime = null)
$namePrefix = '';
$nameSuffix = '';
if ($optionAddTime === null) {
- return array($namePrefix, $nameSuffix);
+ return [$namePrefix, $nameSuffix];
}
$timeStamp = date('Y-m-d_His');
- if (in_array($optionAddTime, array('suffix', true), true)) {
+ if (in_array($optionAddTime, ['suffix', true], true)) {
$nameSuffix = '_' . $timeStamp;
} elseif ($optionAddTime === 'prefix') {
$namePrefix = $timeStamp . '_';
@@ -533,7 +533,7 @@ private function getFileNamePrefixSuffix($optionAddTime = null)
);
}
- return array($namePrefix, $nameSuffix);
+ return [$namePrefix, $nameSuffix];
}
/**
diff --git a/src/N98/Magento/Command/Database/InfoCommand.php b/src/N98/Magento/Command/Database/InfoCommand.php
index be20a35a6..0383c9900 100644
--- a/src/N98/Magento/Command/Database/InfoCommand.php
+++ b/src/N98/Magento/Command/Database/InfoCommand.php
@@ -24,8 +24,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
$this->addDeprecatedAlias('database:info', 'Please use db:info');
$help = <<detectDbSettings($output);
- $settings = array();
+ $settings = [];
foreach ($this->dbSettings as $key => $value) {
if (is_array($value)) {
if (OutputInterface::VERBOSITY_DEBUG <= $output->getVerbosity()) {
@@ -99,9 +98,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$mysqlCliString = 'mysql ' . $database->getMysqlClientToolConnectionString();
$settings['MySQL-Cli-String'] = $mysqlCliString;
- $rows = array();
+ $rows = [];
foreach ($settings as $settingName => $settingValue) {
- $rows[] = array($settingName, $settingValue);
+ $rows[] = [$settingName, $settingValue];
}
if (($settingArgument = $input->getArgument('setting')) !== null) {
@@ -111,7 +110,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln((string) $settings[$settingArgument]);
} else {
$this->getHelper('table')
- ->setHeaders(array('Name', 'Value'))
+ ->setHeaders(['Name', 'Value'])
->renderByFormat($output, $rows, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php b/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php
index 8ae5e44ab..66fdda2ab 100644
--- a/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php
+++ b/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php
@@ -137,16 +137,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->showProgress = $input->getOption('format') == null;
if ($input->getOption('table')) {
- $resolvedTables = array(
+ $resolvedTables = [
$this->dbHelper->resolveTables(
- array('@check'),
- array(
- 'check' => array(
- 'tables' => array($input->getOption('table')),
- ),
- )
+ ['@check'],
+ [
+ 'check' => [
+ 'tables' => [$input->getOption('table')],
+ ],
+ ]
),
- );
+ ];
$tables = $resolvedTables[0];
} else {
$tables = $this->dbHelper->getTables();
@@ -154,30 +154,30 @@ protected function execute(InputInterface $input, OutputInterface $output)
$allTableStatus = $this->dbHelper->getTablesStatus();
- $tableOutput = array();
+ $tableOutput = [];
/** @var \Symfony\Component\Console\Helper\ProgressHelper $progress */
$progress = $this->getHelper('progress');
if ($this->showProgress) {
$progress->start($output, count($tables));
}
- $methods = array(
+ $methods = [
'InnoDB' => 1,
'MEMORY' => 1,
'MyISAM' => 1,
- );
+ ];
foreach ($tables as $tableName) {
if (isset($allTableStatus[$tableName]) && isset($methods[$allTableStatus[$tableName]['Engine']])) {
$m = '_check' . $allTableStatus[$tableName]['Engine'];
$tableOutput = array_merge($tableOutput, $this->$m($tableName));
} else {
- $tableOutput[] = array(
+ $tableOutput[] = [
'table' => $tableName,
'operation' => 'not supported',
'type' => '',
'status' => '',
- );
+ ];
}
$this->progressAdvance();
}
@@ -187,7 +187,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$this->getHelper('table')
- ->setHeaders(array('Table', 'Operation', 'Type', 'Status'))
+ ->setHeaders(['Table', 'Operation', 'Type', 'Status'])
->renderByFormat($this->output, $tableOutput, $this->input->getOption('format'));
}
@@ -205,13 +205,13 @@ protected function _queryAlterTable($tableName, $engine)
$start = microtime(true);
$affectedRows = $connection->exec(sprintf('ALTER TABLE %s ENGINE=%s', $tableName, $engine));
- return array(array(
+ return [[
'table' => $tableName,
'operation' => 'ENGINE ' . $engine,
'type' => sprintf('%15s rows', (string) $affectedRows),
'status' => sprintf('%.3f secs', microtime(true) - $start),
- ),
- );
+ ],
+ ];
}
/**
@@ -244,31 +244,31 @@ protected function _checkMEMORY($tableName)
*/
protected function _checkMyISAM($tableName)
{
- $table = array();
+ $table = [];
$type = $this->input->getOption('type');
$result = $this->_query(sprintf('CHECK TABLE %s %s', $tableName, $type));
if ($result['Msg_text'] == self::MESSAGE_CHECK_NOT_SUPPORTED) {
- return array();
+ return [];
}
- $table[] = array(
+ $table[] = [
'table' => $tableName,
'operation' => $result['Op'],
'type' => $type,
'status' => $result['Msg_text'],
- );
+ ];
if ($result['Msg_text'] != 'OK'
&& $this->input->getOption('repair')
) {
$result = $this->_query(sprintf('REPAIR TABLE %s %s', $tableName, $type));
if ($result['Msg_text'] != self::MESSAGE_REPAIR_NOT_SUPPORTED) {
- $table[] = array(
+ $table[] = [
'table' => $tableName,
'operation' => $result['Op'],
'type' => $type,
'status' => $result['Msg_text'],
- );
+ ];
}
}
return $table;
diff --git a/src/N98/Magento/Command/Database/QueryCommand.php b/src/N98/Magento/Command/Database/QueryCommand.php
index 869e56bdd..fb09e0c9c 100644
--- a/src/N98/Magento/Command/Database/QueryCommand.php
+++ b/src/N98/Magento/Command/Database/QueryCommand.php
@@ -17,8 +17,7 @@ protected function configure()
->setName('db:query')
->addArgument('query', InputArgument::OPTIONAL, 'SQL query')
->addOption('only-command', null, InputOption::VALUE_NONE, 'Print only mysql command. Do not execute')
- ->setDescription('Executes an SQL query on the database defined in env.php')
- ;
+ ->setDescription('Executes an SQL query on the database defined in env.php');
$help = << array(
+ protected $_importantVars = [
+ 'Threads_connected' => [
'desc' => 'Total number of clients that have currently open connections to the server.',
- ),
- 'Created_tmp_disk_tables' => array(
+ ],
+ 'Created_tmp_disk_tables' => [
'desc' => 'Number of temporary tables that have been created on disk instead of in-memory. Lower is
better.',
- ),
- 'Handler_read_first' => array(
+ ],
+ 'Handler_read_first' => [
'desc' => 'Number of times a table handler made a request to read the first row of a table index.',
- ),
- 'Handler_read_rnd_next' => array(
+ ],
+ 'Handler_read_rnd_next' => [
'desc' => 'Number of requests to read the next row in the data file. This value is high if you
are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or
that your queries are not written to take advantage of the indexes you have.',
- ),
- 'Innodb_buffer_pool_wait_free' => array(
+ ],
+ 'Innodb_buffer_pool_wait_free' => [
'desc' => 'Number of times MySQL has to wait for memory pages to be flushed.',
- ),
- 'Innodb_buffer_pool_pages_dirty' => array(
+ ],
+ 'Innodb_buffer_pool_pages_dirty' => [
'desc' => 'Indicates the number of InnoDB buffer pool data pages that have been changed in memory,
but the changes are not yet written (flushed) to the InnoDB data files',
- ),
- 'Key_reads' => array(
+ ],
+ 'Key_reads' => [
'desc' => 'Number of filesystem accesses MySQL performed to fetch database indexes.',
- ),
- 'Max_used_connections' => array(
+ ],
+ 'Max_used_connections' => [
'desc' => 'Max number of connections MySQL has had open at the same time since the server
was last restarted.',
- ),
- 'Open_tables' => array(
+ ],
+ 'Open_tables' => [
'desc' => 'Number of tables that are currently open.',
- ),
- 'Select_full_join' => array(
+ ],
+ 'Select_full_join' => [
'desc' => 'Number of full joins MySQL has performed to satisfy client queries.',
- ),
- 'Slow_queries' => array(
+ ],
+ 'Slow_queries' => [
'desc' => 'Number of queries that have taken longer than usual to execute.',
- ),
- 'Uptime' => array(
+ ],
+ 'Uptime' => [
'desc' => 'Time since the server was last restarted.',
- ),
- 'Aborted_connects' => array(
+ ],
+ 'Aborted_connects' => [
'desc' => 'Total number of failed attempts to connect to MySQL.',
- ),
- );
+ ],
+ ];
/**
* @var array
*/
- protected $_specialFormat = array(
- 'Uptime' => array('N98\Util\TimeElapsed', 'short'),
- );
+ protected $_specialFormat = [
+ 'Uptime' => ['N98\Util\TimeElapsed', 'short'],
+ ];
protected function configure()
{
@@ -109,27 +109,27 @@ protected function generateRows(array $outputVars, $hasDescription)
$this->_allVariables['Handler_read_prev']
)
);
- $rows[] = 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).'
),
- );
+ ];
}
if (isset($this->_allVariables['Innodb_buffer_pool_read_requests'])) {
$bufferHitRate = $this->_allVariables['Innodb_buffer_pool_read_requests'] /
($this->_allVariables['Innodb_buffer_pool_read_requests'] +
$this->_allVariables['Innodb_buffer_pool_reads']);
- $rows[] = 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.'
),
- );
+ ];
}
return $rows;
diff --git a/src/N98/Magento/Command/Database/VariablesCommand.php b/src/N98/Magento/Command/Database/VariablesCommand.php
index 8c9e43d6e..bb96e8f7a 100644
--- a/src/N98/Magento/Command/Database/VariablesCommand.php
+++ b/src/N98/Magento/Command/Database/VariablesCommand.php
@@ -10,7 +10,7 @@ class VariablesCommand extends AbstractShowCommand
* http://www.slideshare.net/shinguz/mysql-configuration-the-most-important-variables GERMAN
* @var array
*/
- protected $_importantVars = array(
+ protected $_importantVars = [
'have_query_cache' => '',
'innodb_additional_mem_pool_size' => '',
'innodb_buffer_pool_size' => '',
@@ -31,11 +31,11 @@ class VariablesCommand extends AbstractShowCommand
'table_definition_cache' => '',
'table_open_cache' => '',
'thread_cache_size' => '',
- 'tmp_table_size' => array(
+ 'tmp_table_size' => [
'desc' => '', // @todo add description everywhere
'opt' => '', // @todo calculate somehow the optimal values depending on the MySQL server environment
- ),
- );
+ ],
+ ];
protected function configure()
{
@@ -57,13 +57,13 @@ protected function configure()
*/
protected function allowRounding($name)
{
- $toHuman = array(
+ $toHuman = [
'max_length_for_sort_data' => 1,
'max_allowed_packet' => 1,
'max_seeks_for_key' => 1,
'max_write_lock_count' => 1,
'slave_max_allowed_packet' => 1,
- );
+ ];
$isSize = false !== strpos($name, '_size');
return $isSize || isset($toHuman[$name]);
diff --git a/src/N98/Magento/Command/Developer/Console/Config/MakeConfigRoutesCommand.php b/src/N98/Magento/Command/Developer/Console/Config/MakeConfigRoutesCommand.php
index 957fe0b4c..c4a8e71e9 100644
--- a/src/N98/Magento/Command/Developer/Console/Config/MakeConfigRoutesCommand.php
+++ b/src/N98/Magento/Command/Developer/Console/Config/MakeConfigRoutesCommand.php
@@ -33,8 +33,7 @@ protected function configure()
->addArgument('area', InputArgument::OPTIONAL, 'Area of routes.xml file', 'frontend')
->addOption('type', 't', InputOption::VALUE_OPTIONAL, 'Type', 'standard')
->addOption('frontname', 'f', InputOption::VALUE_OPTIONAL, 'Frontname')
- ->setDescription('Creates a new routes.xml file')
- ;
+ ->setDescription('Creates a new routes.xml file');
}
/**
diff --git a/src/N98/Magento/Command/Developer/Console/Config/MakeConfigSystemCommand.php b/src/N98/Magento/Command/Developer/Console/Config/MakeConfigSystemCommand.php
index 994eba07e..82712470c 100644
--- a/src/N98/Magento/Command/Developer/Console/Config/MakeConfigSystemCommand.php
+++ b/src/N98/Magento/Command/Developer/Console/Config/MakeConfigSystemCommand.php
@@ -29,8 +29,7 @@ protected function configure()
$this
->setName('make:config:system')
->addArgument('area', InputArgument::OPTIONAL, 'Area of system.xml file', 'adminhtml')
- ->setDescription('Creates a new system.xml file')
- ;
+ ->setDescription('Creates a new system.xml file');
}
/**
diff --git a/src/N98/Magento/Command/Developer/Console/MakeCommandCommand.php b/src/N98/Magento/Command/Developer/Console/MakeCommandCommand.php
index 301bb4198..d676f3d7c 100644
--- a/src/N98/Magento/Command/Developer/Console/MakeCommandCommand.php
+++ b/src/N98/Magento/Command/Developer/Console/MakeCommandCommand.php
@@ -97,24 +97,24 @@ private function addConfigureMethod(ClassGenerator $classGenerator, $commandName
*/
private function addExecuteMethod(ClassGenerator $classGenerator)
{
- $docblock = DocBlockGenerator::fromArray(array(
+ $docblock = DocBlockGenerator::fromArray([
'shortDescription' => '',
'longDescription' => '',
- 'tags' => array(
- array(
+ 'tags' => [
+ [
'name' => 'param',
'description' => 'InputInterface $input An InputInterface instance',
- ),
- array(
+ ],
+ [
'name' => 'param',
'description' => 'OutputInterface $output An OutputInterface instance',
- ),
- array(
+ ],
+ [
'name' => 'return',
'description' => 'null|int null or 0 if everything went fine, or an error code',
- ),
- ),
- ));
+ ],
+ ],
+ ]);
$inputParamType = '\Symfony\Component\Console\Input\InputInterface';
$outputParamType = '\Symfony\Component\Console\Output\OutputInterface';
diff --git a/src/N98/Magento/Command/Developer/Console/MakeModuleCommand.php b/src/N98/Magento/Command/Developer/Console/MakeModuleCommand.php
index e91b79beb..5f093b17d 100644
--- a/src/N98/Magento/Command/Developer/Console/MakeModuleCommand.php
+++ b/src/N98/Magento/Command/Developer/Console/MakeModuleCommand.php
@@ -36,7 +36,7 @@ protected function configure()
protected function execute(InputInterface $input, OutputInterface $output)
{
$moduleName = new ModuleNameStructure($input->getArgument('modulename'));
-
+
$filesystem = $this->get(Filesystem::class);
/** @var $filesystem Filesystem */
$appDirectoryWriter = $filesystem->getDirectoryWrite(DirectoryList::APP);
diff --git a/src/N98/Magento/Command/Developer/Console/MakeTableCommand.php b/src/N98/Magento/Command/Developer/Console/MakeTableCommand.php
index ca5ac5215..e53b0f3da 100644
--- a/src/N98/Magento/Command/Developer/Console/MakeTableCommand.php
+++ b/src/N98/Magento/Command/Developer/Console/MakeTableCommand.php
@@ -47,8 +47,7 @@ protected function configure()
{
$this
->setName('make:table')
- ->setDescription('Creates a new database table')
- ;
+ ->setDescription('Creates a new database table');
}
/**
diff --git a/src/N98/Magento/Command/Developer/Console/MakeThemeCommand.php b/src/N98/Magento/Command/Developer/Console/MakeThemeCommand.php
index 53abf2165..cb7fb801f 100644
--- a/src/N98/Magento/Command/Developer/Console/MakeThemeCommand.php
+++ b/src/N98/Magento/Command/Developer/Console/MakeThemeCommand.php
@@ -23,8 +23,7 @@ protected function configure()
->addArgument('area', InputArgument::REQUIRED, 'Area like "frontend"')
->addArgument('package', InputArgument::REQUIRED, 'Package like "Vendor"')
->addArgument('name', InputArgument::REQUIRED, 'Name of the theme')
- ->setDescription('Creates a new theme')
- ;
+ ->setDescription('Creates a new theme');
}
/**
diff --git a/src/N98/Magento/Command/Developer/Console/Shell.php b/src/N98/Magento/Command/Developer/Console/Shell.php
index eb323e8a3..368f01c2d 100644
--- a/src/N98/Magento/Command/Developer/Console/Shell.php
+++ b/src/N98/Magento/Command/Developer/Console/Shell.php
@@ -81,13 +81,13 @@ public function writeException(Exception $e)
} elseif ($e instanceof ErrorException) {
if (BinaryString::startsWith($e->getMessage(), 'PHP error: Use of undefined constant')) {
$this->getConsoleOutput()->writeln('Unknown command');
-
+
return;
}
} elseif ($e instanceof FatalErrorException) {
if (BinaryString::startsWith($e->getMessage(), 'PHP Fatal error: Call to undefined function')) {
$this->getConsoleOutput()->writeln('Unknown function');
-
+
return;
}
} elseif ($e instanceof ParseErrorException) {
diff --git a/src/N98/Magento/Command/Developer/Module/Create/SubCommand/CreateAdditionalFiles.php b/src/N98/Magento/Command/Developer/Module/Create/SubCommand/CreateAdditionalFiles.php
index 9566bb97f..3bdc1ce15 100644
--- a/src/N98/Magento/Command/Developer/Module/Create/SubCommand/CreateAdditionalFiles.php
+++ b/src/N98/Magento/Command/Developer/Module/Create/SubCommand/CreateAdditionalFiles.php
@@ -42,10 +42,10 @@ public function execute()
*/
private function _getOutfile($filename)
{
- $pathes = array(
+ $pathes = [
'rootDir' => $this->config->getString('magentoRootFolder'),
'moduleDir' => $this->config->getString('moduleDirectory'),
- );
+ ];
return $this->getCommand()->getHelper('twig')->renderString(
$filename,
diff --git a/src/N98/Magento/Command/Developer/Module/CreateCommand.php b/src/N98/Magento/Command/Developer/Module/CreateCommand.php
index daea04773..37144b92f 100644
--- a/src/N98/Magento/Command/Developer/Module/CreateCommand.php
+++ b/src/N98/Magento/Command/Developer/Module/CreateCommand.php
@@ -130,7 +130,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
private function initView(InputInterface $input, ConfigBag $configBag)
{
- $configBag->setArray('twigVars', array(
+ $configBag->setArray('twigVars', [
'vendorNamespace' => $configBag->getString('vendorNamespace'),
'moduleName' => $configBag->getString('moduleName'),
'createBlocks' => $configBag->getBool('shouldAddBlocks'),
@@ -140,7 +140,7 @@ private function initView(InputInterface $input, ConfigBag $configBag)
'authorName' => $input->getOption('author-name'),
'authorEmail' => $input->getOption('author-email'),
'description' => $input->getOption('description'),
- ));
+ ]);
}
/**
diff --git a/src/N98/Magento/Command/Developer/Module/ListCommand.php b/src/N98/Magento/Command/Developer/Module/ListCommand.php
index 8a52e48ed..f24aef2aa 100644
--- a/src/N98/Magento/Command/Developer/Module/ListCommand.php
+++ b/src/N98/Magento/Command/Developer/Module/ListCommand.php
@@ -49,8 +49,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
/**
@@ -71,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->prepareModuleList($input->getOption('vendor'));
$this->getHelper('table')
- ->setHeaders(array('Name', '(Schema) Version'))
+ ->setHeaders(['Name', '(Schema) Version'])
->renderByFormat($output, $this->moduleList, $input->getOption('format'));
}
diff --git a/src/N98/Magento/Command/Developer/Module/Observer/ListCommand.php b/src/N98/Magento/Command/Developer/Module/Observer/ListCommand.php
index 5a402d852..8c864de96 100644
--- a/src/N98/Magento/Command/Developer/Module/Observer/ListCommand.php
+++ b/src/N98/Magento/Command/Developer/Module/Observer/ListCommand.php
@@ -69,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$eventFilter = $input->getArgument('event');
if (is_null($area) || !in_array($area, $this->areas)) {
- $question = array();
+ $question = [];
foreach ($this->areas as $key => $area) {
$question[] = '[' . ($key + 1) . '] ' . $area . PHP_EOL;
}
diff --git a/src/N98/Magento/Command/Developer/Theme/ListCommand.php b/src/N98/Magento/Command/Developer/Theme/ListCommand.php
index 573187c97..2dad20ad3 100644
--- a/src/N98/Magento/Command/Developer/Theme/ListCommand.php
+++ b/src/N98/Magento/Command/Developer/Theme/ListCommand.php
@@ -63,7 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$this->getHelper('table')
- ->setHeaders(array('id', 'path', 'title', 'area', 'code'))
+ ->setHeaders(['id', 'path', 'title', 'area', 'code'])
->renderByFormat($output, $rows, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/Eav/Attribute/ViewCommand.php b/src/N98/Magento/Command/Eav/Attribute/ViewCommand.php
index 953da2df1..05bb0ab1c 100644
--- a/src/N98/Magento/Command/Eav/Attribute/ViewCommand.php
+++ b/src/N98/Magento/Command/Eav/Attribute/ViewCommand.php
@@ -54,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this
->getHelper('table')
- ->setHeaders(array('Type', 'Value'))
+ ->setHeaders(['Type', 'Value'])
->renderByFormat($output, $table, $input->getOption('format'));
}
@@ -67,44 +67,44 @@ protected function execute(InputInterface $input, OutputInterface $output)
*/
public function getTableInput($isFrontend = false)
{
- $table = array(
- 'Id' => array('ID'),
- 'Name' => array('Code'),
- 'AttributeSetId' => array('Attribute-Set-ID'),
- 'VisibleOnFront' => array('Visible-On-Front', function ($value) {
+ $table = [
+ 'Id' => ['ID'],
+ 'Name' => ['Code'],
+ 'AttributeSetId' => ['Attribute-Set-ID'],
+ 'VisibleOnFront' => ['Visible-On-Front', function ($value) {
return $value ? 'yes' : 'no';
- }),
- 'AttributeModel' => array('Attribute-Model'),
- 'BackendModel' => array('Backend-Model'),
- 'BackendTable' => array('Backend-Table'),
- 'BackendType' => array('Backend-Type'),
- 'SourceModel' => array('Source-Model'),
- 'CacheIdTags' => array('Cache-ID-Tags', function ($values) {
+ }],
+ 'AttributeModel' => ['Attribute-Model'],
+ 'BackendModel' => ['Backend-Model'],
+ 'BackendTable' => ['Backend-Table'],
+ 'BackendType' => ['Backend-Type'],
+ 'SourceModel' => ['Source-Model'],
+ 'CacheIdTags' => ['Cache-ID-Tags', function ($values) {
return implode(',', (array) $values);
- }),
- 'CacheTags' => array('Cache-Tags', function ($values) {
+ }],
+ 'CacheTags' => ['Cache-Tags', function ($values) {
return implode(',', (array) $values);
- }),
- 'DefaultValue' => array('Default-Value'),
- 'FlatColumns' => array(
+ }],
+ 'DefaultValue' => ['Default-Value'],
+ 'FlatColumns' => [
'Flat-Columns',
function ($values) {
return implode(',', array_keys((array) $values));
},
- ),
- 'FlatIndexes' => array(
+ ],
+ 'FlatIndexes' => [
'Flat-Indexes',
function ($values) {
return implode(',', array_keys((array) $values));
},
- ),
- );
+ ],
+ ];
if ($isFrontend) {
- $table['Frontend/Label'] = array('Frontend-Label');
- $table['Frontend/Class'] = array('Frontend-Class');
- $table['Frontend/InputType'] = array('Frontend-Input-Type');
- $table['Frontend/InputRendererClass'] = array('Frontend-Input-Renderer-Class');
+ $table['Frontend/Label'] = ['Frontend-Label'];
+ $table['Frontend/Class'] = ['Frontend-Class'];
+ $table['Frontend/InputType'] = ['Frontend-Input-Type'];
+ $table['Frontend/InputRendererClass'] = ['Frontend-Input-Renderer-Class'];
}
return $table;
@@ -118,7 +118,7 @@ function ($values) {
*/
private function getTable($attribute)
{
- $table = array();
+ $table = [];
foreach ($this->getTableInput($attribute->getFrontend()) as $code => $info) {
$label = array_shift($info);
@@ -134,11 +134,11 @@ private function getTable($attribute)
// Optional formatting callback
$value = is_callable($callback) ? $callback($value) : $value;
- if ($value === array()) {
+ if ($value === []) {
$value = '';
}
- $table[] = array($label, trim($value));
+ $table[] = [$label, trim($value)];
}
return $table;
diff --git a/src/N98/Magento/Command/GiftCard/CreateCommand.php b/src/N98/Magento/Command/GiftCard/CreateCommand.php
index 35d04cef3..c1a9d88c7 100644
--- a/src/N98/Magento/Command/GiftCard/CreateCommand.php
+++ b/src/N98/Magento/Command/GiftCard/CreateCommand.php
@@ -46,16 +46,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
$giftcard = $this->getGiftcard();
$giftcard->setData(
- array(
+ [
'status' => 1,
'is_redeemable' => 1,
'website_id' => $input->getOption('website')
?: $this->getObjectManager()->get('Magento\Store\Model\StoreManager')->getWebsite(true)->getId(),
'balance' => $input->getArgument('amount'),
'date_expires' => $input->getOption('expires'),
- )
+ ]
);
-
+
$giftcard->save();
if (!$giftcard->getId()) {
$output->writeln('Failed to create gift card');
diff --git a/src/N98/Magento/Command/GiftCard/InfoCommand.php b/src/N98/Magento/Command/GiftCard/InfoCommand.php
index 11a1d49d3..adc176029 100644
--- a/src/N98/Magento/Command/GiftCard/InfoCommand.php
+++ b/src/N98/Magento/Command/GiftCard/InfoCommand.php
@@ -54,21 +54,21 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('No gift card found for that code');
return;
}
-
- $data = array(
- array('Gift Card Account ID', $card->getId()),
- array('Code', $card->getCode()),
- array('Status', Giftcardaccount::STATUS_ENABLED == $card->getStatus() ? 'Enabled' : 'Disabled'),
- array('Date Created', $card->getDateCreated()),
- array('Expiration Date', $card->getDateExpires()),
- array('Website ID', $card->getWebsiteId()),
- array('Remaining Balance', $card->getBalance()),
- array('State', $card->getStateText()),
- array('Is Redeemable', $card->getIsRedeemable()),
- );
-
+
+ $data = [
+ ['Gift Card Account ID', $card->getId()],
+ ['Code', $card->getCode()],
+ ['Status', Giftcardaccount::STATUS_ENABLED == $card->getStatus() ? 'Enabled' : 'Disabled'],
+ ['Date Created', $card->getDateCreated()],
+ ['Expiration Date', $card->getDateExpires()],
+ ['Website ID', $card->getWebsiteId()],
+ ['Remaining Balance', $card->getBalance()],
+ ['State', $card->getStateText()],
+ ['Is Redeemable', $card->getIsRedeemable()],
+ ];
+
$this->getHelper('table')
- ->setHeaders(array('Name', 'Value'))
+ ->setHeaders(['Name', 'Value'])
->setRows($data)
->renderByFormat($output, $data, $input->getOption('format'));
}
diff --git a/src/N98/Magento/Command/Indexer/AbstractIndexerCommand.php b/src/N98/Magento/Command/Indexer/AbstractIndexerCommand.php
index 11efae7b6..4f79b6b90 100644
--- a/src/N98/Magento/Command/Indexer/AbstractIndexerCommand.php
+++ b/src/N98/Magento/Command/Indexer/AbstractIndexerCommand.php
@@ -12,20 +12,20 @@ class AbstractIndexerCommand extends AbstractMagentoCommand
*/
protected function getIndexerList()
{
- $list = array();
+ $list = [];
$indexCollection = $this->getIndexerCollection();
foreach ($indexCollection as $indexer) {
/* @var $indexer \Magento\Indexer\Model\Indexer */
$lastReadbleRuntime = $this->getRuntime($indexer);
$runtimeInSeconds = $this->getRuntimeInSeconds($indexer);
- $list[] = array(
+ $list[] = [
'code' => $indexer->getId(),
'title' => $indexer->getTitle(),
'status' => $indexer->getStatus(),
'last_runtime' => $lastReadbleRuntime, // @TODO Check if this exists in Magento 2
'runtime_seconds' => $runtimeInSeconds, // @TODO Check if this exists in Magento 2
- );
+ ];
}
return $list;
diff --git a/src/N98/Magento/Command/Indexer/ListCommand.php b/src/N98/Magento/Command/Indexer/ListCommand.php
index 6377dcf1e..a48cc79c8 100644
--- a/src/N98/Magento/Command/Indexer/ListCommand.php
+++ b/src/N98/Magento/Command/Indexer/ListCommand.php
@@ -19,8 +19,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
$help = <<getIndexerList() as $index) {
- $table[] = array(
+ $table[] = [
$index['code'],
$index['title'],
$index['status'],
$index['last_runtime'],
- );
+ ];
}
$this->getHelper('table')
- ->setHeaders(array('code', 'title', 'status', 'time'))
+ ->setHeaders(['code', 'title', 'status', 'time'])
->renderByFormat($output, $table, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/Indexer/RecreateTriggersCommand.php b/src/N98/Magento/Command/Indexer/RecreateTriggersCommand.php
index 00d06282e..8c73acefa 100644
--- a/src/N98/Magento/Command/Indexer/RecreateTriggersCommand.php
+++ b/src/N98/Magento/Command/Indexer/RecreateTriggersCommand.php
@@ -21,8 +21,7 @@ protected function configure()
{
$this
->setName('index:trigger:recreate')
- ->setDescription('ReCreate all triggers')
- ;
+ ->setDescription('ReCreate all triggers');
}
/**
diff --git a/src/N98/Magento/Command/Installer/SubCommand/CreateDatabase.php b/src/N98/Magento/Command/Installer/SubCommand/CreateDatabase.php
index efac43474..a216e5e68 100644
--- a/src/N98/Magento/Command/Installer/SubCommand/CreateDatabase.php
+++ b/src/N98/Magento/Command/Installer/SubCommand/CreateDatabase.php
@@ -33,7 +33,7 @@ public function execute()
return $input;
};
- $dbOptions = array('--dbHost', '--dbUser', '--dbPass', '--dbName');
+ $dbOptions = ['--dbHost', '--dbUser', '--dbPass', '--dbName'];
$dbOptionsFound = 0;
foreach ($dbOptions as $dbOption) {
foreach ($this->getCliArguments() as $definedCliOption) {
diff --git a/src/N98/Magento/Command/Installer/SubCommand/DownloadMagento.php b/src/N98/Magento/Command/Installer/SubCommand/DownloadMagento.php
index b375c0c8b..062436c09 100644
--- a/src/N98/Magento/Command/Installer/SubCommand/DownloadMagento.php
+++ b/src/N98/Magento/Command/Installer/SubCommand/DownloadMagento.php
@@ -40,7 +40,7 @@ private function implementation()
throw new RuntimeException('A magento installation already exists in this folder');
}
- $args = new ProcessArguments(array_merge($this->config['composer_bin'], array('create-project')));
+ $args = new ProcessArguments(array_merge($this->config['composer_bin'], ['create-project']));
$args
// Add composer options
->addArgs($package['options'])
@@ -122,20 +122,20 @@ protected function checkMagentoConnectCredentials(OutputInterface $output)
if (!isset($authConfig->username)
|| !isset($authConfig->password)
) {
- $this->output->writeln(array(
+ $this->output->writeln([
'',
$this->getCommand()
->getHelperSet()
->get('formatter')
->formatBlock('Authentication', 'bg=blue;fg=white', true),
'',
- ));
+ ]);
- $this->output->writeln(array(
+ $this->output->writeln([
'You need to create a security key. Login at https://marketplace.magento.com/customer/accessKeys/.',
'My Profile -> Access Keys. Use public key as username and private key as password',
'',
- ));
+ ]);
$dialog = $this->getCommand()->getHelper('dialog');
$username = $dialog->askAndValidate(
diff --git a/src/N98/Magento/Command/Installer/SubCommand/InstallComposer.php b/src/N98/Magento/Command/Installer/SubCommand/InstallComposer.php
index 2bf1b729b..06a88c08d 100644
--- a/src/N98/Magento/Command/Installer/SubCommand/InstallComposer.php
+++ b/src/N98/Magento/Command/Installer/SubCommand/InstallComposer.php
@@ -36,14 +36,14 @@ public function execute()
}
$this->output->writeln('Found executable ' . $composerBin . '');
- $this->config['composer_bin'] = array($composerBin);
+ $this->config['composer_bin'] = [$composerBin];
$composerUseSamePhpBinary = $this->hasFlagOrOptionalBoolOption('composer-use-same-php-binary', false);
if ($composerUseSamePhpBinary) {
- $this->config['composer_bin'] = array(
+ $this->config['composer_bin'] = [
OperatingSystem::getCurrentPhpBinary(),
$composerBin = OperatingSystem::locateProgram($composerBin),
- );
+ ];
}
}
diff --git a/src/N98/Magento/Command/Installer/SubCommand/InstallComposerPackages.php b/src/N98/Magento/Command/Installer/SubCommand/InstallComposerPackages.php
index a7dfc1f99..b3093e6d9 100644
--- a/src/N98/Magento/Command/Installer/SubCommand/InstallComposerPackages.php
+++ b/src/N98/Magento/Command/Installer/SubCommand/InstallComposerPackages.php
@@ -17,7 +17,7 @@ class InstallComposerPackages extends AbstractSubCommand
public function execute()
{
$this->output->writeln('Install composer packages');
- $processBuilder = new ProcessBuilder(array_merge($this->config['composer_bin'], array('install')));
+ $processBuilder = new ProcessBuilder(array_merge($this->config['composer_bin'], ['install']));
$process = $processBuilder->getProcess();
$process->setTimeout(86400);
diff --git a/src/N98/Magento/Command/Installer/SubCommand/InstallMagento.php b/src/N98/Magento/Command/Installer/SubCommand/InstallMagento.php
index b95abba91..19674b439 100644
--- a/src/N98/Magento/Command/Installer/SubCommand/InstallMagento.php
+++ b/src/N98/Magento/Command/Installer/SubCommand/InstallMagento.php
@@ -167,7 +167,7 @@ public function execute()
}
$this->_getDefaultSessionFolder($sessionSave);
- $argv = array(
+ $argv = [
'language' => $locale,
'timezone' => $timezone,
'db-host' => $this->_prepareDbHost(),
@@ -185,7 +185,7 @@ public function execute()
'session-save' => $sessionSave,
'backend-frontname' => $adminFrontname,
'currency' => $currency,
- );
+ ];
$dbPass = $this->config->getString('db_pass');
if (!empty($dbPass)) {
diff --git a/src/N98/Magento/Command/Installer/SubCommand/PreCheckPhp.php b/src/N98/Magento/Command/Installer/SubCommand/PreCheckPhp.php
index 828c431c8..fc9f06860 100644
--- a/src/N98/Magento/Command/Installer/SubCommand/PreCheckPhp.php
+++ b/src/N98/Magento/Command/Installer/SubCommand/PreCheckPhp.php
@@ -25,7 +25,7 @@ public function execute()
protected function checkExtensions()
{
$extensions = $this->commandConfig['installation']['pre-check']['php']['extensions'];
- $missingExtensions = array();
+ $missingExtensions = [];
foreach ($extensions as $extension) {
if (!extension_loaded($extension)) {
$missingExtensions[] = $extension;
diff --git a/src/N98/Magento/Command/Installer/SubCommand/SelectMagentoVersion.php b/src/N98/Magento/Command/Installer/SubCommand/SelectMagentoVersion.php
index 88a81cad7..131c84df7 100644
--- a/src/N98/Magento/Command/Installer/SubCommand/SelectMagentoVersion.php
+++ b/src/N98/Magento/Command/Installer/SubCommand/SelectMagentoVersion.php
@@ -21,7 +21,7 @@ public function execute()
$this->input->getOption('magentoVersion') == null
&& $this->input->getOption('magentoVersionByName') == null
) {
- $question = array();
+ $question = [];
foreach ($this->commandConfig['magento-packages'] as $key => $package) {
$question[] = '' . str_pad('[' . ($key + 1) . ']', 4, ' ') . ' ' .
$package['name'] . "\n";
diff --git a/src/N98/Magento/Command/Installer/SubCommand/SetDirectoryPermissions.php b/src/N98/Magento/Command/Installer/SubCommand/SetDirectoryPermissions.php
index 500dbb43f..f1130ef87 100644
--- a/src/N98/Magento/Command/Installer/SubCommand/SetDirectoryPermissions.php
+++ b/src/N98/Magento/Command/Installer/SubCommand/SetDirectoryPermissions.php
@@ -14,7 +14,7 @@ public function execute()
{
try {
$installationFolder = $this->config->getString('installationFolder');
-
+
$varFolder = $installationFolder . '/var';
if (!is_dir($varFolder)) {
@mkdir($varFolder);
@@ -36,7 +36,7 @@ public function execute()
$finder = Finder::create();
$finder->directories()
->ignoreUnreadableDirs(true)
- ->in(array($varFolder, $mediaFolder));
+ ->in([$varFolder, $mediaFolder]);
foreach ($finder as $dir) {
@chmod($dir->getRealpath(), 0777);
}
diff --git a/src/N98/Magento/Command/Media/DumpCommand.php b/src/N98/Magento/Command/Media/DumpCommand.php
index a6a488d8f..8d18ca4ae 100644
--- a/src/N98/Magento/Command/Media/DumpCommand.php
+++ b/src/N98/Magento/Command/Media/DumpCommand.php
@@ -30,8 +30,7 @@ protected function configure()
->setName('media:dump')
->addOption('strip', '', InputOption::VALUE_NONE, 'Excludes image cache')
->addArgument('filename', InputArgument::OPTIONAL, 'Dump filename')
- ->setDescription('Creates an archive with content of media folder.')
- ;
+ ->setDescription('Creates an archive with content of media folder.');
}
/**
diff --git a/src/N98/Magento/Command/OpenBrowserCommand.php b/src/N98/Magento/Command/OpenBrowserCommand.php
index 05cdbe036..9bbc7b4f9 100644
--- a/src/N98/Magento/Command/OpenBrowserCommand.php
+++ b/src/N98/Magento/Command/OpenBrowserCommand.php
@@ -21,8 +21,7 @@ protected function configure()
$this
->setName('open-browser')
->addArgument('store', InputArgument::OPTIONAL, 'Store code or ID')
- ->setDescription('Open current project in browser (experimental)')
- ;
+ ->setDescription('Open current project in browser (experimental)');
}
/**
diff --git a/src/N98/Magento/Command/Script/Repository/ListCommand.php b/src/N98/Magento/Command/Script/Repository/ListCommand.php
index 94c86a1a5..7612b6d42 100644
--- a/src/N98/Magento/Command/Script/Repository/ListCommand.php
+++ b/src/N98/Magento/Command/Script/Repository/ListCommand.php
@@ -19,8 +19,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
$help = <<getScripts();
if (count($files) > 0) {
- $table = array();
+ $table = [];
foreach ($files as $file) {
- $table[] = array(
+ $table[] = [
substr($file['fileinfo']->getFilename(), 0, -strlen(self::MAGERUN_EXTENSION)),
$file['location'],
$file['description'],
- );
+ ];
}
} else {
- $table = array();
+ $table = [];
}
if ($input->getOption('format') === null && count($table) === 0) {
@@ -64,7 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$this->getHelper('table')
- ->setHeaders(array('Script', 'Location', 'Description'))
+ ->setHeaders(['Script', 'Location', 'Description'])
->renderByFormat($output, $table, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/Script/Repository/RunCommand.php b/src/N98/Magento/Command/Script/Repository/RunCommand.php
index 88eb2c702..5e2092601 100644
--- a/src/N98/Magento/Command/Script/Repository/RunCommand.php
+++ b/src/N98/Magento/Command/Script/Repository/RunCommand.php
@@ -55,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$files = $this->getScripts();
if ($input->getArgument('script') == null) {
- $question = array();
+ $question = [];
$i = 0;
foreach ($files as $file) {
$files[$i] = $file;
@@ -86,10 +86,10 @@ function ($typeInput) use ($files) {
$selectedFile = $files[$script]['fileinfo']->getPathname();
}
- $scriptArray = array(
+ $scriptArray = [
'command' => 'script',
'filename' => $selectedFile,
- );
+ ];
foreach ($input->getOption('define') as $define) {
$scriptArray['--define'][] = $define;
}
diff --git a/src/N98/Magento/Command/Script/Repository/ScriptLoader.php b/src/N98/Magento/Command/Script/Repository/ScriptLoader.php
index f249faa0f..b2e86da00 100644
--- a/src/N98/Magento/Command/Script/Repository/ScriptLoader.php
+++ b/src/N98/Magento/Command/Script/Repository/ScriptLoader.php
@@ -130,7 +130,7 @@ private function getFolderPaths()
*/
private function findScriptFiles()
{
- $scriptFiles = array();
+ $scriptFiles = [];
$folders = $this->getFolderPaths();
@@ -172,11 +172,11 @@ private function createScriptFile(SplFileInfo $file)
{
$pathname = $file->getPathname();
- $scriptFile = array(
+ $scriptFile = [
'fileinfo' => $file,
'description' => $this->readDescriptionFromFile($pathname),
'location' => $this->getLocation($pathname),
- );
+ ];
return $scriptFile;
}
diff --git a/src/N98/Magento/Command/ScriptCommand.php b/src/N98/Magento/Command/ScriptCommand.php
index df7c4ad8a..d071e8dd2 100644
--- a/src/N98/Magento/Command/ScriptCommand.php
+++ b/src/N98/Magento/Command/ScriptCommand.php
@@ -16,7 +16,7 @@ class ScriptCommand extends AbstractMagentoCommand
/**
* @var array
*/
- protected $scriptVars = array();
+ protected $scriptVars = [];
/**
* @var string
diff --git a/src/N98/Magento/Command/SearchEngine/ListCommand.php b/src/N98/Magento/Command/SearchEngine/ListCommand.php
index dbe46514e..d7c9ad41f 100644
--- a/src/N98/Magento/Command/SearchEngine/ListCommand.php
+++ b/src/N98/Magento/Command/SearchEngine/ListCommand.php
@@ -25,8 +25,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
/**
@@ -52,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$searchEngines = $this->searchEngineConfig->toOptionArray();
- $table = array();
+ $table = [];
foreach ($searchEngines as $searchEngine) {
$table[] = [
$searchEngine['value'],
@@ -60,7 +59,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
];
}
$this->getHelper('table')
- ->setHeaders(array('code', 'label'))
+ ->setHeaders(['code', 'label'])
->renderByFormat($output, $table, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/SelfUpdateCommand.php b/src/N98/Magento/Command/SelfUpdateCommand.php
index 5a1daf03e..808940f78 100644
--- a/src/N98/Magento/Command/SelfUpdateCommand.php
+++ b/src/N98/Magento/Command/SelfUpdateCommand.php
@@ -28,7 +28,7 @@ protected function configure()
{
$this
->setName('self-update')
- ->setAliases(array('selfupdate'))
+ ->setAliases(['selfupdate'])
->addOption('unstable', null, InputOption::VALUE_NONE, 'Load unstable version from develop branch')
->addOption('dry-run', null, InputOption::VALUE_NONE, 'Tests if there is a new version without any update.')
->setDescription('Updates n98-magerun2.phar to the latest version.')
@@ -40,8 +40,7 @@ protected function configure()
php n98-magerun2.phar self-update
EOT
- )
- ;
+ );
}
/**
diff --git a/src/N98/Magento/Command/ShellCommand.php b/src/N98/Magento/Command/ShellCommand.php
index c109b9398..5b42ff438 100644
--- a/src/N98/Magento/Command/ShellCommand.php
+++ b/src/N98/Magento/Command/ShellCommand.php
@@ -12,8 +12,7 @@ protected function configure()
{
$this
->setName('shell')
- ->setDescription('Runs n98-magerun as shell')
- ;
+ ->setDescription('Runs n98-magerun as shell');
}
protected function execute(InputInterface $input, OutputInterface $output)
diff --git a/src/N98/Magento/Command/System/Check/Result.php b/src/N98/Magento/Command/System/Check/Result.php
index c6e3a7013..52d6c9534 100644
--- a/src/N98/Magento/Command/System/Check/Result.php
+++ b/src/N98/Magento/Command/System/Check/Result.php
@@ -66,7 +66,7 @@ public function setStatus($status)
$status = $status ? self::STATUS_OK : self::STATUS_ERROR;
}
- if (!in_array($status, array(self::STATUS_OK, self::STATUS_ERROR, self::STATUS_WARNING))) {
+ 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'
);
diff --git a/src/N98/Magento/Command/System/Check/Settings/CheckAbstract.php b/src/N98/Magento/Command/System/Check/Settings/CheckAbstract.php
index 3b714f731..03706825c 100644
--- a/src/N98/Magento/Command/System/Check/Settings/CheckAbstract.php
+++ b/src/N98/Magento/Command/System/Check/Settings/CheckAbstract.php
@@ -21,7 +21,7 @@ abstract class CheckAbstract implements StoreCheck
/**
* @var array
*/
- private $storeConfigPaths = array();
+ private $storeConfigPaths = [];
/**
* @var ScopeConfigInterface
@@ -58,10 +58,10 @@ public function check(ResultCollection $results, StoreInterface $store)
{
$result = $results->createResult();
- $typedParams = array(
+ $typedParams = [
'result' => $result,
'store' => $store,
- );
+ ];
$paramValues = $this->getParamValues($store, $typedParams);
@@ -69,7 +69,7 @@ public function check(ResultCollection $results, StoreInterface $store)
$method = new \ReflectionMethod($this, $name);
$parameters = $method->getParameters();
- $arguments = array();
+ $arguments = [];
foreach ($parameters as $parameter) {
$paramName = $parameter->getName();
$paramClass = $parameter->getClass();
@@ -85,11 +85,11 @@ public function check(ResultCollection $results, StoreInterface $store)
}
// use named parameter, otherwise null
- $paramValues += array($paramName => null);
+ $paramValues += [$paramName => null];
$arguments[] = $paramValues[$paramName];
}
- call_user_func_array(array($this, $name), $arguments);
+ call_user_func_array([$this, $name], $arguments);
}
/**
diff --git a/src/N98/Magento/Command/System/Cron/AbstractCronCommand.php b/src/N98/Magento/Command/System/Cron/AbstractCronCommand.php
index 8e5c0b725..986b38a50 100644
--- a/src/N98/Magento/Command/System/Cron/AbstractCronCommand.php
+++ b/src/N98/Magento/Command/System/Cron/AbstractCronCommand.php
@@ -76,7 +76,7 @@ public function inject(
*/
protected function getJobs()
{
- $table = array();
+ $table = [];
$jobs = $this->cronConfig->getJobs();
@@ -155,7 +155,7 @@ protected function getSchedule(array $job)
*/
protected function askJobCode(InputInterface $input, OutputInterface $output, $jobs)
{
- $question = array();
+ $question = [];
foreach ($jobs as $key => $job) {
$question[] = '[' . ($key + 1) . '] ' . $job['Job'] . PHP_EOL;
}
@@ -201,7 +201,7 @@ protected function getJobForExecuteMethod(InputInterface $input, OutputInterface
$model = $this->getObjectManager()->get($jobConfig['instance']);
- if (!$model || !is_callable(array($model, $jobConfig['method']))) {
+ if (!$model || !is_callable([$model, $jobConfig['method']])) {
throw new \RuntimeException(
sprintf(
'Invalid callback: %s::%s does not exist',
@@ -211,7 +211,7 @@ protected function getJobForExecuteMethod(InputInterface $input, OutputInterface
);
}
- return array($jobCode, $jobConfig, $model);
+ return [$jobCode, $jobConfig, $model];
}
/**
diff --git a/src/N98/Magento/Command/System/Cron/HistoryCommand.php b/src/N98/Magento/Command/System/Cron/HistoryCommand.php
index f8b6928cb..d39d8dd21 100644
--- a/src/N98/Magento/Command/System/Cron/HistoryCommand.php
+++ b/src/N98/Magento/Command/System/Cron/HistoryCommand.php
@@ -26,8 +26,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
/**
@@ -51,19 +50,19 @@ protected function execute(InputInterface $input, OutputInterface $output)
$date = $this->getObjectManager()->create('Magento\Framework\Stdlib\DateTime\DateTime');
$offset = $date->calculateOffset($timezone);
$this->cronScheduleCollection
- ->addFieldToFilter('status', array('neq' => Schedule::STATUS_PENDING))
+ ->addFieldToFilter('status', ['neq' => Schedule::STATUS_PENDING])
->addOrder('finished_at', \Magento\Framework\Data\Collection::SORT_ORDER_DESC);
- $table = array();
+ $table = [];
foreach ($this->cronScheduleCollection as $job) {
- $table[] = array(
+ $table[] = [
$job->getJobCode(),
$job->getStatus(),
$job->getFinishedAt() ? $date->gmtDate(null, $date->timestamp($job->getFinishedAt()) + $offset) : '',
- );
+ ];
}
$this->getHelper('table')
- ->setHeaders(array('Job', 'Status', 'Finished'))
+ ->setHeaders(['Job', 'Status', 'Finished'])
->renderByFormat($output, $table, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/System/Cron/ListCommand.php b/src/N98/Magento/Command/System/Cron/ListCommand.php
index 17676e060..fa469519f 100644
--- a/src/N98/Magento/Command/System/Cron/ListCommand.php
+++ b/src/N98/Magento/Command/System/Cron/ListCommand.php
@@ -19,8 +19,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
/**
diff --git a/src/N98/Magento/Command/System/InfoCommand.php b/src/N98/Magento/Command/System/InfoCommand.php
index 5a9ec54a7..e5f386308 100644
--- a/src/N98/Magento/Command/System/InfoCommand.php
+++ b/src/N98/Magento/Command/System/InfoCommand.php
@@ -72,8 +72,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
/**
@@ -141,9 +140,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->addCategoryCount();
$this->addProductCount();
- $table = array();
+ $table = [];
foreach ($this->infos as $key => $value) {
- $table[] = array($key, $value);
+ $table[] = [$key, $value];
}
if (($settingArgument = $input->getArgument('key')) !== null) {
@@ -155,7 +154,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln((string) $this->infos[$settingArgument]);
} else {
$this->getHelper('table')
- ->setHeaders(array('name', 'value'))
+ ->setHeaders(['name', 'value'])
->renderByFormat($output, $table, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/System/MaintenanceCommand.php b/src/N98/Magento/Command/System/MaintenanceCommand.php
index 31131999e..bc199e6b8 100644
--- a/src/N98/Magento/Command/System/MaintenanceCommand.php
+++ b/src/N98/Magento/Command/System/MaintenanceCommand.php
@@ -34,8 +34,7 @@ protected function configure()
InputOption::VALUE_NONE,
'Set to [1] to disable maintenance mode. Set to [d] to also delete the list with excluded IP addresses.'
)
- ->setDescription('Toggles maintenance mode if --on or --off preferences are not set')
- ;
+ ->setDescription('Toggles maintenance mode if --on or --off preferences are not set');
}
/**
diff --git a/src/N98/Magento/Command/System/Setup/AbstractSetupCommand.php b/src/N98/Magento/Command/System/Setup/AbstractSetupCommand.php
index 2f9701daf..05083f701 100644
--- a/src/N98/Magento/Command/System/Setup/AbstractSetupCommand.php
+++ b/src/N98/Magento/Command/System/Setup/AbstractSetupCommand.php
@@ -51,7 +51,7 @@ public function getMagentoModuleName($requestedModuleName)
return $moduleName;
}
}
-
+
throw new InvalidArgumentException(sprintf('Module does not exist: "%s"', $requestedModuleName));
}
diff --git a/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php b/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php
index 50e2e21e0..e8c613e1e 100644
--- a/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php
+++ b/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php
@@ -57,9 +57,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
$ignoreDataUpdate = $input->getOption('ignore-data');
if ($ignoreDataUpdate) {
- $headers = array('Setup', 'Module', 'DB', 'Status');
+ $headers = ['Setup', 'Module', 'DB', 'Status'];
} else {
- $headers = array('Setup', 'Module', 'DB', 'Data', 'Status');
+ $headers = ['Setup', 'Module', 'DB', 'Data', 'Status'];
}
$table = $this->getModuleTable($ignoreDataUpdate, $headers, $errorCount);
@@ -108,7 +108,7 @@ protected function logJUnit(array $data, JUnitSession $session)
private function getModuleTable($ignoreDataUpdate, array $headers, &$errorCount)
{
$errorCount = 0;
- $table = array();
+ $table = [];
$magentoModuleList = $this->getMagentoModuleList();
foreach ($magentoModuleList as $name => $module) {
@@ -183,7 +183,7 @@ private function sortAndDecorate(&$table)
array_walk($table, function (&$row) {
$status = $row['Status'];
- $availableStatus = array('OK' => 'info', 'Error' => 'error');
+ $availableStatus = ['OK' => 'info', 'Error' => 'error'];
$statusString = sprintf(
'<%s>%s%s>',
$availableStatus[$status],
@@ -205,12 +205,12 @@ private function mapModuleToRow($name, $module, $ignoreDataUpdate, &$errorCount)
{
$resource = $this->getMagentoModuleResource();
- $row = array(
+ $row = [
'Setup' => $name,
'Module' => $module['setup_version'],
'DB' => $resource->getDbVersion($name),
'Data' => $resource->getDataVersion($name),
- );
+ ];
if (empty($row['Module'])
&& empty($row['DB'])
diff --git a/src/N98/Magento/Command/System/Store/Config/BaseUrlListCommand.php b/src/N98/Magento/Command/System/Store/Config/BaseUrlListCommand.php
index df17248d8..7138d19fe 100644
--- a/src/N98/Magento/Command/System/Store/Config/BaseUrlListCommand.php
+++ b/src/N98/Magento/Command/System/Store/Config/BaseUrlListCommand.php
@@ -25,8 +25,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
/**
@@ -53,17 +52,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->initMagento();
foreach ($this->storeManager->getStores() as $store) {
- $table[$store->getId()] = array(
+ $table[$store->getId()] = [
$store->getId(),
$store->getCode(),
$store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB),
$store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB, true),
- );
+ ];
}
ksort($table);
$this->getHelper('table')
- ->setHeaders(array('id', 'code', 'unsecure_baseurl', 'secure_baseurl'))
+ ->setHeaders(['id', 'code', 'unsecure_baseurl', 'secure_baseurl'])
->renderByFormat($output, $table, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/System/Store/ListCommand.php b/src/N98/Magento/Command/System/Store/ListCommand.php
index 6dc6d088f..36b10d0cb 100644
--- a/src/N98/Magento/Command/System/Store/ListCommand.php
+++ b/src/N98/Magento/Command/System/Store/ListCommand.php
@@ -25,8 +25,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
/**
@@ -45,15 +44,15 @@ public function inject(\Magento\Store\Model\StoreManagerInterface $storeManager)
protected function execute(InputInterface $input, OutputInterface $output)
{
foreach ($this->storeManager->getStores() as $store) {
- $table[$store->getId()] = array(
+ $table[$store->getId()] = [
$store->getId(),
$store->getCode(),
- );
+ ];
}
ksort($table);
$this->getHelper('table')
- ->setHeaders(array('id', 'code'))
+ ->setHeaders(['id', 'code'])
->renderByFormat($output, $table, $input->getOption('format'));
}
}
diff --git a/src/N98/Magento/Command/System/Url/ListCommand.php b/src/N98/Magento/Command/System/Url/ListCommand.php
index a090c2a5a..aefad4df6 100644
--- a/src/N98/Magento/Command/System/Url/ListCommand.php
+++ b/src/N98/Magento/Command/System/Url/ListCommand.php
@@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$stores = explode(',', $input->getArgument('stores'));
- $urls = array();
+ $urls = [];
foreach ($stores as $storeId) {
try {
diff --git a/src/N98/Magento/Command/System/Website/ListCommand.php b/src/N98/Magento/Command/System/Website/ListCommand.php
index 7d6f97027..153ed8f99 100644
--- a/src/N98/Magento/Command/System/Website/ListCommand.php
+++ b/src/N98/Magento/Command/System/Website/ListCommand.php
@@ -25,8 +25,7 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
'Output Format. One of [' . implode(',', RendererFactory::getFormats()) . ']'
- )
- ;
+ );
}
/**
@@ -49,15 +48,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
foreach ($this->storeManager->getWebsites() as $website) {
- $table[$website->getId()] = array(
+ $table[$website->getId()] = [
$website->getId(),
$website->getCode(),
- );
+ ];
}
ksort($table);
$this->getHelper('table')
- ->setHeaders(array('id', 'code'))
+ ->setHeaders(['id', 'code'])
->renderByFormat($output, $table, $input->getOption('format'));
}
}
diff --git a/src/N98/Util/AutoloadRestorer.php b/src/N98/Util/AutoloadRestorer.php
index 5c81951d9..a1425f147 100644
--- a/src/N98/Util/AutoloadRestorer.php
+++ b/src/N98/Util/AutoloadRestorer.php
@@ -41,7 +41,7 @@ public function restore()
*/
private function getUnregisteredLoaders()
{
- $unregistered = array();
+ $unregistered = [];
$current = spl_autoload_functions();
foreach ($this->snapshot as $callback) {
if (in_array($callback, $current, true)) {
diff --git a/src/N98/Util/Console/Helper/ComposerHelper.php b/src/N98/Util/Console/Helper/ComposerHelper.php
index 877d4008d..59f84a8bd 100644
--- a/src/N98/Util/Console/Helper/ComposerHelper.php
+++ b/src/N98/Util/Console/Helper/ComposerHelper.php
@@ -90,7 +90,7 @@ public function getConfigValue($key, $useGlobalConfig = true)
*/
public function setConfigValue($key, $values, $useGlobalConfig = true)
{
- $commandArgs = array();
+ $commandArgs = [];
if ($useGlobalConfig) {
$commandArgs[] = 'global';
}
diff --git a/src/N98/Util/Console/Helper/DatabaseHelper.php b/src/N98/Util/Console/Helper/DatabaseHelper.php
index 50bef7b7e..c37d5ad7e 100644
--- a/src/N98/Util/Console/Helper/DatabaseHelper.php
+++ b/src/N98/Util/Console/Helper/DatabaseHelper.php
@@ -186,7 +186,7 @@ public function dsn()
unset($dsn['dbname']);
// use all remaining parts in the DSN
- $buildDsn = array();
+ $buildDsn = [];
foreach ($dsn as $key => $val) {
if (is_array($val)) {
continue;
@@ -293,13 +293,13 @@ public function getMysqlVariable($name, $type = null)
$type = (string) $type;
}
- if (!in_array($type, array('@@', '@'), true)) {
+ if (!in_array($type, ['@@', '@'], true)) {
throw new InvalidArgumentException(
sprintf('Invalid mysql variable type "%s", must be "@@" (system) or "@" (session)', $type)
);
}
- $quoted = '`' . strtr($name, array('`' => '``')) . '`';
+ $quoted = '`' . strtr($name, ['`' => '``']) . '`';
$query = "SELECT {$type}{$quoted};";
$connection = $this->getConnection();
@@ -327,7 +327,7 @@ public function getMysqlVariable($name, $type = null)
*/
public function getTableDefinitions(array $commandConfig)
{
- $tableDefinitions = array();
+ $tableDefinitions = [];
if (!isset($commandConfig['table-groups'])) {
return $tableDefinitions;
}
@@ -357,10 +357,10 @@ public function getTableDefinitions(array $commandConfig)
$description = isset($definition['description']) ? $definition['description'] : '';
- $tableDefinitions[$id] = array(
+ $tableDefinitions[$id] = [
'tables' => $tables,
'description' => $description,
- );
+ ];
}
return $tableDefinitions;
@@ -375,13 +375,13 @@ public function getTableDefinitions(array $commandConfig)
* @throws RuntimeException
* @throws \Magento\Framework\Exception\FileSystemException
*/
- public function resolveTables(array $list, array $definitions = array(), array $resolved = array())
+ public function resolveTables(array $list, array $definitions = [], array $resolved = [])
{
if ($this->_tables === null) {
$this->_tables = $this->getTables(true);
}
- $resolvedList = array();
+ $resolvedList = [];
foreach ($list as $entry) {
if (substr($entry, 0, 1) == '@') {
$code = substr($entry, 1);
@@ -405,13 +405,13 @@ public function resolveTables(array $list, array $definitions = array(), array $
$connection = $this->getConnection();
$sth = $connection->prepare(
'SHOW TABLES LIKE :like',
- array(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(
- array(':like' => $this->dbSettings['prefix'] . $entry)
+ [':like' => $this->dbSettings['prefix'] . $entry]
);
$rows = $sth->fetchAll();
foreach ($rows as $row) {
@@ -447,7 +447,7 @@ private function resolveRetrieveDefinitionsTablesByCode(array $definitions, $cod
throw new RuntimeException("Invalid tables definition of table-groups code: @$code");
}
- $tables = array_reduce((array) $tables, array($this, 'resolveTablesArray'), null);
+ $tables = array_reduce((array) $tables, [$this, 'resolveTablesArray'], null);
return $tables;
}
@@ -466,7 +466,7 @@ private function resolveTablesArray(array $carry = null, $item = null)
if (is_array($item)) {
if (count($item) > 1) {
- $item = array_reduce($item, array($this, 'resolveTablesArray'), (array) $carry);
+ $item = array_reduce($item, [$this, 'resolveTablesArray'], (array) $carry);
}
} else {
throw new InvalidArgumentException(sprintf('Unable to handle %s', var_export($item, true)));
@@ -495,7 +495,7 @@ public function getTables($withoutPrefix = null)
$column = $columnName = 'table_name';
- $input = array();
+ $input = [];
if ($withoutPrefix && $prefixLength) {
$column = sprintf('SUBSTRING(%1$s FROM 1 + CHAR_LENGTH(:name)) %1$s', $columnName);
@@ -511,7 +511,7 @@ public function getTables($withoutPrefix = null)
}
$query = sprintf('SELECT %s FROM information_schema.tables WHERE %s;', $column, $condition);
- $statement = $db->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
+ $statement = $db->prepare($query, [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]);
$result = $statement->execute($input);
if (!$result) {
@@ -560,11 +560,11 @@ private function throwRuntimeException(PDOStatement $statement, $message = '')
*/
private function quoteLike($string, $escape = '=')
{
- $translation = array(
+ $translation = [
$escape => $escape . $escape,
'%' => $escape . '%',
'_' => $escape . '_',
- );
+ ];
return strtr($string, $translation);
}
@@ -582,9 +582,9 @@ public function getTablesStatus($withoutPrefix = false)
$db = $this->getConnection();
$prefix = $this->dbSettings['prefix'];
if (strlen($prefix) > 0) {
- $statement = $db->prepare('SHOW TABLE STATUS LIKE :like', array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
+ $statement = $db->prepare('SHOW TABLE STATUS LIKE :like', [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]);
$statement->execute(
- array(':like' => $prefix . '%')
+ [':like' => $prefix . '%']
);
} else {
$statement = $db->query('SHOW TABLE STATUS');
@@ -592,7 +592,7 @@ public function getTablesStatus($withoutPrefix = false)
if ($statement) {
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
- $return = array();
+ $return = [];
foreach ($result as $table) {
if (true === $withoutPrefix) {
$table['Name'] = str_replace($prefix, '', $table['Name']);
@@ -603,7 +603,7 @@ public function getTablesStatus($withoutPrefix = false)
return $return;
}
- return array();
+ return [];
}
/**
@@ -690,10 +690,10 @@ private function runShowCommand($command, $variable = null)
if (null !== $variable) {
$statement = $db->prepare(
'SHOW /*!50000 GLOBAL */ ' . $command . ' LIKE :like',
- array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY)
+ [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]
);
$statement->execute(
- array(':like' => $variable)
+ [':like' => $variable]
);
} else {
$statement = $db->query('SHOW /*!50000 GLOBAL */ ' . $command);
@@ -702,7 +702,7 @@ private function runShowCommand($command, $variable = null)
if ($statement) {
/** @var array|string[] $result */
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
- $return = array();
+ $return = [];
foreach ($result as $row) {
$return[$row['Variable_name']] = $row['Value'];
}
@@ -710,7 +710,7 @@ private function runShowCommand($command, $variable = null)
return $return;
}
- return array();
+ return [];
}
/**
diff --git a/src/N98/Util/Console/Helper/MagentoHelper.php b/src/N98/Util/Console/Helper/MagentoHelper.php
index 3777c27ae..9823a9eeb 100644
--- a/src/N98/Util/Console/Helper/MagentoHelper.php
+++ b/src/N98/Util/Console/Helper/MagentoHelper.php
@@ -61,7 +61,7 @@ class MagentoHelper extends AbstractHelper implements DetectionResultInterface
/**
* @var array
*/
- protected $baseConfig = array();
+ protected $baseConfig = [];
/**
* @var string
@@ -105,7 +105,7 @@ public function getName()
* @param array $subFolders [optional] sub-folders to check
* @return bool
*/
- public function detect($folder, array $subFolders = array())
+ public function detect($folder, array $subFolders = [])
{
$folders = $this->splitPathFolders($folder);
$folders = $this->checkMagerunFile($folders);
@@ -133,7 +133,7 @@ public function detect($folder, array $subFolders = array())
*/
protected function splitPathFolders($folder)
{
- $folders = array();
+ $folders = [];
$folderParts = explode('/', $folder);
foreach ($folderParts as $key => $part) {
diff --git a/src/N98/Util/Console/Helper/ParameterHelper.php b/src/N98/Util/Console/Helper/ParameterHelper.php
index a66d355a0..01b4b6b65 100644
--- a/src/N98/Util/Console/Helper/ParameterHelper.php
+++ b/src/N98/Util/Console/Helper/ParameterHelper.php
@@ -68,8 +68,8 @@ public function askStore(
}
$store = $storeManager->getStore($input->getArgument($argumentName));
} catch (Exception $e) {
- $stores = array();
- $question = array();
+ $stores = [];
+ $question = [];
$i = 0;
foreach ($storeManager->getStores($withDefaultStore) as $store) {
$stores[$i] = $store->getId();
@@ -133,7 +133,7 @@ public function askWebsite(InputInterface $input, OutputInterface $output, $argu
$website = $storeManager->getWebsite($input->getArgument($argumentName));
} catch (Exception $e) {
$i = 0;
- $websites = array();
+ $websites = [];
foreach ($storeManager->getWebsites() as $website) {
$websites[$i] = $website->getId();
$question[] = sprintf(
@@ -177,12 +177,12 @@ function ($typeInput) use ($websites) {
public function askEmail(InputInterface $input, OutputInterface $output, $argumentName = 'email')
{
$constraints = new Constraints\Collection(
- array(
- 'email' => array(
+ [
+ 'email' => [
new Constraints\NotBlank(),
new Constraints\Email(),
- ),
- )
+ ],
+ ]
);
return $this->_validateArgument($output, $argumentName, $input->getArgument($argumentName), $constraints);
@@ -201,22 +201,22 @@ public function askPassword(
$argumentName = 'password',
$needDigits = true
) {
- $validators = array();
+ $validators = [];
if ($needDigits) {
- $regex = array(
+ $regex = [
'pattern' => '/^(?=.*\d)(?=.*[a-zA-Z])/',
'message' => 'Password must contain letters and at least one digit',
- );
+ ];
$validators[] = new Constraints\Regex($regex);
}
- $validators[] = new Constraints\Length(array('min' => 6));
+ $validators[] = new Constraints\Length(['min' => 6]);
$constraints = new Constraints\Collection(
- array(
+ [
'password' => $validators,
- )
+ ]
);
return $this->_validateArgument($output, $argumentName, $input->getArgument($argumentName), $constraints);
@@ -234,10 +234,10 @@ public function askPassword(
protected function _validateArgument(OutputInterface $output, $name, $value, $constraints)
{
$validator = $this->initValidator();
- $errors = array();
+ $errors = [];
if (!empty($value)) {
- $errors = $validator->validateValue(array($name => $value), $constraints);
+ $errors = $validator->validateValue([$name => $value], $constraints);
if (count($errors) > 0) {
$output->writeln('' . $errors[0]->getMessage() . '');
}
@@ -252,7 +252,7 @@ protected function _validateArgument(OutputInterface $output, $name, $value, $co
$output,
$question,
function ($typeInput) use ($validator, $constraints, $name) {
- $errors = $validator->validateValue(array($name => $typeInput), $constraints);
+ $errors = $validator->validateValue([$name => $typeInput], $constraints);
if (count($errors) > 0) {
throw new InvalidArgumentException($errors[0]->getMessage());
}
diff --git a/src/N98/Util/Console/Helper/Table/Renderer/RendererFactory.php b/src/N98/Util/Console/Helper/Table/Renderer/RendererFactory.php
index 980cd64a4..0ee71a1fa 100644
--- a/src/N98/Util/Console/Helper/Table/Renderer/RendererFactory.php
+++ b/src/N98/Util/Console/Helper/Table/Renderer/RendererFactory.php
@@ -4,11 +4,11 @@
class RendererFactory
{
- protected static $formats = array(
+ protected static $formats = [
'csv' => 'N98\Util\Console\Helper\Table\Renderer\CsvRenderer',
'json' => 'N98\Util\Console\Helper\Table\Renderer\JsonRenderer',
'xml' => 'N98\Util\Console\Helper\Table\Renderer\XmlRenderer',
- );
+ ];
/**
* @param string $format
@@ -20,7 +20,7 @@ public function create($format)
$format = strtolower($format);
if (isset(self::$formats[$format])) {
$rendererClass = self::$formats[$format];
- return new $rendererClass;
+ return new $rendererClass();
}
return false;
diff --git a/src/N98/Util/Console/Helper/TableHelper.php b/src/N98/Util/Console/Helper/TableHelper.php
index 7959abddf..4cb4cc372 100644
--- a/src/N98/Util/Console/Helper/TableHelper.php
+++ b/src/N98/Util/Console/Helper/TableHelper.php
@@ -24,7 +24,7 @@ class TableHelper extends BaseTableHelper
/**
* @var array
*/
- protected $headers = array();
+ protected $headers = [];
/**
* @param string $format
diff --git a/src/N98/Util/Console/Helper/TwigHelper.php b/src/N98/Util/Console/Helper/TwigHelper.php
index 12e572179..da9c047c4 100644
--- a/src/N98/Util/Console/Helper/TwigHelper.php
+++ b/src/N98/Util/Console/Helper/TwigHelper.php
@@ -40,7 +40,7 @@ public function __construct(array $baseDirs)
* @throws \Twig_Error_Runtime
* @throws \Twig_Error_Syntax
*/
- public function render($template, $variables = array())
+ public function render($template, $variables = [])
{
return $this->twig->render($template, $variables);
}
@@ -56,7 +56,7 @@ public function render($template, $variables = array())
* @throws \Twig_Error_Runtime
* @throws \Twig_Error_Syntax
*/
- public function renderString($string, $variables = array())
+ public function renderString($string, $variables = [])
{
return $this->twig->renderString($string, $variables);
}
diff --git a/src/N98/Util/Faker/Provider/Internet.php b/src/N98/Util/Faker/Provider/Internet.php
index d6cdbdba7..f341ef685 100644
--- a/src/N98/Util/Faker/Provider/Internet.php
+++ b/src/N98/Util/Faker/Provider/Internet.php
@@ -9,10 +9,10 @@ class Internet extends \Faker\Provider\Internet
*
* @var array
*/
- protected static $userNameFormats = array(
+ protected static $userNameFormats = [
'{{lastName}}.{{firstName}}.######',
'{{firstName}}.{{lastName}}.######',
'{{firstName}}.######',
'?{{lastName}}.######',
- );
+ ];
}
diff --git a/src/N98/Util/Filesystem.php b/src/N98/Util/Filesystem.php
index e3dea81e7..f9a1a93ce 100644
--- a/src/N98/Util/Filesystem.php
+++ b/src/N98/Util/Filesystem.php
@@ -23,7 +23,7 @@ class Filesystem
*
* @return void
*/
- public function recursiveCopy($src, $dst, $blacklist = array())
+ public function recursiveCopy($src, $dst, $blacklist = [])
{
if (!is_dir($dst)) {
@mkdir($dst, 0777, true);
@@ -39,8 +39,8 @@ public function recursiveCopy($src, $dst, $blacklist = array())
throw new RuntimeException(sprintf('Source directory <%s> error', $src));
}
- $skip = array_merge(array('.', '..'), $blacklist);
- $stack = array();
+ $skip = array_merge(['.', '..'], $blacklist);
+ $stack = [];
while (false !== ($file = readdir($handle))) {
if (in_array($file, $skip)) {
@@ -88,7 +88,7 @@ public function recursiveRemoveDirectory($directory, $empty = false)
throw new RuntimeException(sprintf('Directory <%s> error', $directory));
}
- $skip = array('.', '..');
+ $skip = ['.', '..'];
// and scan through the items inside
while (false !== ($file = readdir($handle))) {
@@ -109,7 +109,7 @@ public function recursiveRemoveDirectory($directory, $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);
@@ -136,7 +136,7 @@ public function recursiveRemoveDirectory($directory, $empty = false)
*/
public static function humanFileSize($bytes, $decimals = 2)
{
- $units = array('B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y');
+ $units = ['B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
$factor = (int) floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f%s", $bytes / pow(1024, $factor), $units[$factor]);
diff --git a/src/N98/Util/Template/Twig.php b/src/N98/Util/Template/Twig.php
index 72c015db9..582a4fcd1 100644
--- a/src/N98/Util/Template/Twig.php
+++ b/src/N98/Util/Template/Twig.php
@@ -21,7 +21,7 @@ class Twig
public function __construct(array $baseDirs)
{
$loader = new Twig_Loader_Filesystem($baseDirs);
- $this->twigEnv = new Twig_Environment($loader, array('debug' => true));
+ $this->twigEnv = new Twig_Environment($loader, ['debug' => true]);
$this->addExtensions($this->twigEnv);
$this->addFilters($this->twigEnv);
}
@@ -52,7 +52,7 @@ public function render($filename, $variables)
public function renderString($string, $variables)
{
$loader = new Twig_Loader_String();
- $twig = new Twig_Environment($loader, array('debug' => true));
+ $twig = new Twig_Environment($loader, ['debug' => true]);
$this->addExtensions($twig);
$this->addFilters($twig);
@@ -68,7 +68,7 @@ protected function addFilters(Twig_Environment $twig)
* cast_to_array
*/
$twig->addFilter(
- new Twig_SimpleFilter('cast_to_array', array($this, 'filterCastToArray'))
+ new Twig_SimpleFilter('cast_to_array', [$this, 'filterCastToArray'])
);
}
diff --git a/src/N98/Util/TimeElapsed.php b/src/N98/Util/TimeElapsed.php
index e3d62b4ca..d328410d4 100644
--- a/src/N98/Util/TimeElapsed.php
+++ b/src/N98/Util/TimeElapsed.php
@@ -110,7 +110,7 @@ private static function diff($datetimeOrSeconds, $now = null)
*/
private static function pieces(DateInterval $diff)
{
- $keys = array(
+ $keys = [
'y' => 'year',
'm' => 'month',
'w' => 'week',
@@ -118,10 +118,10 @@ private static function pieces(DateInterval $diff)
'h' => 'hour',
'i' => 'minute',
's' => 'second',
- );
+ ];
// map diff
- $diffArray = array();
+ $diffArray = [];
$diffVars = get_object_vars($diff);
foreach ($keys as $unit => $name) {
$diffArray[$unit] = isset($diffVars[$unit]) ? $diffVars[$unit] : null;
@@ -133,7 +133,7 @@ private static function pieces(DateInterval $diff)
$diffArray['d'] -= $weeks * 7;
// fill string buffer array
- $pieces = array();
+ $pieces = [];
foreach ($keys as $unit => $name) {
if ($value = $diffArray[$unit]) {
$pieces[] = sprintf('%s %s%s', $value, $name, $value > 1 ? 's' : '');
diff --git a/src/N98/View/PhpView.php b/src/N98/View/PhpView.php
index 220f0e276..dbc38d352 100644
--- a/src/N98/View/PhpView.php
+++ b/src/N98/View/PhpView.php
@@ -7,7 +7,7 @@ class PhpView implements View
/**
* @var array
*/
- protected $vars = array();
+ protected $vars = [];
/**
* @var
diff --git a/src/bootstrap.php b/src/bootstrap.php
index f0ee390ee..352b251f1 100644
--- a/src/bootstrap.php
+++ b/src/bootstrap.php
@@ -11,7 +11,7 @@
return N98\MagerunBootstrap::createApplication();
} catch (Exception $e) {
printf("%s: %s\n", get_class($e), $e->getMessage());
- if (array_intersect(array('-vvv', '-vv', '-v', '--verbose'), $argv)) {
+ if (array_intersect(['-vvv', '-vv', '-v', '--verbose'], $argv)) {
printf("%s\n", $e->getTraceAsString());
}
exit(1);
diff --git a/tests/N98/Magento/Application/ConfigTest.php b/tests/N98/Magento/Application/ConfigTest.php
index 9233cae01..acd303eec 100644
--- a/tests/N98/Magento/Application/ConfigTest.php
+++ b/tests/N98/Magento/Application/ConfigTest.php
@@ -46,7 +46,7 @@ public function loader()
$this->assertEquals('Configuration not yet fully loaded', $e->getMessage());
}
- $this->assertEquals(array(), $config->getConfig());
+ $this->assertEquals([], $config->getConfig());
$loader = $config->getLoader();
$this->assertInstanceOf(__NAMESPACE__ . '\\ConfigurationLoader', $loader);
@@ -69,7 +69,7 @@ public function loader()
public function setConfig()
{
$config = new Config();
- $config->setConfig(array(0, 1, 2));
+ $config->setConfig([0, 1, 2]);
$actual = $config->getConfig();
$this->assertSame($actual[1], 1);
}
@@ -86,11 +86,11 @@ public function configCommandAlias()
$saved = $_SERVER['argv'];
{
- $config->setConfig(array('commands' => array('aliases' => array(array('list-help' => 'list --help')))));
+ $config->setConfig(['commands' => ['aliases' => [['list-help' => 'list --help']]]]);
$definition = new InputDefinition();
$definition->addArgument(new InputArgument('command'));
- $argv = array('/path/to/command', 'list-help');
+ $argv = ['/path/to/command', 'list-help'];
$_SERVER['argv'] = $argv;
$input = new ArgvInput($argv, $definition);
$this->assertSame('list-help', (string) $input);
@@ -104,7 +104,7 @@ public function configCommandAlias()
$config->registerConfigCommandAlias($command);
- $this->assertSame(array('list-help'), $command->getAliases());
+ $this->assertSame(['list-help'], $command->getAliases());
}
/**
@@ -112,19 +112,19 @@ public function configCommandAlias()
*/
public function customCommands()
{
- $array = array(
- 'commands' => array(
- 'customCommands' => array(
+ $array = [
+ 'commands' => [
+ 'customCommands' => [
'N98\Magento\Command\Config\Store\GetCommand',
- array('name' => 'N98\Magento\Command\Config\Store\GetCommand'),
- ),
- ),
- );
+ ['name' => 'N98\Magento\Command\Config\Store\GetCommand'],
+ ],
+ ],
+ ];
$output = new BufferedOutput();
$output->setVerbosity($output::VERBOSITY_DEBUG);
- $config = new Config(array(), false, $output);
+ $config = new Config([], false, $output);
$config->setConfig($array);
/** @var Application $application */
@@ -137,14 +137,14 @@ public function customCommands()
*/
public function registerCustomAutoloaders()
{
- $array = array(
- 'autoloaders' => array('$prefix' => '$path'),
- 'autoloaders_psr4' => array('$prefix\\' => '$path'),
- );
+ $array = [
+ 'autoloaders' => ['$prefix' => '$path'],
+ 'autoloaders_psr4' => ['$prefix\\' => '$path'],
+ ];
$output = new BufferedOutput();
- $config = new Config(array(), false, $output);
+ $config = new Config([], false, $output);
$config->setConfig($array);
$autloader = new ClassLoader();
@@ -160,10 +160,10 @@ public function registerCustomAutoloaders()
public function loadPartialConfig()
{
$config = new Config();
- $this->assertEquals(array(), $config->getDetectSubFolders());
+ $this->assertEquals([], $config->getDetectSubFolders());
$config->loadPartialConfig(false);
$actual = $config->getDetectSubFolders();
$this->assertInternalType('array', $actual);
- $this->assertNotEquals(array(), $actual);
+ $this->assertNotEquals([], $actual);
}
}
diff --git a/tests/N98/Magento/ApplicationTest.php b/tests/N98/Magento/ApplicationTest.php
index 71ac64bd8..cb3891410 100644
--- a/tests/N98/Magento/ApplicationTest.php
+++ b/tests/N98/Magento/ApplicationTest.php
@@ -51,26 +51,26 @@ public function testExecute()
$distConfigArray = Yaml::parse(file_get_contents(__DIR__ . '/../../../config.yaml'));
- $configArray = array(
- 'autoloaders' => array(
+ $configArray = [
+ 'autoloaders' => [
'N98MagerunTest' => __DIR__ . '/_ApplicationTest/Src',
- ),
- 'commands' => array(
- 'customCommands' => array(
+ ],
+ 'commands' => [
+ 'customCommands' => [
0 => 'N98MagerunTest\TestDummyCommand',
- ),
- 'aliases' => array(
- array(
+ ],
+ 'aliases' => [
+ [
'ssl' => 'sys:store:list',
- ),
- ),
- ),
- 'init' => array(
- 'options' => array(
+ ],
+ ],
+ ],
+ 'init' => [
+ 'options' => [
'config_model' => 'N98MagerunTest\AlternativeConfigModel',
- ),
- ),
- );
+ ],
+ ],
+ ];
$application->setAutoExit(false);
$application->init(ArrayFunctions::mergeArrays($distConfigArray, $configArray));
@@ -85,9 +85,9 @@ public function testExecute()
$commandTester = new CommandTester($testDummyCommand);
$commandTester->execute(
- array(
+ [
'command' => $testDummyCommand->getName(),
- )
+ ]
);
$this->assertContains('dummy', $commandTester->getDisplay());
$this->assertTrue($application->getDefinition()->hasOption('root-dir'));
@@ -107,13 +107,13 @@ public function testPlugins()
$application->setMagentoRootFolder($this->getTestMagentoRoot());
// Load plugin config
- $injectConfig = array(
- 'plugin' => array(
- 'folders' => array(
+ $injectConfig = [
+ 'plugin' => [
+ 'folders' => [
__DIR__ . '/_ApplicationTest/Modules',
- ),
- ),
- );
+ ],
+ ],
+ ];
$application->init($injectConfig);
// Check for module command
@@ -124,38 +124,38 @@ public function testComposer()
{
vfsStream::setup('root');
vfsStream::create(
- array(
- 'htdocs' => array(
- 'app' => array(
+ [
+ 'htdocs' => [
+ 'app' => [
'bootstrag.php' => '',
- ),
- ),
- 'vendor' => array(
- 'acme' => array(
- 'magerun-test-module' => array(
+ ],
+ ],
+ 'vendor' => [
+ 'acme' => [
+ 'magerun-test-module' => [
'n98-magerun2.yaml' => file_get_contents(__DIR__ . '/_ApplicationTest/Composer/n98-magerun2.yaml'),
- 'src' => array(
- 'Acme' => array(
+ 'src' => [
+ 'Acme' => [
'FooCommand.php' => file_get_contents(__DIR__ . '/_ApplicationTest/Composer/FooCommand.php'),
- ),
- ),
- ),
- ),
- 'n98' => array(
- 'magerun' => array(
- 'src' => array(
- 'N98' => array(
- 'Magento' => array(
- 'Command' => array(
+ ],
+ ],
+ ],
+ ],
+ 'n98' => [
+ 'magerun' => [
+ 'src' => [
+ 'N98' => [
+ 'Magento' => [
+ 'Command' => [
'ConfigurationLoader.php' => '',
- ),
- ),
- ),
- ),
- ),
- ),
- ),
- )
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ],
+ ]
);
$configurationLoader = $this->getMockBuilder(\N98\Magento\Application\ConfigurationLoader::class)
diff --git a/tests/N98/Magento/Command/Admin/NotificationsCommandTest.php b/tests/N98/Magento/Command/Admin/NotificationsCommandTest.php
index ad3e0649e..1ca671c1d 100644
--- a/tests/N98/Magento/Command/Admin/NotificationsCommandTest.php
+++ b/tests/N98/Magento/Command/Admin/NotificationsCommandTest.php
@@ -9,18 +9,18 @@ class NotificationsCommandTest extends TestCase
public function testExecute()
{
$this->assertDisplayContains(
- array(
+ [
'command' => 'admin:notifications',
'--on' => true,
- ),
+ ],
'Admin Notifications hidden'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'admin:notifications',
'--off' => true,
- ),
+ ],
'Admin Notifications visible'
);
}
diff --git a/tests/N98/Magento/Command/Cache/CleanCommandTest.php b/tests/N98/Magento/Command/Cache/CleanCommandTest.php
index ae665fbd4..dafd8a73a 100644
--- a/tests/N98/Magento/Command/Cache/CleanCommandTest.php
+++ b/tests/N98/Magento/Command/Cache/CleanCommandTest.php
@@ -13,31 +13,31 @@ public function testExecute()
public function testItCanCleanMultipleCaches()
{
- $input = array(
+ $input = [
'command' => 'cache:clean',
- 'type' => array('config', 'layout'),
+ 'type' => ['config', 'layout'],
- );
+ ];
$this->assertDisplayContains($input, 'config cache cleaned');
$this->assertDisplayContains($input, 'layout cache cleaned');
}
public function testItSkipsUnknownCacheType()
{
- $input = array(
+ $input = [
'command' => 'cache:clean',
- 'type' => array('block_html,full_page', 'config'),
- );
+ 'type' => ['block_html,full_page', 'config'],
+ ];
$this->assertDisplayContains($input, '"block_html,full_page" skipped');
$this->assertDisplayContains($input, 'config cache cleaned');
}
public function testItAvoidsUnintentionalCleaningOfAllCaches()
{
- $input = array(
+ $input = [
'command' => 'cache:clean',
- 'type' => array('block_html,full_page'),
- );
+ 'type' => ['block_html,full_page'],
+ ];
$this->assertDisplayContains($input, '"block_html,full_page" skipped');
$this->assertDisplayContains($input, 'Aborting clean');
}
diff --git a/tests/N98/Magento/Command/Cache/DisableCommandTest.php b/tests/N98/Magento/Command/Cache/DisableCommandTest.php
index 6fd00d31a..514dc4eaa 100644
--- a/tests/N98/Magento/Command/Cache/DisableCommandTest.php
+++ b/tests/N98/Magento/Command/Cache/DisableCommandTest.php
@@ -17,10 +17,10 @@ public function testDisableNonexistentCache()
{
$expectedOutput = $this->getExpectedOutput();
- $input = array(
+ $input = [
'command' => 'cache:disable',
'type' => self::NONEXISTENT_CACHE_TYPE,
- );
+ ];
$this->assertDisplayContains($input, $expectedOutput);
}
diff --git a/tests/N98/Magento/Command/Cache/EnableCommandTest.php b/tests/N98/Magento/Command/Cache/EnableCommandTest.php
index 08ea300fa..d41bc1605 100644
--- a/tests/N98/Magento/Command/Cache/EnableCommandTest.php
+++ b/tests/N98/Magento/Command/Cache/EnableCommandTest.php
@@ -15,10 +15,10 @@ class EnableCommandTest extends TestCase
public function testEnableNonexistentCache()
{
- $input = array(
+ $input = [
'command' => 'cache:enable',
'type' => self::NONEXISTENT_CACHE_TYPE,
- );
+ ];
$expectedOutput = $this->getExpectedOutput();
$this->assertDisplayContains($input, $expectedOutput);
diff --git a/tests/N98/Magento/Command/Cache/ListCommandTest.php b/tests/N98/Magento/Command/Cache/ListCommandTest.php
index 9b9d2f0a6..1c6798e42 100644
--- a/tests/N98/Magento/Command/Cache/ListCommandTest.php
+++ b/tests/N98/Magento/Command/Cache/ListCommandTest.php
@@ -14,7 +14,7 @@ class ListCommandTest extends TestCase
public function setUp()
{
$application = $this->getApplication();
- $application->add(new ListCommand);
+ $application->add(new ListCommand());
$this->command = $this->getApplication()->find('cache:list');
}
@@ -26,8 +26,7 @@ public function testTypesIsNotEmpty()
{
/* @var $command ListCommand */
$command = $this->assertExecute('cache:list')->getCommand();
- $this->assertNotEmpty($command->getTypes())
- ;
+ $this->assertNotEmpty($command->getTypes());
}
/**
@@ -36,7 +35,7 @@ public function testTypesIsNotEmpty()
public function testEnabledFilter()
{
/* @var $command ListCommand */
- $command = $this->assertExecute(array('command' => 'cache:list', '--enabled' => 1))->getCommand();
+ $command = $this->assertExecute(['command' => 'cache:list', '--enabled' => 1])->getCommand();
$cacheTypes = $command->getTypes();
$disabledCacheTypes = 0;
diff --git a/tests/N98/Magento/Command/Cache/ReportCommandTest.php b/tests/N98/Magento/Command/Cache/ReportCommandTest.php
index 1af50e133..978fea4d1 100644
--- a/tests/N98/Magento/Command/Cache/ReportCommandTest.php
+++ b/tests/N98/Magento/Command/Cache/ReportCommandTest.php
@@ -9,9 +9,9 @@ class ReportCommandTest extends TestCase
public function testExecute()
{
$this->assertDisplayRegExp(
- array(
+ [
'command' => 'cache:report',
- ),
+ ],
'~\\| ID.*\\| EXPIRE.*\\|$~m'
);
}
diff --git a/tests/N98/Magento/Command/Config/Data/AclCommandTest.php b/tests/N98/Magento/Command/Config/Data/AclCommandTest.php
index f661acc47..84f94355d 100644
--- a/tests/N98/Magento/Command/Config/Data/AclCommandTest.php
+++ b/tests/N98/Magento/Command/Config/Data/AclCommandTest.php
@@ -17,9 +17,9 @@ public function itShouldLoadGlobalConfig()
$commandTester = new CommandTester($command);
$commandTester->execute(
- array(
+ [
'command' => 'config:data:acl',
- )
+ ]
);
$this->assertContains('All Stores', $commandTester->getDisplay());
diff --git a/tests/N98/Magento/Command/Config/Store/DeleteCommandTest.php b/tests/N98/Magento/Command/Config/Store/DeleteCommandTest.php
index 323fc65e0..70ca017e6 100644
--- a/tests/N98/Magento/Command/Config/Store/DeleteCommandTest.php
+++ b/tests/N98/Magento/Command/Config/Store/DeleteCommandTest.php
@@ -11,17 +11,17 @@ class DeleteCommandTest extends TestCase
*/
public function deleteOne()
{
- $input = array(
+ $input = [
'command' => 'config:store:set',
'path' => 'n98_magerun/foo/bar',
'value' => '1234',
- );
+ ];
$this->assertDisplayContains($input, 'n98_magerun/foo/bar => 1234');
- $input = array(
+ $input = [
'command' => 'config:store:delete',
'path' => 'n98_magerun/foo/bar',
- );
+ ];
$this->assertDisplayContains($input, '| n98_magerun/foo/bar | default | 0 |');
}
@@ -30,24 +30,24 @@ public function deleteOne()
*/
public function deleteAll()
{
- $input = array(
+ $input = [
'command' => 'config:store:set',
'path' => 'n98_magerun/foo/bar',
'--scope' => 'stores',
'--scope-id' => null, # placeholder
'value' => 'fake-value',
- );
+ ];
foreach ($this->getStores() as $store) {
$input['--scope-id'] = $store->getId();
$this->assertDisplayContains($input, "n98_magerun/foo/bar => fake-value");
}
- $input = array(
+ $input = [
'command' => 'config:store:delete',
'path' => 'n98_magerun/foo/bar',
'--all' => true,
- );
+ ];
$this->assertDisplayContains($input, '| n98_magerun/foo/bar | stores |');
}
diff --git a/tests/N98/Magento/Command/Config/Store/GetCommandTest.php b/tests/N98/Magento/Command/Config/Store/GetCommandTest.php
index e13b19cce..49da8be25 100644
--- a/tests/N98/Magento/Command/Config/Store/GetCommandTest.php
+++ b/tests/N98/Magento/Command/Config/Store/GetCommandTest.php
@@ -12,59 +12,59 @@ class GetCommandTest extends TestCase
public function nullValues()
{
$this->assertDisplayRegExp(
- array(
+ [
'command' => 'config:store:set',
'--no-null' => null,
'path' => 'n98_magerun/foo/bar',
'value' => 'NULL',
- ),
+ ],
'~^n98_magerun/foo/bar => NULL$~'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:get',
'--magerun-script' => null,
'path' => 'n98_magerun/foo/bar',
- ),
+ ],
'config:store:set --no-null --scope-id=0 --scope=default'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:set',
'path' => 'n98_magerun/foo/bar',
'value' => 'NULL',
- ),
+ ],
'n98_magerun/foo/bar => NULL (NULL/"unknown" value)'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:get',
'path' => 'n98_magerun/foo/bar',
- ),
+ ],
'| n98_magerun/foo/bar | default | 0 | NULL (NULL/"unknown" value) |'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:get',
'--magerun-script' => true, # needed to not use the previous output cache
'path' => 'n98_magerun/foo/bar',
- ),
+ ],
'config:store:set --scope-id=0 --scope=default -- \'n98_magerun/foo/bar\' NULL'
);
}
public function provideFormatsWithNull()
{
- return array(
- array(null, '| n98_magerun/foo/bar | default | 0 | NULL (NULL/"unknown" value) |'),
- array('csv', 'n98_magerun/foo/bar,default,0,NULL'),
- array('json', '"Value": null'),
- array('xml', 'NULL'),
- );
+ return [
+ [null, '| n98_magerun/foo/bar | default | 0 | NULL (NULL/"unknown" value) |'],
+ ['csv', 'n98_magerun/foo/bar,default,0,NULL'],
+ ['json', '"Value": null'],
+ ['xml', 'NULL'],
+ ];
}
/**
@@ -74,20 +74,20 @@ public function provideFormatsWithNull()
public function nullWithFormat($format, $expected)
{
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:set',
'path' => 'n98_magerun/foo/bar',
'value' => 'NULL',
- ),
+ ],
'n98_magerun/foo/bar => NULL (NULL/"unknown" value)'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:get',
'--format' => $format,
'path' => 'n98_magerun/foo/bar',
- ),
+ ],
$expected
);
}
@@ -98,59 +98,59 @@ public function testExecute()
* Add a new entry (to test for it)
*/
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:set',
'path' => 'n98_magerun/foo/bar',
'value' => '1234',
- ),
+ ],
'n98_magerun/foo/bar => 1234'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:get',
'path' => 'n98_magerun/foo/bar',
- ),
+ ],
'| n98_magerun/foo/bar | default | 0 | 1234 |'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:get',
'path' => 'n98_magerun/foo/bar',
'--update-script' => true,
- ),
+ ],
"\$installer->setConfigData('n98_magerun/foo/bar', '1234');"
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:get',
'path' => 'n98_magerun/foo/bar',
'--magerun-script' => true,
- ),
+ ],
"config:store:set --scope-id=0 --scope=default -- 'n98_magerun/foo/bar' '1234'"
);
/**
* Dump CSV
*/
- $input = array(
+ $input = [
'command' => 'config:store:get',
'path' => 'n98_magerun/foo/bar',
'--format' => 'csv',
- );
+ ];
$this->assertDisplayContains($input, 'Path,Scope,Scope-ID,Value');
$this->assertDisplayContains($input, 'n98_magerun/foo/bar,default,0,1234');
/**
* Dump XML
*/
- $input = array(
+ $input = [
'command' => 'config:store:get',
'path' => 'n98_magerun/foo/bar',
'--format' => 'xml',
- );
+ ];
$this->assertDisplayContains($input, '');
$this->assertDisplayContains($input, '1234');
@@ -158,11 +158,11 @@ public function testExecute()
* Dump JSON
*/
$this->assertDisplayRegExp(
- array(
+ [
'command' => 'config:store:get',
'path' => 'n98_magerun/foo/bar',
'--format' => 'json',
- ),
+ ],
'/"Value":\s*"1234"/'
);
}
@@ -170,30 +170,30 @@ public function testExecute()
public function testItAddsScopeIdFilterOnZero()
{
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:set',
'path' => 'n98_magerun/foo/bar',
'value' => '1234',
- ),
+ ],
'n98_magerun/foo/bar => 1234'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'config:store:set',
'path' => 'n98_magerun/foo/bar',
'value' => '1234',
'--scope-id' => '1',
- ),
+ ],
'n98_magerun/foo/bar => 1234'
);
$this->assertDisplayNotContains(
- array(
+ [
'command' => 'config:store:get',
'path' => 'n98_magerun/foo/bar',
'--scope-id' => '0',
- ),
+ ],
'n98_magerun/foo/bar | default | 1 | 1234'
);
}
diff --git a/tests/N98/Magento/Command/Customer/CreateCommandTest.php b/tests/N98/Magento/Command/Customer/CreateCommandTest.php
index ccd08614c..edeeda7aa 100644
--- a/tests/N98/Magento/Command/Customer/CreateCommandTest.php
+++ b/tests/N98/Magento/Command/Customer/CreateCommandTest.php
@@ -16,14 +16,14 @@ public function testExecute()
{
$generatedEmail = uniqid() . '@example.com';
- $input = array(
+ $input = [
'command' => 'customer:create',
'email' => $generatedEmail,
'password' => 'Password123',
'firstname' => 'John',
'lastname' => 'Doe',
'website' => $this->getWebsiteCode(),
- );
+ ];
$this->assertDisplayContains($input, 'successfully created');
// Format option
@@ -60,7 +60,7 @@ public function testWithWrongPassword()
// mock dialog
// We mock the DialogHelper
- $dialog = $this->createMock('N98\Util\Console\Helper\ParameterHelper', array('askPassword'));
+ $dialog = $this->createMock('N98\Util\Console\Helper\ParameterHelper', ['askPassword']);
$dialog->expects($this->at(0))
->method('askPassword')
->will($this->returnValue(true)); // The user confirms
@@ -68,13 +68,13 @@ public function testWithWrongPassword()
// We override the standard helper with our mock
$command->getHelperSet()->set($dialog, 'parameter');
- $options = array(
+ $options = [
'command' => $command->getName(),
'email' => $generatedEmail,
'password' => 'pass',
'firstname' => 'John',
'lastname' => 'Doe',
- );
+ ];
$commandTester = new CommandTester($command);
$commandTester->execute($options);
$this->assertRegExp(
diff --git a/tests/N98/Magento/Command/Database/DumpCommandTest.php b/tests/N98/Magento/Command/Database/DumpCommandTest.php
index 6dbc7fa62..9fdea9317 100644
--- a/tests/N98/Magento/Command/Database/DumpCommandTest.php
+++ b/tests/N98/Magento/Command/Database/DumpCommandTest.php
@@ -4,7 +4,6 @@
use N98\Magento\Command\TestCase;
use SplFileInfo;
-use Symfony\Component\Console\Command\Command;
/**
* @see \N98\Magento\Command\Database\DumpCommand
@@ -13,13 +12,13 @@ class DumpCommandTest extends TestCase
{
public function testExecute()
{
- $input = array(
+ $input = [
'command' => 'db:dump',
'--add-time' => true,
'--only-command' => true,
'--force' => true,
'--compression' => 'gz',
- );
+ ];
$this->assertDisplayContains($input, 'mysqldump');
$this->assertDisplayContains($input, '.sql');
@@ -35,17 +34,17 @@ public function provideFilenamePatternsAndOptions()
# testAddTimeAutogenerated
['/^.*[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}\.sql$/', []],
# testAddTimePrefixAutogenerated
- ['/^[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}.*\.sql$/', ['--add-time' => 'prefix', ]],
+ ['/^[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}.*\.sql$/', ['--add-time' => 'prefix']],
# testAddTimeFilenameSpecified
- ['/^.*[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}\.sql.gz$/', ['--compression' => 'gzip', ]],
+ ['/^.*[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}\.sql.gz$/', ['--compression' => 'gzip']],
# testAddTimeFilenameSpecified
- ['/^foo_[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}\.sql$/', ['filename' => 'foo.sql', ]],
+ ['/^foo_[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}\.sql$/', ['filename' => 'foo.sql']],
# testAddTimePrefixFilenameSpecified
- ['/^[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}_foo\.sql$/', ['filename' => 'foo.sql', '--add-time' => 'prefix', ]],
+ ['/^[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}_foo\.sql$/', ['filename' => 'foo.sql', '--add-time' => 'prefix']],
# testAddTimeOffFilenameSpecified
- ['/^foo.sql$/', ['filename' => 'foo.sql', '--add-time' => 'no', ]],
+ ['/^foo.sql$/', ['filename' => 'foo.sql', '--add-time' => 'no']],
# testAddTimeFilenameSpecifiedRelative
- ['/^..\/foo_[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}\.sql$/', ['filename' => '../foo.sql', ]],
+ ['/^..\/foo_[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{6}\.sql$/', ['filename' => '../foo.sql']],
];
}
@@ -59,30 +58,30 @@ public function provideFilenamePatternsAndOptions()
*/
public function filenamePatterns($regex, array $options)
{
- $mandatory = array(
+ $mandatory = [
'command' => 'db:dump',
'--force' => true,
'--print-only-filename' => true,
'--dry-run' => null,
- );
+ ];
- $defaults = array(
+ $defaults = [
'--add-time' => true,
- );
+ ];
$this->assertDisplayRegExp($mandatory + $options + $defaults, $regex);
}
public function testWithStripOption()
{
- $input = array(
+ $input = [
'command' => 'db:dump',
'--add-time' => true,
'--only-command' => true,
'--force' => true,
'--strip' => '@development not_existing_table_1',
'--compression' => 'gzip',
- );
+ ];
$dbConfig = $this->getDatabaseConnection()->getConfig();
$db = $dbConfig['dbname'];
@@ -99,27 +98,27 @@ public function testWithStripOption()
* Uncompressed
*/
$this->assertDisplayNotContains(
- array(
+ [
'command' => 'db:dump',
'--add-time' => true,
'--only-command' => true,
'--force' => true,
'--strip' => '@development',
- ),
+ ],
".sql.gz"
);
}
public function testWithExcludeOption()
{
- $input = array(
+ $input = [
'command' => 'db:dump',
'--add-time' => true,
'--only-command' => true,
'--force' => true,
'--exclude' => 'core_config_data',
'--compression' => 'gzip',
- );
+ ];
$dbConfig = $this->getDatabaseConnection()->getConfig();
$db = $dbConfig['dbname'];
@@ -132,13 +131,13 @@ public function testWithExcludeOption()
* Uncompressed
*/
$this->assertDisplayNotContains(
- array(
+ [
'command' => 'db:dump',
'--add-time' => true,
'--only-command' => true,
'--force' => true,
'--exclude' => 'core_config_data',
- ),
+ ],
".sql.gz"
);
}
@@ -156,11 +155,11 @@ public function realDump()
$this->assertFalse(is_readable($dumpFile), 'Precondition that the file does not exists');
$this->assertExecute(
- array(
+ [
'command' => 'db:dump',
'--strip' => '@stripped',
'filename' => $dumpFile,
- )
+ ]
);
$this->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 ea7ecfe12..b2e17a138 100644
--- a/tests/N98/Magento/Command/Database/InfoCommandTest.php
+++ b/tests/N98/Magento/Command/Database/InfoCommandTest.php
@@ -13,10 +13,10 @@ public function testExecute()
public function testExecuteWithSettingArgument()
{
- $input = array(
+ $input = [
'command' => 'db:info',
'setting' => 'MySQL-Cli-String',
- );
+ ];
$this->assertDisplayNotContains($input, 'MySQL-Cli-String');
$this->assertDisplayContains($input, 'mysql -h');
diff --git a/tests/N98/Magento/Command/Database/Maintain/CheckTablesCommandTest.php b/tests/N98/Magento/Command/Database/Maintain/CheckTablesCommandTest.php
index 9df47e24b..c293bc6de 100644
--- a/tests/N98/Magento/Command/Database/Maintain/CheckTablesCommandTest.php
+++ b/tests/N98/Magento/Command/Database/Maintain/CheckTablesCommandTest.php
@@ -14,24 +14,24 @@ public function testExecuteMyIsam()
$this->markTestSkipped('Currently we have no myisam tables in a magento2 installation');
$this->assertDisplayContains(
- array(
+ [
'command' => 'db:maintain:check-tables',
'--format' => 'csv',
'--type' => 'quick',
'--table' => 'oauth_nonce',
- ),
+ ],
'oauth_nonce,check,quick,OK'
);
}
public function testExecuteInnoDb()
{
- $input = array(
+ $input = [
'command' => 'db:maintain:check-tables',
'--format' => 'csv',
'--type' => 'quick',
'--table' => 'catalog_product_entity_media_gallery*',
- );
+ ];
$timeRegex = '"\s+[0-9]+\srows","[0-9\.]+\ssecs"';
$this->assertDisplayRegExp(
diff --git a/tests/N98/Magento/Command/Database/QueryCommandTest.php b/tests/N98/Magento/Command/Database/QueryCommandTest.php
index 29a98a42f..837c74e66 100644
--- a/tests/N98/Magento/Command/Database/QueryCommandTest.php
+++ b/tests/N98/Magento/Command/Database/QueryCommandTest.php
@@ -8,10 +8,10 @@ class QueryCommandTest extends TestCase
{
public function testExecute()
{
- $input = array(
+ $input = [
'command' => 'db:query',
'query' => 'SHOW TABLES;',
- );
+ ];
$this->assertDisplayContains($input, 'admin_user');
$this->assertDisplayContains($input, 'catalog_product_entity');
$this->assertDisplayContains($input, 'wishlist');
diff --git a/tests/N98/Magento/Command/Database/StatusCommandTest.php b/tests/N98/Magento/Command/Database/StatusCommandTest.php
index 2104692a6..36db559e8 100644
--- a/tests/N98/Magento/Command/Database/StatusCommandTest.php
+++ b/tests/N98/Magento/Command/Database/StatusCommandTest.php
@@ -8,10 +8,10 @@ class StatusCommandTest extends TestCase
{
public function testExecute()
{
- $input = array(
+ $input = [
'command' => 'db:status',
'--format' => 'csv',
- );
+ ];
$this->assertDisplayContains($input, 'Threads_connected');
$this->assertDisplayContains($input, 'Innodb_buffer_pool_wait_free');
$this->assertDisplayContains($input, 'InnoDB Buffer Pool hit');
@@ -20,11 +20,11 @@ public function testExecute()
public function testSearch()
{
- $input = array(
+ $input = [
'command' => 'db:status',
'--format' => 'csv',
'search' => 'Innodb%',
- );
+ ];
$this->assertDisplayContains($input, 'Innodb_buffer_pool_read_ahead_rnd');
$this->assertDisplayContains($input, 'Innodb_buffer_pool_wait_free');
$this->assertDisplayContains($input, 'InnoDB Buffer Pool hit');
@@ -35,12 +35,12 @@ public function testSearch()
public function testRounding()
{
$this->assertDisplayRegExp(
- array(
+ [
'command' => 'db:status',
'--format' => 'csv',
'--rounding' => '2',
'search' => '%size%',
- ),
+ ],
'~Innodb_page_size,[0-9\.]+K,~'
);
}
diff --git a/tests/N98/Magento/Command/Database/VariablesCommandTest.php b/tests/N98/Magento/Command/Database/VariablesCommandTest.php
index 92b5fb4b7..a600265a0 100644
--- a/tests/N98/Magento/Command/Database/VariablesCommandTest.php
+++ b/tests/N98/Magento/Command/Database/VariablesCommandTest.php
@@ -8,10 +8,10 @@ class VariablesCommandTest extends TestCase
{
public function testExecute()
{
- $input = array(
+ $input = [
'command' => 'db:variables',
'--format' => 'csv',
- );
+ ];
$this->assertDisplayContains($input, 'have_query_cache');
$this->assertDisplayContains($input, 'innodb_log_buffer_size');
@@ -21,11 +21,11 @@ public function testExecute()
public function testSearch()
{
- $input = array(
+ $input = [
'command' => 'db:variables',
'--format' => 'csv',
'search' => 'Innodb%',
- );
+ ];
$this->assertDisplayContains($input, 'innodb_concurrency_tickets');
$this->assertDisplayContains($input, 'innodb_file_format_check');
@@ -36,12 +36,12 @@ public function testSearch()
public function testRounding()
{
- $input = array(
+ $input = [
'command' => 'db:variables',
'--format' => 'csv',
'--rounding' => '2',
'search' => '%size%',
- );
+ ];
$this->assertDisplayRegExp($input, '~max_binlog_stmt_cache_size," [0-9\.]+[A-Z]"~');
$this->assertDisplayRegExp($input, '~myisam_max_sort_file_size," +[0-9\.]+[A-Z]"~');
diff --git a/tests/N98/Magento/Command/Design/DemoNoticeCommandTest.php b/tests/N98/Magento/Command/Design/DemoNoticeCommandTest.php
index 8d5f4a09f..eb1e5b801 100644
--- a/tests/N98/Magento/Command/Design/DemoNoticeCommandTest.php
+++ b/tests/N98/Magento/Command/Design/DemoNoticeCommandTest.php
@@ -9,20 +9,20 @@ class DemoNoticeCommandTest extends TestCase
public function testExecute()
{
$this->assertDisplayContains(
- array(
+ [
'command' => 'design:demo-notice',
'--global' => true,
'--on' => true,
- ),
+ ],
'Demo Notice enabled'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'design:demo-notice',
'--global' => true,
'--off' => true,
- ),
+ ],
'Demo Notice disabled'
);
}
diff --git a/tests/N98/Magento/Command/Developer/Console/Renderer/PHPCode/TableRendererTest.php b/tests/N98/Magento/Command/Developer/Console/Renderer/PHPCode/TableRendererTest.php
index f5665b726..3dbdb239e 100644
--- a/tests/N98/Magento/Command/Developer/Console/Renderer/PHPCode/TableRendererTest.php
+++ b/tests/N98/Magento/Command/Developer/Console/Renderer/PHPCode/TableRendererTest.php
@@ -22,14 +22,14 @@ class TableRendererTest extends TestCase
* @var DDLTable
*/
private $table;
-
+
protected function setUp()
{
$this->table = new DDLTable();
$twigHelper = $this->getApplication()->getHelperSet()->get('twig');
$this->renderer = new TableRenderer($this->table, $twigHelper);
}
-
+
/**
* @test
*/
diff --git a/tests/N98/Magento/Command/Developer/Module/ListCommandTest.php b/tests/N98/Magento/Command/Developer/Module/ListCommandTest.php
index a2afe5f4d..7ec12ff22 100644
--- a/tests/N98/Magento/Command/Developer/Module/ListCommandTest.php
+++ b/tests/N98/Magento/Command/Developer/Module/ListCommandTest.php
@@ -34,7 +34,7 @@ public function testVendorList()
{
/* @var $command ListCommand */
$command = $this->assertExecute(
- array('command' => 'dev:module:list', '--vendor' => self::NONEXISTENT_VENDOR)
+ ['command' => 'dev:module:list', '--vendor' => self::NONEXISTENT_VENDOR]
)->getCommand();
$this->assertEmpty($command->getModuleList());
}
diff --git a/tests/N98/Magento/Command/Developer/Module/Observer/ListCommandTest.php b/tests/N98/Magento/Command/Developer/Module/Observer/ListCommandTest.php
index 3e85f0fc2..ec4fe113d 100644
--- a/tests/N98/Magento/Command/Developer/Module/Observer/ListCommandTest.php
+++ b/tests/N98/Magento/Command/Developer/Module/Observer/ListCommandTest.php
@@ -12,7 +12,7 @@ class ListCommandTest extends TestCase
public function testGlobalList()
{
$this->assertDisplayContains(
- array('command' => 'dev:module:observer:list', 'area' => 'global'),
+ ['command' => 'dev:module:observer:list', 'area' => 'global'],
self::GLOBAL_EVENT_NAME
);
}
@@ -20,7 +20,7 @@ public function testGlobalList()
public function testCrontabList()
{
$this->assertDisplayContains(
- array('command' => 'dev:module:observer:list', 'area' => 'crontab'),
+ ['command' => 'dev:module:observer:list', 'area' => 'crontab'],
self::CRONTAB_OBSERVER_NAME
);
}
diff --git a/tests/N98/Magento/Command/Developer/TemplateHintsBlocksCommandTest.php b/tests/N98/Magento/Command/Developer/TemplateHintsBlocksCommandTest.php
index 3094e2b06..74e97afa9 100644
--- a/tests/N98/Magento/Command/Developer/TemplateHintsBlocksCommandTest.php
+++ b/tests/N98/Magento/Command/Developer/TemplateHintsBlocksCommandTest.php
@@ -9,20 +9,20 @@ class TemplateHintsBlocksCommandTest extends TestCase
public function testExecute()
{
$this->assertDisplayContains(
- array(
+ [
'command' => 'dev:template-hints-blocks',
'--on' => true,
'store' => 'admin',
- ),
+ ],
'Template Hints Blocks enabled'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'dev:template-hints-blocks',
'--off' => true,
'store' => 'admin',
- ),
+ ],
'Template Hints Blocks disabled'
);
}
diff --git a/tests/N98/Magento/Command/Developer/TemplateHintsCommandTest.php b/tests/N98/Magento/Command/Developer/TemplateHintsCommandTest.php
index 6334673b4..bb0b14572 100644
--- a/tests/N98/Magento/Command/Developer/TemplateHintsCommandTest.php
+++ b/tests/N98/Magento/Command/Developer/TemplateHintsCommandTest.php
@@ -9,20 +9,20 @@ class TemplateHintsCommandTest extends TestCase
public function testExecute()
{
$this->assertDisplayContains(
- array(
+ [
'command' => 'dev:template-hints',
'--on' => true,
'store' => 'admin',
- ),
+ ],
'Template Hints enabled'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'dev:template-hints',
'--off' => true,
'store' => 'admin',
- ),
+ ],
'Template Hints disabled'
);
}
diff --git a/tests/N98/Magento/Command/Eav/Attribute/ViewCommandTest.php b/tests/N98/Magento/Command/Eav/Attribute/ViewCommandTest.php
index 1052bbe13..ac3f18546 100644
--- a/tests/N98/Magento/Command/Eav/Attribute/ViewCommandTest.php
+++ b/tests/N98/Magento/Command/Eav/Attribute/ViewCommandTest.php
@@ -38,11 +38,11 @@ public function setUp()
public function execute()
{
$this->commandTester->execute(
- array(
+ [
'command' => $this->command->getName(),
'entityType' => 'catalog_product',
'attributeCode' => 'sku',
- )
+ ]
);
$result = $this->commandTester->getDisplay();
@@ -61,12 +61,12 @@ public function execute()
public function executeWithException()
{
$this->commandTester->execute(
- array(
+ [
'command' => $this->command->getName(),
'entityType' => 'catalog_product',
'attributeCode' => 'foo_bar_attribute_that_should_never_ever_ever_exist',
- )
+ ]
);
}
diff --git a/tests/N98/Magento/Command/Script/Repository/RunCommandTest.php b/tests/N98/Magento/Command/Script/Repository/RunCommandTest.php
index c6f08a93a..72998f5d7 100644
--- a/tests/N98/Magento/Command/Script/Repository/RunCommandTest.php
+++ b/tests/N98/Magento/Command/Script/Repository/RunCommandTest.php
@@ -17,10 +17,10 @@ public function testExecute()
$config['script']['folders'][] = __DIR__ . '/_scripts';
$application->setConfig($config);
- $input = array(
+ $input = [
'command' => 'script:repo:run',
'script' => 'hello-world',
- );
+ ];
// Runs sys:info -> Check for any output
$this->assertDisplayContains($input, 'Vendors');
diff --git a/tests/N98/Magento/Command/ScriptCommandTest.php b/tests/N98/Magento/Command/ScriptCommandTest.php
index fc1b80d36..57e961535 100644
--- a/tests/N98/Magento/Command/ScriptCommandTest.php
+++ b/tests/N98/Magento/Command/ScriptCommandTest.php
@@ -10,10 +10,10 @@ class ScriptCommandTest extends TestCase
{
public function testExecute()
{
- $input = array(
+ $input = [
'command' => 'script',
'filename' => __DIR__ . '/_files/test.mr',
- );
+ ];
// Check pre defined vars
$this->assertDisplayRegExp($input, '~^\Qmagento.root: \E/.+\R$~m');
diff --git a/tests/N98/Magento/Command/SymlinksCommandTest.php b/tests/N98/Magento/Command/SymlinksCommandTest.php
index 5d00f1764..428afa69b 100644
--- a/tests/N98/Magento/Command/SymlinksCommandTest.php
+++ b/tests/N98/Magento/Command/SymlinksCommandTest.php
@@ -9,20 +9,20 @@ class SymlinksCommandTest extends TestCase
public function testExecute()
{
$this->assertDisplayContains(
- array(
+ [
'command' => 'dev:symlinks',
'--global' => true,
'--on' => true,
- ),
+ ],
'Symlinks allowed'
);
$this->assertDisplayContains(
- array(
+ [
'command' => 'dev:symlinks',
'--global' => true,
'--off' => true,
- ),
+ ],
'Symlinks denied'
);
}
diff --git a/tests/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstractTest.php b/tests/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstractTest.php
index b5c16df30..6e1319096 100644
--- a/tests/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstractTest.php
+++ b/tests/N98/Magento/Command/System/Check/Settings/CookieDomainCheckAbstractTest.php
@@ -17,41 +17,41 @@ class CookieDomainCheckAbstractTest extends \PHPUnit\Framework\TestCase
*/
public function provideCookieDomainsAndBaseUrls()
{
- return array(
- array("", "", false),
- array("https://www.example.com/", "", false),
- array("", ".example.com", false),
- array("https://www.example.com/", ".example.com", true),
- array("https://www.example.com/", "www.example.com", true),
+ return [
+ ["", "", false],
+ ["https://www.example.com/", "", false],
+ ["", ".example.com", false],
+ ["https://www.example.com/", ".example.com", true],
+ ["https://www.example.com/", "www.example.com", true],
- array("https://images.example.com/", "www.example.com", false),
- array("https://images.example.com/", "example.com", true),
- array("https://images.example.com/", ".example.com", true),
- array("https://example.com/", ".example.com", false),
+ ["https://images.example.com/", "www.example.com", false],
+ ["https://images.example.com/", "example.com", true],
+ ["https://images.example.com/", ".example.com", true],
+ ["https://example.com/", ".example.com", false],
- array("https://www.example.com/", ".www.example.com", false),
- array("https://www.example.com/", "wwww.example.com", false),
- array("https://www.example.com/", "ww.example.com", false),
- array("https://www.example.com/", ".ww.example.com", false),
- array("https://www.example.com/", ".w.example.com", false),
- array("https://www.example.com/", "..example.com", false),
+ ["https://www.example.com/", ".www.example.com", false],
+ ["https://www.example.com/", "wwww.example.com", false],
+ ["https://www.example.com/", "ww.example.com", false],
+ ["https://www.example.com/", ".ww.example.com", false],
+ ["https://www.example.com/", ".w.example.com", false],
+ ["https://www.example.com/", "..example.com", false],
// false-positives we know about, there is no check against public suffix list (the co.uk check)
- array("https://www.example.com/", ".com", false),
- array("https://www.example.co.uk/", ".co.uk", true),
- array("https://www.example.co.uk/", "co.uk", true),
+ ["https://www.example.com/", ".com", false],
+ ["https://www.example.co.uk/", ".co.uk", true],
+ ["https://www.example.co.uk/", "co.uk", true],
// go cases
- array('http://go/', 'go', false),
- array('http://go/', '.go', false),
- array('http://go.go/', 'go', false),
- array('http://go.go/', '.go', false),
+ ['http://go/', 'go', false],
+ ['http://go/', '.go', false],
+ ['http://go.go/', 'go', false],
+ ['http://go.go/', '.go', false],
# ... some edge-cases left out
- array('http://www.good.go/', '.good.go', true),
- array('http://www.good.go/', 'www.good.go', true),
- array('http://good.go/', 'www.good.go', false),
- array('http://also.good.go/', 'www.good.go', false),
- );
+ ['http://www.good.go/', '.good.go', true],
+ ['http://www.good.go/', 'www.good.go', true],
+ ['http://good.go/', 'www.good.go', false],
+ ['http://also.good.go/', 'www.good.go', false],
+ ];
}
/**
diff --git a/tests/N98/Magento/Command/System/MaintenanceCommandTest.php b/tests/N98/Magento/Command/System/MaintenanceCommandTest.php
index 6f70d4129..68b861163 100644
--- a/tests/N98/Magento/Command/System/MaintenanceCommandTest.php
+++ b/tests/N98/Magento/Command/System/MaintenanceCommandTest.php
@@ -19,8 +19,7 @@ public function setUp()
$this->maintenanceFile =
$this->getApplication()->getMagentoRootFolder() .
'/' . MaintenanceMode::FLAG_DIR .
- '/' . MaintenanceMode::FLAG_FILENAME
- ;
+ '/' . MaintenanceMode::FLAG_FILENAME;
}
public function testSimpleFlag()
diff --git a/tests/N98/Magento/Command/System/Setup/AbstractSetupCommandTest.php b/tests/N98/Magento/Command/System/Setup/AbstractSetupCommandTest.php
index 4e1a9ac74..b6edc9c8b 100644
--- a/tests/N98/Magento/Command/System/Setup/AbstractSetupCommandTest.php
+++ b/tests/N98/Magento/Command/System/Setup/AbstractSetupCommandTest.php
@@ -19,13 +19,13 @@ public function setUp()
{
$this->command = $this->getMockBuilder('N98\Magento\Command\System\Setup\AbstractSetupCommand')
->disableOriginalConstructor()
- ->setMethods(array('getMagentoModuleList'))
+ ->setMethods(['getMagentoModuleList'])
->getMockForAbstractClass();
$this->command
->expects($this->once())
->method('getMagentoModuleList')
- ->will($this->returnValue(array('Magento_Catalog' => 'info', 'Magento_Customer' => 'info')));
+ ->will($this->returnValue(['Magento_Catalog' => 'info', 'Magento_Customer' => 'info']));
}
/**
@@ -46,12 +46,12 @@ public function testShouldReturnModuleNameForExistingModule($moduleName)
*/
public function validModuleNameProvider()
{
- return array(
- array('magento_catalog'),
- array('magento_customer'),
- array('Magento_Catalog'),
- array('MaGeNtO_cUstOmeR'),
- );
+ return [
+ ['magento_catalog'],
+ ['magento_customer'],
+ ['Magento_Catalog'],
+ ['MaGeNtO_cUstOmeR'],
+ ];
}
/**
diff --git a/tests/N98/Magento/Command/System/Setup/ChangeVersionCommandTest.php b/tests/N98/Magento/Command/System/Setup/ChangeVersionCommandTest.php
index ac56d7790..b2d6aea05 100644
--- a/tests/N98/Magento/Command/System/Setup/ChangeVersionCommandTest.php
+++ b/tests/N98/Magento/Command/System/Setup/ChangeVersionCommandTest.php
@@ -36,11 +36,11 @@ public function setUp()
public function testShouldExecuteCorrectlyAndDisplaySuccessMessage()
{
$this->commandTester->execute(
- array(
+ [
'command' => $this->command->getName(),
'module' => 'magento_customer',
'version' => '2.0.0',
- )
+ ]
);
$this->assertContains(
@@ -56,11 +56,11 @@ public function testShouldExecuteCorrectlyAndDisplaySuccessMessage()
public function testExecuteShouldThrowExceptionWhenModuleDoesntExist()
{
$this->commandTester->execute(
- array(
+ [
'command' => $this->command->getName(),
'module' => 'non_existent_module',
'version' => '2.0.0',
- )
+ ]
);
}
}
diff --git a/tests/N98/Magento/Command/System/Setup/CompareVersionsCommandTest.php b/tests/N98/Magento/Command/System/Setup/CompareVersionsCommandTest.php
index 939807624..be6188441 100644
--- a/tests/N98/Magento/Command/System/Setup/CompareVersionsCommandTest.php
+++ b/tests/N98/Magento/Command/System/Setup/CompareVersionsCommandTest.php
@@ -22,10 +22,10 @@ public function testJunit()
$url = vfsStream::url('root/junit.xml');
$this->assertExecute(
- array(
+ [
'command' => 'sys:setup:compare-versions',
'--log-junit' => $url,
- )
+ ]
);
$this->assertFileExists($url);
}
diff --git a/tests/N98/Magento/Command/System/Url/ListCommandTest.php b/tests/N98/Magento/Command/System/Url/ListCommandTest.php
index b46b49c8c..3ee0accb4 100644
--- a/tests/N98/Magento/Command/System/Url/ListCommandTest.php
+++ b/tests/N98/Magento/Command/System/Url/ListCommandTest.php
@@ -8,14 +8,14 @@ class ListCommandTest extends TestCase
{
public function testExecute()
{
- $input = array(
+ $input = [
'linetemplate' => 'prefix {url} suffix',
'command' => 'sys:url:list',
'stores' => 0, // admin store
'--add-categories' => true,
'--add-products' => true,
'--add-cmspages' => true,
- );
+ ];
$this->assertDisplayContains($input, 'prefix');
$this->assertDisplayContains($input, 'http');
diff --git a/tests/N98/Magento/Command/TestCase.php b/tests/N98/Magento/Command/TestCase.php
index c76fa91db..9b22bac6a 100644
--- a/tests/N98/Magento/Command/TestCase.php
+++ b/tests/N98/Magento/Command/TestCase.php
@@ -67,7 +67,7 @@ private function getTestApplication()
/**
* @var array
*/
- private $testers = array();
+ private $testers = [];
/**
* @param string|array $command name or input
@@ -76,9 +76,9 @@ private function getTestApplication()
private function getMagerunTester($command)
{
if (is_string($command)) {
- $input = array(
+ $input = [
'command' => $command,
- );
+ ];
} else {
$input = $command;
}
diff --git a/tests/N98/Magento/TestApplication.php b/tests/N98/Magento/TestApplication.php
index 39f5b4a85..8c05ec8dd 100644
--- a/tests/N98/Magento/TestApplication.php
+++ b/tests/N98/Magento/TestApplication.php
@@ -139,10 +139,10 @@ public function getApplication()
if ($this->application === null) {
$root = $this->getTestMagentoRoot();
- $mockObjectGenerator = new PHPUnit_Framework_MockObject_Generator;
+ $mockObjectGenerator = new PHPUnit_Framework_MockObject_Generator();
/** @var Application|PHPUnit_Framework_MockObject_MockObject $application */
- $application = $mockObjectGenerator->getMock('N98\Magento\Application', array('getMagentoRootFolder'));
+ $application = $mockObjectGenerator->getMock('N98\Magento\Application', ['getMagentoRootFolder']);
// Get the composer bootstraph
if (defined('PHPUNIT_COMPOSER_INSTALL')) {
@@ -181,7 +181,7 @@ public function getApplication()
*/
public static function any()
{
- return new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
+ return new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount();
}
/**
diff --git a/tests/N98/Magento/_ApplicationTest/Modules/test_dummy_module/src/TestModule/FooCommand.php b/tests/N98/Magento/_ApplicationTest/Modules/test_dummy_module/src/TestModule/FooCommand.php
index 39c504d69..6e193f70e 100644
--- a/tests/N98/Magento/_ApplicationTest/Modules/test_dummy_module/src/TestModule/FooCommand.php
+++ b/tests/N98/Magento/_ApplicationTest/Modules/test_dummy_module/src/TestModule/FooCommand.php
@@ -12,8 +12,7 @@ protected function configure()
{
$this
->setName('testmodule:foo')
- ->setDescription('Test command registered in a module')
- ;
+ ->setDescription('Test command registered in a module');
}
/**
diff --git a/tests/N98/Util/Console/Helper/DatabaseHelperTest.php b/tests/N98/Util/Console/Helper/DatabaseHelperTest.php
index d3e1b9e8f..71efb522e 100644
--- a/tests/N98/Util/Console/Helper/DatabaseHelperTest.php
+++ b/tests/N98/Util/Console/Helper/DatabaseHelperTest.php
@@ -147,18 +147,18 @@ public function getTables()
*/
public function resolveTables()
{
- $tables = $this->getHelper()->resolveTables(array('catalog_*'));
+ $tables = $this->getHelper()->resolveTables(['catalog_*']);
$this->assertContains('catalog_product_entity', $tables);
$this->assertNotContains('catalogrule', $tables);
- $definitions = array(
- 'catalog_glob' => array('tables' => array('catalog_*')),
- 'config_glob' => array('tables' => array('core_config_dat?')),
- 'directory' => array('tables' => array('directory_country directory_country_format')),
- );
+ $definitions = [
+ 'catalog_glob' => ['tables' => ['catalog_*']],
+ 'config_glob' => ['tables' => ['core_config_dat?']],
+ 'directory' => ['tables' => ['directory_country directory_country_format']],
+ ];
$tables = $this->getHelper()->resolveTables(
- array('@catalog_glob', '@config_glob', '@directory'),
+ ['@catalog_glob', '@config_glob', '@directory'],
$definitions
);
$this->assertContains('catalog_product_entity', $tables);
diff --git a/tests/N98/Util/Console/Helper/MagentoHelper.php b/tests/N98/Util/Console/Helper/MagentoHelper.php
index 01fe0afee..38c5fcf58 100644
--- a/tests/N98/Util/Console/Helper/MagentoHelper.php
+++ b/tests/N98/Util/Console/Helper/MagentoHelper.php
@@ -33,15 +33,15 @@ public function detectMagentoInStandardFolder()
{
vfsStream::setup('root');
vfsStream::create(
- array(
- 'app' => array(
+ [
+ 'app' => [
'Mage.php' => '',
- ),
- )
+ ],
+ ]
);
$helper = $this->getHelper();
- $helper->detect(vfsStream::url('root'), array());
+ $helper->detect(vfsStream::url('root'), []);
$this->assertEquals(vfsStream::url('root'), $helper->getRootFolder());
$this->assertEquals(\N98\Magento\Application::MAGENTO_MAJOR_VERSION_1, $helper->getMajorVersion());
@@ -54,13 +54,13 @@ public function detectMagentoInHtdocsSubfolder()
{
vfsStream::setup('root');
vfsStream::create(
- array(
- 'htdocs' => array(
- 'app' => array(
+ [
+ 'htdocs' => [
+ 'app' => [
'Mage.php' => '',
- ),
- ),
- )
+ ],
+ ],
+ ]
);
$helper = $this->getHelper();
@@ -68,11 +68,11 @@ public function detectMagentoInHtdocsSubfolder()
// vfs cannot resolve relative path so we do 'root/htdocs' etc.
$helper->detect(
vfsStream::url('root'),
- array(
+ [
vfsStream::url('root/www'),
vfsStream::url('root/public'),
vfsStream::url('root/htdocs'),
- )
+ ]
);
$this->assertEquals(vfsStream::url('root/htdocs'), $helper->getRootFolder());
@@ -86,9 +86,9 @@ public function detectMagentoFailed()
{
vfsStream::setup('root');
vfsStream::create(
- array(
- 'htdocs' => array(),
- )
+ [
+ 'htdocs' => [],
+ ]
);
$helper = $this->getHelper();
@@ -108,16 +108,16 @@ public function detectMagentoInModmanInfrastructure()
{
vfsStream::setup('root');
vfsStream::create(
- array(
+ [
'.basedir' => 'root/htdocs/magento_root',
- 'htdocs' => array(
- 'magento_root' => array(
- 'app' => array(
+ 'htdocs' => [
+ 'magento_root' => [
+ 'app' => [
'Mage.php' => '',
- ),
- ),
- ),
- )
+ ],
+ ],
+ ],
+ ]
);
$helper = $this->getHelper();
@@ -140,14 +140,14 @@ public function detectMagento2InHtdocsSubfolder()
{
vfsStream::setup('root');
vfsStream::create(
- array(
- 'htdocs' => array(
- 'app' => array(
+ [
+ 'htdocs' => [
+ 'app' => [
'autoload.php' => '',
'bootstrap.php' => '',
- ),
- ),
- )
+ ],
+ ],
+ ]
);
$helper = $this->getHelper();
@@ -155,11 +155,11 @@ public function detectMagento2InHtdocsSubfolder()
// vfs cannot resolve relative path so we do 'root/htdocs' etc.
$helper->detect(
vfsStream::url('root'),
- array(
+ [
vfsStream::url('root/www'),
vfsStream::url('root/public'),
vfsStream::url('root/htdocs'),
- )
+ ]
);
$this->assertEquals(vfsStream::url('root/htdocs'), $helper->getRootFolder());
diff --git a/tests/N98/Util/DateTimeTest.php b/tests/N98/Util/DateTimeTest.php
index 82b320a5b..fdcc3dd7b 100644
--- a/tests/N98/Util/DateTimeTest.php
+++ b/tests/N98/Util/DateTimeTest.php
@@ -22,42 +22,42 @@ public function getDifferenceAsString(\DateTime $time1, \DateTime $time2, $expec
*/
public static function getDifferenceAsStringProvider()
{
- return array(
- array(
+ return [
+ [
new \DateTime('2013-12-01', new \DateTimeZone('UTC')),
new \DateTime('2013-12-01', new \DateTimeZone('UTC')),
'0',
- ),
- array(
+ ],
+ [
new \DateTime('2013-12-01 00:00:00', new \DateTimeZone('UTC')),
new \DateTime('2013-12-01 00:00:01', new \DateTimeZone('UTC')),
'1s',
- ),
- array(
+ ],
+ [
new \DateTime('2013-12-01 00:00:00', new \DateTimeZone('UTC')),
new \DateTime('2013-12-01 00:01:01', new \DateTimeZone('UTC')),
'1m 1s',
- ),
- array(
+ ],
+ [
new \DateTime('2013-12-01 00:00:00', new \DateTimeZone('UTC')),
new \DateTime('2013-12-01 01:01:01', new \DateTimeZone('UTC')),
'1h 1m 1s',
- ),
- array(
+ ],
+ [
new \DateTime('2013-12-01 00:00:00', new \DateTimeZone('UTC')),
new \DateTime('2013-12-02 01:01:01', new \DateTimeZone('UTC')),
'1d 1h 1m 1s',
- ),
- array(
+ ],
+ [
new \DateTime('2013-12-01 00:00:00', new \DateTimeZone('UTC')),
new \DateTime('2014-01-02 01:01:01', new \DateTimeZone('UTC')),
'1M 1d 1h 1m 1s',
- ),
- array(
+ ],
+ [
new \DateTime('2013-12-01 00:00:00', new \DateTimeZone('UTC')),
new \DateTime('2015-01-02 01:01:01', new \DateTimeZone('UTC')),
'1Y 1M 1d 1h 1m 1s',
- ),
- );
+ ],
+ ];
}
}
diff --git a/tests/N98/Util/FilesystemTest.php b/tests/N98/Util/FilesystemTest.php
index 851bb0e19..7ac9ac81e 100644
--- a/tests/N98/Util/FilesystemTest.php
+++ b/tests/N98/Util/FilesystemTest.php
@@ -88,7 +88,7 @@ public function testRecursiveCopyWithBlacklist()
touch($file1);
touch($file2);
- $this->fileSystem->recursiveCopy($basePath, $dest, array('ignore.me'));
+ $this->fileSystem->recursiveCopy($basePath, $dest, ['ignore.me']);
$this->assertFileExists($dest . "/folder1/file1.txt");
$this->assertFileExists($dest . "/folder2/file2.txt");
$this->assertFileNotExists($dest . "/folder1/ignore.me");
@@ -217,12 +217,12 @@ public function testConvertBytesToHumanReadable($bytes, $decimalPlaces, $expecte
*/
public static function convertedBytesProvider()
{
- return array(
- array(20000000, 2, '19.07M'),
- array(20000000, 3, '19.073M'),
- array(2000000000, 2, '1.86G'),
- array(2, 2, '2.00B'),
- array(2048, 2, '2.00K'),
- );
+ return [
+ [20000000, 2, '19.07M'],
+ [20000000, 3, '19.073M'],
+ [2000000000, 2, '1.86G'],
+ [2, 2, '2.00B'],
+ [2048, 2, '2.00K'],
+ ];
}
}
diff --git a/tests/N98/Util/OperatingSystemTest.php b/tests/N98/Util/OperatingSystemTest.php
index b1ab5b0f0..7b38e6709 100644
--- a/tests/N98/Util/OperatingSystemTest.php
+++ b/tests/N98/Util/OperatingSystemTest.php
@@ -20,12 +20,12 @@ class OperatingSystemTest extends \PHPUnit\Framework\TestCase
*/
public function osDetection()
{
- $matrix = array(
+ $matrix = [
OperatingSystem::isLinux(),
OperatingSystem::isWindows(),
OperatingSystem::isMacOs(),
OperatingSystem::isNetware(),
- );
+ ];
$this->assertCount(4, $matrix, 'Number of OSes to check for');
$this->assertCount(1, array_filter($matrix), 'One OS must be detected');
diff --git a/tests/N98/Util/ProcessArgumentsTest.php b/tests/N98/Util/ProcessArgumentsTest.php
index 129bb9d6c..a71e2efe7 100644
--- a/tests/N98/Util/ProcessArgumentsTest.php
+++ b/tests/N98/Util/ProcessArgumentsTest.php
@@ -42,11 +42,10 @@ public function chaining()
{
$actual = ProcessArguments::create()
->addArg('command')
- ->addArgs(array('-vvv', '--version-tricks-off', '--', '--' => true))
+ ->addArgs(['-vvv', '--version-tricks-off', '--', '--' => true])
->addArg('--')
- ->addArgs(array('-vvv', '--file' => 'music', '--empty' => true, 'flag' => true))
- ->createBuilder()
- ;
+ ->addArgs(['-vvv', '--file' => 'music', '--empty' => true, 'flag' => true])
+ ->createBuilder();
$this->assertInstanceOf(ProcessBuilder::class, $actual);
$commandLine = $actual->getProcess()->getCommandLine();
$this->assertSame(
diff --git a/tests/N98/Util/StringTest.php b/tests/N98/Util/StringTest.php
index 762e7dbc1..c07f4ba51 100644
--- a/tests/N98/Util/StringTest.php
+++ b/tests/N98/Util/StringTest.php
@@ -21,23 +21,23 @@ public function trimExplodeEmpty($delimiter, $string, $expected)
*/
public static function trimExplodeEmptyProvider()
{
- return array(
- array(
+ return [
+ [
',',
'Foo,Bar',
- array('Foo', 'Bar'),
- ),
- array(
+ ['Foo', 'Bar'],
+ ],
+ [
'#',
' Foo# Bar',
- array('Foo', 'Bar'),
- ),
- array(
+ ['Foo', 'Bar'],
+ ],
+ [
',',
',,Foo, Bar,,',
- array('Foo', 'Bar'),
- ),
- );
+ ['Foo', 'Bar'],
+ ],
+ ];
}
/**
diff --git a/tests/N98/Util/TimeElapsedTest.php b/tests/N98/Util/TimeElapsedTest.php
index 841ca452b..8b1bf5b62 100644
--- a/tests/N98/Util/TimeElapsedTest.php
+++ b/tests/N98/Util/TimeElapsedTest.php
@@ -18,21 +18,21 @@ public function invocation()
public function provideCalculations()
{
- return array(
- array('just now', 0, 0),
- array('just now', 0, null),
- array('1 second ago', 1, 1),
- array('1 second ago', 1, null),
- array('2 seconds ago', 2, 2),
- array('2 seconds ago', 2, null),
- array('1 second ago', ' 2012-12-12T13:44:40Z', 1355319881),
- array(
+ return [
+ ['just now', 0, 0],
+ ['just now', 0, null],
+ ['1 second ago', 1, 1],
+ ['1 second ago', 1, null],
+ ['2 seconds ago', 2, 2],
+ ['2 seconds ago', 2, null],
+ ['1 second ago', ' 2012-12-12T13:44:40Z', 1355319881],
+ [
'85 years, 10 months, 3 weeks, 1 day, 3 hours, 29 minutes, 21 seconds ago',
' 2012-12-12T13:44:40Z',
-1355319881,
'85 years ago',
- ),
- );
+ ],
+ ];
}
/**
diff --git a/tests/N98/Util/VerifyOrDieTest.php b/tests/N98/Util/VerifyOrDieTest.php
index 0844ffde5..c57368d1b 100644
--- a/tests/N98/Util/VerifyOrDieTest.php
+++ b/tests/N98/Util/VerifyOrDieTest.php
@@ -88,10 +88,10 @@ public function nonPortableFilenameThrowsException($filename)
*/
public function provideNonPortableFilenames()
{
- return array(
- array('no-slash-/-in.there'),
- array('windoze-limits-<>:"/\\|?*'),
- array('lets-keep-spaces out'),
- );
+ return [
+ ['no-slash-/-in.there'],
+ ['windoze-limits-<>:"/\\|?*'],
+ ['lets-keep-spaces out'],
+ ];
}
}
diff --git a/tests/N98/Util/WindowsSystemTest.php b/tests/N98/Util/WindowsSystemTest.php
index 3730b3c25..86dafc12b 100644
--- a/tests/N98/Util/WindowsSystemTest.php
+++ b/tests/N98/Util/WindowsSystemTest.php
@@ -31,16 +31,16 @@ public function isProgramInstalled()
*/
public function provideExecutableNames()
{
- return array(
- array("notepad", false),
- array("notepad.com", true),
- array("notepad.exe", true),
- array("notepad.exe.exe", true),
- array("notepad.eXe", true),
- array("notepad.EXE", true),
- array("notepad.bat", true),
- array("notepad.txt", false),
- );
+ return [
+ ["notepad", false],
+ ["notepad.com", true],
+ ["notepad.exe", true],
+ ["notepad.exe.exe", true],
+ ["notepad.eXe", true],
+ ["notepad.EXE", true],
+ ["notepad.bat", true],
+ ["notepad.txt", false],
+ ];
}
/**