diff --git a/Command/MigrationsDiffDoctrineCommand.php b/Command/MigrationsDiffDoctrineCommand.php index 49a3d20..5a6482d 100644 --- a/Command/MigrationsDiffDoctrineCommand.php +++ b/Command/MigrationsDiffDoctrineCommand.php @@ -25,8 +25,7 @@ protected function configure() : void ->setName('doctrine:migrations:diff') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/Command/MigrationsDumpSchemaDoctrineCommand.php b/Command/MigrationsDumpSchemaDoctrineCommand.php index 1cdcad7..ac1262d 100644 --- a/Command/MigrationsDumpSchemaDoctrineCommand.php +++ b/Command/MigrationsDumpSchemaDoctrineCommand.php @@ -24,8 +24,7 @@ protected function configure() : void ->setName('doctrine:migrations:dump-schema') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/Command/MigrationsExecuteDoctrineCommand.php b/Command/MigrationsExecuteDoctrineCommand.php index 64a1f42..dd5261e 100644 --- a/Command/MigrationsExecuteDoctrineCommand.php +++ b/Command/MigrationsExecuteDoctrineCommand.php @@ -24,8 +24,7 @@ protected function configure() : void ->setName('doctrine:migrations:execute') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/Command/MigrationsGenerateDoctrineCommand.php b/Command/MigrationsGenerateDoctrineCommand.php index a2796ce..961fc74 100644 --- a/Command/MigrationsGenerateDoctrineCommand.php +++ b/Command/MigrationsGenerateDoctrineCommand.php @@ -24,8 +24,7 @@ protected function configure() : void ->setName('doctrine:migrations:generate') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/Command/MigrationsLatestDoctrineCommand.php b/Command/MigrationsLatestDoctrineCommand.php index 988e0ae..b734141 100644 --- a/Command/MigrationsLatestDoctrineCommand.php +++ b/Command/MigrationsLatestDoctrineCommand.php @@ -24,8 +24,7 @@ protected function configure() : void ->setName('doctrine:migrations:latest') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/Command/MigrationsMigrateDoctrineCommand.php b/Command/MigrationsMigrateDoctrineCommand.php index e5c9a68..46c12b7 100644 --- a/Command/MigrationsMigrateDoctrineCommand.php +++ b/Command/MigrationsMigrateDoctrineCommand.php @@ -24,8 +24,7 @@ protected function configure() : void ->setName('doctrine:migrations:migrate') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/Command/MigrationsRollupDoctrineCommand.php b/Command/MigrationsRollupDoctrineCommand.php index 683e72c..560ed61 100644 --- a/Command/MigrationsRollupDoctrineCommand.php +++ b/Command/MigrationsRollupDoctrineCommand.php @@ -24,8 +24,7 @@ protected function configure() : void ->setName('doctrine:migrations:rollup') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/Command/MigrationsStatusDoctrineCommand.php b/Command/MigrationsStatusDoctrineCommand.php index 9ec3c13..88cf50c 100644 --- a/Command/MigrationsStatusDoctrineCommand.php +++ b/Command/MigrationsStatusDoctrineCommand.php @@ -24,8 +24,7 @@ protected function configure() : void ->setName('doctrine:migrations:status') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/Command/MigrationsUpToDateDoctrineCommand.php b/Command/MigrationsUpToDateDoctrineCommand.php index fb72d88..1655b09 100644 --- a/Command/MigrationsUpToDateDoctrineCommand.php +++ b/Command/MigrationsUpToDateDoctrineCommand.php @@ -24,8 +24,7 @@ protected function configure() : void ->setName('doctrine:migrations:up-to-date') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/Command/MigrationsVersionDoctrineCommand.php b/Command/MigrationsVersionDoctrineCommand.php index db591ba..8abbc0f 100644 --- a/Command/MigrationsVersionDoctrineCommand.php +++ b/Command/MigrationsVersionDoctrineCommand.php @@ -24,8 +24,7 @@ protected function configure() : void ->setName('doctrine:migrations:version') ->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.') ->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.') - ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.') - ; + ->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.'); } public function initialize(InputInterface $input, OutputInterface $output) : void diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 29b8a4a..a4a5c3e 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -4,6 +4,7 @@ namespace Doctrine\Bundle\MigrationsBundle\DependencyInjection; +use ReflectionClass; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; use function constant; @@ -45,7 +46,7 @@ public function getConfigTreeBuilder() : TreeBuilder ->scalarNode('organize_migrations')->defaultValue(false) ->info('Organize migrations mode. Possible values are: "BY_YEAR", "BY_YEAR_AND_MONTH", false') ->validate() - ->ifTrue(function ($v) use ($organizeMigrationModes) { + ->ifTrue(static function ($v) use ($organizeMigrationModes) { if ($v === false) { return false; } @@ -60,13 +61,12 @@ public function getConfigTreeBuilder() : TreeBuilder ->end() ->validate() ->ifString() - ->then(function ($v) { + ->then(static function ($v) { return constant('Doctrine\Migrations\Configuration\Configuration::VERSIONS_ORGANIZATION_' . strtoupper($v)); }) ->end() ->end() - ->end() - ; + ->end(); return $treeBuilder; } @@ -81,7 +81,7 @@ private function getOrganizeMigrationsModes() : array { $constPrefix = 'VERSIONS_ORGANIZATION_'; $prefixLen = strlen($constPrefix); - $refClass = new \ReflectionClass('Doctrine\Migrations\Configuration\Configuration'); + $refClass = new ReflectionClass('Doctrine\Migrations\Configuration\Configuration'); $constsArray = $refClass->getConstants(); $namesArray = []; diff --git a/composer.json b/composer.json index 7909d90..3b6f615 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "require-dev": { "phpunit/phpunit": "^5.7|^6.4|^7.0", "mikey179/vfsStream": "^1.6", - "doctrine/coding-standard": "^4.0", + "doctrine/coding-standard": "^5.0", "phpstan/phpstan": "^0.9.2", "phpstan/phpstan-strict-rules": "^0.9" }, diff --git a/composer.lock b/composer.lock index 1c702c9..c42a75d 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": "22ff6b6e26c05ae47e40aba5ff1ba68d", + "content-hash": "40b15642b1f4fbd639a9d4d1f9c371f6", "packages": [ { "name": "doctrine/annotations", @@ -2584,28 +2584,28 @@ }, { "name": "doctrine/coding-standard", - "version": "4.0.0", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/coding-standard.git", - "reference": "0469c18a1a4724c278f2879c0dd7b1fa860b52de" + "reference": "bb8de042a25c4fb59a2c55c350dc55cc00227a8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/0469c18a1a4724c278f2879c0dd7b1fa860b52de", - "reference": "0469c18a1a4724c278f2879c0dd7b1fa860b52de", + "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/bb8de042a25c4fb59a2c55c350dc55cc00227a8c", + "reference": "bb8de042a25c4fb59a2c55c350dc55cc00227a8c", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", "php": "^7.1", - "slevomat/coding-standard": "^4.5.0", - "squizlabs/php_codesniffer": "^3.2.3" + "slevomat/coding-standard": "^4.8.0", + "squizlabs/php_codesniffer": "^3.3.2" }, "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { @@ -2627,18 +2627,21 @@ "email": "st.mueller@dzh-online.de" } ], - "description": "Doctrine Coding Standard", - "homepage": "http://www.doctrine-project.org", + "description": "The Doctrine Coding Standard is a set of PHPCS rules applied to all Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/coding-standard.html", "keywords": [ + "checks", "code", "coding", "cs", "doctrine", + "rules", "sniffer", + "sniffs", "standard", "style" ], - "time": "2018-03-03T23:49:15+00:00" + "time": "2018-09-24T19:08:56+00:00" }, { "name": "doctrine/instantiator", @@ -4734,21 +4737,21 @@ }, { "name": "slevomat/coding-standard", - "version": "4.6.3", + "version": "4.8.2", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "76e31b7cb2ce1de53b36430a332daae2db0be549" + "reference": "5e878708a16a75ed11a7d9aa02f50c257065d4fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/76e31b7cb2ce1de53b36430a332daae2db0be549", - "reference": "76e31b7cb2ce1de53b36430a332daae2db0be549", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/5e878708a16a75ed11a7d9aa02f50c257065d4fe", + "reference": "5e878708a16a75ed11a7d9aa02f50c257065d4fe", "shasum": "" }, "require": { "php": "^7.1", - "squizlabs/php_codesniffer": "^3.2.3" + "squizlabs/php_codesniffer": "^3.3.0" }, "require-dev": { "jakub-onderka/php-parallel-lint": "1.0.0", @@ -4756,7 +4759,7 @@ "phpstan/phpstan": "0.9.2", "phpstan/phpstan-phpunit": "0.9.4", "phpstan/phpstan-strict-rules": "0.9", - "phpunit/phpunit": "7.2.4" + "phpunit/phpunit": "7.3.5" }, "type": "phpcodesniffer-standard", "autoload": { @@ -4769,20 +4772,20 @@ "MIT" ], "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "time": "2018-06-29T20:25:43+00:00" + "time": "2018-09-25T06:49:15+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.3.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "628a481780561150481a9ec74709092b9759b3ec" + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/628a481780561150481a9ec74709092b9759b3ec", - "reference": "628a481780561150481a9ec74709092b9759b3ec", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e", "shasum": "" }, "require": { @@ -4820,7 +4823,7 @@ "phpcs", "standards" ], - "time": "2018-07-26T23:47:18+00:00" + "time": "2018-09-23T23:08:17+00:00" }, { "name": "theseer/tokenizer",