@@ -7,9 +7,7 @@ |
||
| 7 | 7 | use Symfony\Component\Console\Input\InputOption; |
| 8 | 8 | use Symfony\Component\Console\Output\OutputInterface; |
| 9 | 9 | use Symfony\Component\HttpKernel\Bundle\BundleInterface; |
| 10 | - |
|
| 11 | 10 | use Doctrine\Common\DataFixtures\Executor\ORMExecutor; |
| 12 | - |
|
| 13 | 11 | use RDV\Bundle\MigrationBundle\Migration\Loader\DataFixturesLoader; |
| 14 | 12 | |
| 15 | 13 | class LoadDataFixturesCommand extends ContainerAwareCommand |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | |
| 149 | 149 | $executor = new ORMExecutor($this->getContainer()->get('doctrine.orm.entity_manager')); |
| 150 | 150 | $executor->setLogger( |
| 151 | - function ($message) use ($output) { |
|
| 151 | + function($message) use ($output) { |
|
| 152 | 152 | $output->writeln(sprintf(' <comment>></comment> <info>%s</info>', $message)); |
| 153 | 153 | } |
| 154 | 154 | ); |
@@ -3,10 +3,8 @@ |
||
| 3 | 3 | namespace RDV\Bundle\MigrationBundle\Event; |
| 4 | 4 | |
| 5 | 5 | use Doctrine\DBAL\Connection; |
| 6 | - |
|
| 7 | 6 | use Doctrine\DBAL\DBALException; |
| 8 | 7 | use Symfony\Component\EventDispatcher\Event; |
| 9 | - |
|
| 10 | 8 | use RDV\Bundle\MigrationBundle\Migration\Migration; |
| 11 | 9 | |
| 12 | 10 | class MigrationEvent extends Event |
@@ -3,10 +3,8 @@ |
||
| 3 | 3 | namespace RDV\Bundle\MigrationBundle\Migration\Loader; |
| 4 | 4 | |
| 5 | 5 | use Doctrine\ORM\EntityManager; |
| 6 | - |
|
| 7 | 6 | use Symfony\Component\DependencyInjection\ContainerInterface; |
| 8 | 7 | use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader; |
| 9 | - |
|
| 10 | 8 | use RDV\Bundle\MigrationBundle\Entity\DataFixture; |
| 11 | 9 | use RDV\Bundle\MigrationBundle\Migration\Sorter\DataFixturesSorter; |
| 12 | 10 | use RDV\Bundle\MigrationBundle\Migration\UpdateDataFixturesFixture; |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | use Symfony\Component\HttpKernel\Bundle\BundleInterface; |
| 11 | 11 | use Symfony\Component\HttpKernel\KernelInterface; |
| 12 | 12 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
| 13 | - |
|
| 14 | 13 | use RDV\Bundle\MigrationBundle\Migration\Migration; |
| 15 | 14 | use RDV\Bundle\MigrationBundle\Migration\MigrationState; |
| 16 | 15 | use RDV\Bundle\MigrationBundle\Migration\Installation; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | if (!empty($bundleMigrationDirectories)) { |
| 176 | 176 | uksort( |
| 177 | 177 | $bundleMigrationDirectories, |
| 178 | - function ($a, $b) { |
|
| 178 | + function($a, $b) { |
|
| 179 | 179 | return version_compare($a, $b); |
| 180 | 180 | } |
| 181 | 181 | ); |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | if (isset($groupedMigrations[$bundleName])) { |
| 294 | 294 | foreach ($groupedMigrations[$bundleName] as $version => $versionedMigrations) { |
| 295 | 295 | foreach ($versionedMigrations as $migration) { |
| 296 | - $result[] = new MigrationState( |
|
| 296 | + $result[] = new MigrationState( |
|
| 297 | 297 | $migration, |
| 298 | 298 | $bundleName, |
| 299 | 299 | $version |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | if (count($versionedMigrations) > 1) { |
| 336 | 336 | usort( |
| 337 | 337 | $groupedMigrations[$bundleName][$version], |
| 338 | - function ($a, $b) { |
|
| 338 | + function($a, $b) { |
|
| 339 | 339 | $aOrder = 0; |
| 340 | 340 | if ($a instanceof OrderedMigrationInterface) { |
| 341 | 341 | $aOrder = $a->getOrder(); |
@@ -104,13 +104,13 @@ |
||
| 104 | 104 | '', |
| 105 | 105 | array_merge( |
| 106 | 106 | array_map( |
| 107 | - function ($name) { |
|
| 107 | + function($name) { |
|
| 108 | 108 | return dechex(crc32($name)); |
| 109 | 109 | }, |
| 110 | 110 | $tableNames |
| 111 | 111 | ), |
| 112 | 112 | array_map( |
| 113 | - function ($name) { |
|
| 113 | + function($name) { |
|
| 114 | 114 | return dechex(crc32($name)); |
| 115 | 115 | }, |
| 116 | 116 | $columnNames |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $this->orderedFixtures = $this->fixtures; |
| 62 | 62 | usort( |
| 63 | 63 | $this->orderedFixtures, |
| 64 | - function ($a, $b) { |
|
| 64 | + function($a, $b) { |
|
| 65 | 65 | if ($a instanceof OrderedFixtureInterface && $b instanceof OrderedFixtureInterface) { |
| 66 | 66 | if ($a->getOrder() === $b->getOrder()) { |
| 67 | 67 | return 0; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | if ($usedPrioritySorting) { |
| 101 | 101 | $this->orderedFixtures = array_filter( |
| 102 | 102 | $this->orderedFixtures, |
| 103 | - function ($fixture) { |
|
| 103 | + function($fixture) { |
|
| 104 | 104 | return $fixture instanceof OrderedFixtureInterface; |
| 105 | 105 | } |
| 106 | 106 | ); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * @return bool |
| 122 | 122 | */ |
| 123 | 123 | public function executeUpMigration( |
| 124 | - Schema &$schema, |
|
| 124 | + Schema & $schema, |
|
| 125 | 125 | AbstractPlatform $platform, |
| 126 | 126 | Migration $migration, |
| 127 | 127 | $dryRun = false |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | protected function getTableFromDiff(TableDiff $diff) |
| 309 | 309 | { |
| 310 | 310 | $changedColumns = array_map( |
| 311 | - function (ColumnDiff $columnDiff) { |
|
| 311 | + function(ColumnDiff $columnDiff) { |
|
| 312 | 312 | return $columnDiff->column; |
| 313 | 313 | }, |
| 314 | 314 | $diff->changedColumns |
@@ -176,7 +176,7 @@ |
||
| 176 | 176 | $localColumnNames |
| 177 | 177 | ); |
| 178 | 178 | } |
| 179 | - $constraint = new ForeignKeyConstraint( |
|
| 179 | + $constraint = new ForeignKeyConstraint( |
|
| 180 | 180 | $localColumnNames, |
| 181 | 181 | $foreignTable, |
| 182 | 182 | $foreignColumnNames, |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | public function load(array $config, ContainerBuilder $container) |
| 13 | 13 | { |
| 14 | - $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 14 | + $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 15 | 15 | $loader->load('services.yml'); |
| 16 | 16 | } |
| 17 | 17 | } |