Skip to content

Commit

Permalink
Merge pull request #239 from carusogabriel/doctrine-cs-v5
Browse files Browse the repository at this point in the history
Apply Doctrine CS v5
  • Loading branch information
jwage committed Sep 26, 2018
2 parents 762772a + 170b5df commit cfaa5a0
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 50 deletions.
3 changes: 1 addition & 2 deletions Command/MigrationsDiffDoctrineCommand.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Command/MigrationsDumpSchemaDoctrineCommand.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Command/MigrationsExecuteDoctrineCommand.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Command/MigrationsGenerateDoctrineCommand.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Command/MigrationsLatestDoctrineCommand.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Command/MigrationsMigrateDoctrineCommand.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Command/MigrationsRollupDoctrineCommand.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Command/MigrationsStatusDoctrineCommand.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Command/MigrationsUpToDateDoctrineCommand.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Command/MigrationsVersionDoctrineCommand.php
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions DependencyInjection/Configuration.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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 = [];

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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"
},
Expand Down
51 changes: 27 additions & 24 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cfaa5a0

Please sign in to comment.