@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $this->tester->execute( |
63 | 63 | [ |
64 | 64 | 'command' => $this->command->getName(), |
65 | - 'dql' => 'SELECT e FROM ' . DateTimeModel::class . ' e', |
|
65 | + 'dql' => 'SELECT e FROM '.DateTimeModel::class.' e', |
|
66 | 66 | ] |
67 | 67 | ) |
68 | 68 | ); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $this->tester->execute( |
81 | 81 | [ |
82 | 82 | 'command' => $this->command->getName(), |
83 | - 'dql' => 'SELECT e FROM ' . DateTimeModel::class . ' e', |
|
83 | + 'dql' => 'SELECT e FROM '.DateTimeModel::class.' e', |
|
84 | 84 | '--show-sql' => 'true', |
85 | 85 | ] |
86 | 86 | ) |
@@ -45,10 +45,10 @@ |
||
45 | 45 | protected function configure() |
46 | 46 | { |
47 | 47 | $this->setName('orm:validate-schema') |
48 | - ->setDescription('Validate the mapping files') |
|
49 | - ->addOption('skip-mapping', null, InputOption::VALUE_NONE, 'Skip the mapping validation check') |
|
50 | - ->addOption('skip-sync', null, InputOption::VALUE_NONE, 'Skip checking if the mapping is in sync with the database') |
|
51 | - ->setHelp('Validate that the mapping files are correct and in sync with the database.'); |
|
48 | + ->setDescription('Validate the mapping files') |
|
49 | + ->addOption('skip-mapping', null, InputOption::VALUE_NONE, 'Skip the mapping validation check') |
|
50 | + ->addOption('skip-sync', null, InputOption::VALUE_NONE, 'Skip checking if the mapping is in sync with the database') |
|
51 | + ->setHelp('Validate that the mapping files are correct and in sync with the database.'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $ui->text('<comment>[SKIPPED] The mapping was not checked.</comment>'); |
47 | 47 | } |
48 | 48 | |
49 | - if (! $skipMapping) { |
|
49 | + if ( ! $skipMapping) { |
|
50 | 50 | $errors = $validator->validateMapping(); |
51 | 51 | |
52 | 52 | if ($errors) { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | if ($input->getOption('skip-sync')) { |
74 | 74 | $ui->text('<comment>[SKIPPED] The database was not checked for synchronicity.</comment>'); |
75 | - } elseif (! $validator->schemaInSyncWithMetadata()) { |
|
75 | + } elseif ( ! $validator->schemaInSyncWithMetadata()) { |
|
76 | 76 | $ui->error('The database schema is not in sync with the current mapping file.'); |
77 | 77 | $exit += 2; |
78 | 78 | } else { |
@@ -45,9 +45,9 @@ |
||
45 | 45 | protected function configure() |
46 | 46 | { |
47 | 47 | $this->setName('orm:ensure-production-settings') |
48 | - ->setDescription('Verify that Doctrine is properly configured for a production environment') |
|
49 | - ->addOption('complete', null, InputOption::VALUE_NONE, 'Flag to also inspect database connection existence.') |
|
50 | - ->setHelp('Verify that Doctrine is properly configured for a production environment.'); |
|
48 | + ->setDescription('Verify that Doctrine is properly configured for a production environment') |
|
49 | + ->addOption('complete', null, InputOption::VALUE_NONE, 'Flag to also inspect database connection existence.') |
|
50 | + ->setHelp('Verify that Doctrine is properly configured for a production environment.'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -46,11 +46,11 @@ |
||
46 | 46 | protected function configure() |
47 | 47 | { |
48 | 48 | $this->setName('orm:generate-proxies') |
49 | - ->setAliases(['orm:generate:proxies']) |
|
50 | - ->setDescription('Generates proxy classes for entity classes') |
|
51 | - ->addArgument('dest-path', InputArgument::OPTIONAL, 'The path to generate your proxy classes. If none is provided, it will attempt to grab from configuration.') |
|
52 | - ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.') |
|
53 | - ->setHelp('Generates proxy classes for entity classes.'); |
|
49 | + ->setAliases(['orm:generate:proxies']) |
|
50 | + ->setDescription('Generates proxy classes for entity classes') |
|
51 | + ->addArgument('dest-path', InputArgument::OPTIONAL, 'The path to generate your proxy classes. If none is provided, it will attempt to grab from configuration.') |
|
52 | + ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be processed.') |
|
53 | + ->setHelp('Generates proxy classes for entity classes.'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -57,19 +57,19 @@ |
||
57 | 57 | $destPath = $em->getConfiguration()->getProxyDir(); |
58 | 58 | } |
59 | 59 | |
60 | - if (! is_dir($destPath)) { |
|
60 | + if ( ! is_dir($destPath)) { |
|
61 | 61 | mkdir($destPath, 0775, true); |
62 | 62 | } |
63 | 63 | |
64 | 64 | $destPath = realpath($destPath); |
65 | 65 | |
66 | - if (! file_exists($destPath)) { |
|
66 | + if ( ! file_exists($destPath)) { |
|
67 | 67 | throw new InvalidArgumentException( |
68 | 68 | sprintf("Proxies destination directory '<info>%s</info>' does not exist.", $em->getConfiguration()->getProxyDir()) |
69 | 69 | ); |
70 | 70 | } |
71 | 71 | |
72 | - if (! is_writable($destPath)) { |
|
72 | + if ( ! is_writable($destPath)) { |
|
73 | 73 | throw new InvalidArgumentException( |
74 | 74 | sprintf("Proxies destination directory '<info>%s</info>' does not have write permissions.", $destPath) |
75 | 75 | ); |
@@ -268,8 +268,8 @@ |
||
268 | 268 | $this->em->clear(); |
269 | 269 | |
270 | 270 | $newUser = $this->em->createQuery('SELECT u, g FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.groups g WHERE u.id = ?1') |
271 | - ->setParameter(1, $user->getId()) |
|
272 | - ->getSingleResult(); |
|
271 | + ->setParameter(1, $user->getId()) |
|
272 | + ->getSingleResult(); |
|
273 | 273 | self::assertCount(0, $newUser->groups); |
274 | 274 | self::assertInstanceOf(ManyToManyAssociationMetadata::class, $newUser->groups->getMapping()); |
275 | 275 |
@@ -294,9 +294,9 @@ discard block |
||
294 | 294 | $user->username = 'gblanco'; |
295 | 295 | $user->status = 'developer'; |
296 | 296 | |
297 | - for ($i=0; $i < $groupCount; ++$i) { |
|
297 | + for ($i = 0; $i < $groupCount; ++$i) { |
|
298 | 298 | $group = new CmsGroup(); |
299 | - $group->name = 'Developers_' . $i; |
|
299 | + $group->name = 'Developers_'.$i; |
|
300 | 300 | $user->addGroup($group); |
301 | 301 | } |
302 | 302 | |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | $user |
429 | 429 | ->getGroups() |
430 | 430 | ->matching($criteria) |
431 | - ->map(static function (CmsGroup $group) { |
|
431 | + ->map(static function(CmsGroup $group) { |
|
432 | 432 | return $group->getName(); |
433 | 433 | }) |
434 | 434 | ->toArray() |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $user |
473 | 473 | ->getTags() |
474 | 474 | ->matching($criteria) |
475 | - ->map(static function (CmsTag $tag) { |
|
475 | + ->map(static function(CmsTag $tag) { |
|
476 | 476 | return $tag->getName(); |
477 | 477 | }) |
478 | 478 | ->toArray() |
@@ -54,8 +54,8 @@ |
||
54 | 54 | $user1 = $this->em->getReference(DDC1400User::class, $user1->id); |
55 | 55 | |
56 | 56 | $this->em->createQuery('SELECT a, s FROM ' . DDC1400Article::class . ' a JOIN a.userStates s WITH s.user = :activeUser') |
57 | - ->setParameter('activeUser', $user1) |
|
58 | - ->getResult(); |
|
57 | + ->setParameter('activeUser', $user1) |
|
58 | + ->getResult(); |
|
59 | 59 | |
60 | 60 | $queryCount = $this->getCurrentQueryCount(); |
61 | 61 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | |
55 | 55 | $user1 = $this->em->getReference(DDC1400User::class, $user1->id); |
56 | 56 | |
57 | - $this->em->createQuery('SELECT a, s FROM ' . DDC1400Article::class . ' a JOIN a.userStates s WITH s.user = :activeUser') |
|
57 | + $this->em->createQuery('SELECT a, s FROM '.DDC1400Article::class.' a JOIN a.userStates s WITH s.user = :activeUser') |
|
58 | 58 | ->setParameter('activeUser', $user1) |
59 | 59 | ->getResult(); |
60 | 60 |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | protected function configure() |
29 | 29 | { |
30 | 30 | $this->setName('orm:schema-tool:drop') |
31 | - ->setDescription('Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output') |
|
32 | - ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.') |
|
33 | - ->addOption('force', 'f', InputOption::VALUE_NONE, "Don't ask for the deletion of the database, but force the operation to run.") |
|
34 | - ->addOption('full-database', null, InputOption::VALUE_NONE, 'Instead of using the Class Metadata to detect the database table schema, drop ALL assets that the database contains.') |
|
35 | - ->setHelp(<<<'EOT' |
|
31 | + ->setDescription('Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output') |
|
32 | + ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.') |
|
33 | + ->addOption('force', 'f', InputOption::VALUE_NONE, "Don't ask for the deletion of the database, but force the operation to run.") |
|
34 | + ->addOption('full-database', null, InputOption::VALUE_NONE, 'Instead of using the Class Metadata to detect the database table schema, drop ALL assets that the database contains.') |
|
35 | + ->setHelp(<<<'EOT' |
|
36 | 36 | Processes the schema and either drop the database schema of EntityManager Storage Connection or generate the SQL output. |
37 | 37 | Beware that the complete database is dropped by this command, even tables that are not relevant to your metadata model. |
38 | 38 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $config->setFilterSchemaAssetsExpression($regexp); |
44 | 44 | EOT |
45 | - ); |
|
45 | + ); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | protected function configure() |
29 | 29 | { |
30 | 30 | $this->setName('orm:schema-tool:create') |
31 | - ->setDescription('Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output') |
|
32 | - ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.') |
|
33 | - ->setHelp(<<<'EOT' |
|
31 | + ->setDescription('Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output') |
|
32 | + ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Instead of trying to apply generated SQLs into EntityManager Storage Connection, output them.') |
|
33 | + ->setHelp(<<<'EOT' |
|
34 | 34 | Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output. |
35 | 35 | |
36 | 36 | <comment>Hint:</comment> If you have a database with tables that should not be managed |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | $config->setFilterSchemaAssetsExpression($regexp); |
41 | 41 | EOT |
42 | - ); |
|
42 | + ); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | protected function configure() |
36 | 36 | { |
37 | 37 | $this->setName($this->name) |
38 | - ->setDescription('Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata') |
|
39 | - ->addOption('complete', null, InputOption::VALUE_NONE, 'If defined, all assets of the database which are not relevant to the current metadata will be dropped.') |
|
40 | - ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Dumps the generated SQL statements to the screen (does not execute them).') |
|
41 | - ->addOption('force', 'f', InputOption::VALUE_NONE, 'Causes the generated SQL statements to be physically executed against your database.') |
|
42 | - ->setHelp(<<<'EOT' |
|
38 | + ->setDescription('Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata') |
|
39 | + ->addOption('complete', null, InputOption::VALUE_NONE, 'If defined, all assets of the database which are not relevant to the current metadata will be dropped.') |
|
40 | + ->addOption('dump-sql', null, InputOption::VALUE_NONE, 'Dumps the generated SQL statements to the screen (does not execute them).') |
|
41 | + ->addOption('force', 'f', InputOption::VALUE_NONE, 'Causes the generated SQL statements to be physically executed against your database.') |
|
42 | + ->setHelp(<<<'EOT' |
|
43 | 43 | The <info>%command.name%</info> command generates the SQL needed to |
44 | 44 | synchronize the database schema with the current mapping metadata of the |
45 | 45 | default entity manager. |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $config->setFilterSchemaAssetsExpression($regexp); |
71 | 71 | EOT |
72 | - ); |
|
72 | + ); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |