Failed Conditions
Pull Request — master (#537)
by Luís
07:20
created
lib/Doctrine/DBAL/Migrations/Version.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     /** @var SchemaDiffProviderInterface */
104 104
     private $schemaProvider;
105 105
 
106
-    public function __construct(Configuration $configuration, $version, $class, SchemaDiffProviderInterface $schemaProvider=null)
106
+    public function __construct(Configuration $configuration, $version, $class, SchemaDiffProviderInterface $schemaProvider = null)
107 107
     {
108 108
         $this->configuration = $configuration;
109 109
         $this->outputWriter = $configuration->getOutputWriter();
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         if ($schemaProvider !== null) {
116 116
             $this->schemaProvider = $schemaProvider;
117 117
         }
118
-        if($schemaProvider === null) {
118
+        if ($schemaProvider === null) {
119 119
             $schemaProvider = new SchemaDiffProvider($this->connection->getSchemaManager(),
120 120
                 $this->connection->getDatabasePlatform());
121 121
             $this->schemaProvider = LazySchemaDiffProvider::fromDefaultProxyFactoryConfiguration($schemaProvider);
@@ -221,11 +221,11 @@  discard block
 block discarded – undo
221 221
     {
222 222
         $queries = $this->execute($direction, true);
223 223
 
224
-        if ( ! empty($this->params)) {
224
+        if (!empty($this->params)) {
225 225
             throw MigrationException::migrationNotConvertibleToSql($this->class);
226 226
         }
227 227
 
228
-        $this->outputWriter->write("\n-- Version " . $this->version . "\n");
228
+        $this->outputWriter->write("\n-- Version ".$this->version."\n");
229 229
 
230 230
         $sqlQueries = [$this->version => $queries];
231 231
 
@@ -284,12 +284,12 @@  discard block
 block discarded – undo
284 284
             $this->state = self::STATE_PRE;
285 285
             $fromSchema = $this->schemaProvider->createFromSchema();
286 286
 
287
-            $this->migration->{'pre' . ucfirst($direction)}($fromSchema);
287
+            $this->migration->{'pre'.ucfirst($direction)}($fromSchema);
288 288
 
289 289
             if ($direction === self::DIRECTION_UP) {
290
-                $this->outputWriter->write("\n" . sprintf('  <info>++</info> migrating <comment>%s</comment>', $this->version) . "\n");
290
+                $this->outputWriter->write("\n".sprintf('  <info>++</info> migrating <comment>%s</comment>', $this->version)."\n");
291 291
             } else {
292
-                $this->outputWriter->write("\n" . sprintf('  <info>--</info> reverting <comment>%s</comment>', $this->version) . "\n");
292
+                $this->outputWriter->write("\n".sprintf('  <info>--</info> reverting <comment>%s</comment>', $this->version)."\n");
293 293
             }
294 294
 
295 295
             $this->state = self::STATE_EXEC;
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
             $this->executeRegisteredSql($dryRun, $timeAllQueries);
303 303
 
304 304
             $this->state = self::STATE_POST;
305
-            $this->migration->{'post' . ucfirst($direction)}($toSchema);
305
+            $this->migration->{'post'.ucfirst($direction)}($toSchema);
306 306
 
307
-            if (! $dryRun) {
307
+            if (!$dryRun) {
308 308
                 if ($direction === self::DIRECTION_UP) {
309 309
                     $this->markMigrated();
310 310
                 } else {
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
                 }
346 346
             }
347 347
 
348
-            $this->outputWriter->write(sprintf("\n  <info>SS</info> skipped (Reason: %s)",  $e->getMessage()));
348
+            $this->outputWriter->write(sprintf("\n  <info>SS</info> skipped (Reason: %s)", $e->getMessage()));
349 349
 
350 350
             $this->state = self::STATE_NONE;
351 351
 
@@ -411,13 +411,13 @@  discard block
 block discarded – undo
411 411
 
412 412
     private function executeRegisteredSql($dryRun = false, $timeAllQueries = false)
413 413
     {
414
-        if (! $dryRun) {
414
+        if (!$dryRun) {
415 415
             if (!empty($this->sql)) {
416 416
                 foreach ($this->sql as $key => $query) {
417 417
                     $queryStart = microtime(true);
418 418
 
419
-                    if ( ! isset($this->params[$key])) {
420
-                        $this->outputWriter->write('     <comment>-></comment> ' . $query);
419
+                    if (!isset($this->params[$key])) {
420
+                        $this->outputWriter->write('     <comment>-></comment> '.$query);
421 421
                         $this->connection->executeQuery($query);
422 422
                     } else {
423 423
                         $this->outputWriter->write(sprintf('    <comment>-</comment> %s (with parameters)', $query));
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@
 block discarded – undo
234 234
          * properly, so I had to violate LoD here (so please, let's find a way to solve it on v2).
235 235
          */
236 236
         return $this->configuration->getQueryWriter()
237
-                                   ->write($path, $direction, $sqlQueries);
237
+                                    ->write($path, $direction, $sqlQueries);
238 238
     }
239 239
 
240 240
     /**
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/AbstractCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -77,10 +77,10 @@
 block discarded – undo
77 77
     {
78 78
         $name = $configuration->getName();
79 79
         $name = $name ? $name : 'Doctrine Database Migrations';
80
-        $name = str_repeat(' ', 20) . $name . str_repeat(' ', 20);
81
-        $output->writeln('<question>' . str_repeat(' ', strlen($name)) . '</question>');
82
-        $output->writeln('<question>' . $name . '</question>');
83
-        $output->writeln('<question>' . str_repeat(' ', strlen($name)) . '</question>');
80
+        $name = str_repeat(' ', 20).$name.str_repeat(' ', 20);
81
+        $output->writeln('<question>'.str_repeat(' ', strlen($name)).'</question>');
82
+        $output->writeln('<question>'.$name.'</question>');
83
+        $output->writeln('<question>'.str_repeat(' ', strlen($name)).'</question>');
84 84
         $output->writeln('');
85 85
     }
86 86
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/FileQueryWriter.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -42,6 +42,9 @@
 block discarded – undo
42 42
      */
43 43
     private $outputWriter;
44 44
 
45
+    /**
46
+     * @param OutputWriter $outputWriter
47
+     */
45 48
     public function __construct(string $columnName, string $tableName, ?OutputWriter $outputWriter)
46 49
     {
47 50
         $this->columnName   = $columnName;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
  * <http://www.doctrine-project.org>.
18 18
  */
19 19
 
20
-declare(strict_types=1);
20
+declare(strict_types = 1);
21 21
 
22 22
 namespace Doctrine\DBAL\Migrations;
23 23
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/QueryWriter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
  * <http://www.doctrine-project.org>.
18 18
  */
19 19
 
20
-declare(strict_types=1);
20
+declare(strict_types = 1);
21 21
 
22 22
 namespace Doctrine\DBAL\Migrations;
23 23
 
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/SqlFileWriter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $string = $this->buildMigrationFile($queriesByVersion, $direction);
79 79
 
80 80
         if ($this->outputWriter) {
81
-            $this->outputWriter->write("\n" . sprintf('Writing migration file to "<info>%s</info>"', $path));
81
+            $this->outputWriter->write("\n".sprintf('Writing migration file to "<info>%s</info>"', $path));
82 82
         }
83 83
 
84 84
         return file_put_contents($path, $string);
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
         $string = sprintf("-- Doctrine Migration File Generated on %s\n", date('Y-m-d H:i:s'));
90 90
 
91 91
         foreach ($queriesByVersion as $version => $queries) {
92
-            $string .= "\n-- Version " . $version . "\n";
92
+            $string .= "\n-- Version ".$version."\n";
93 93
 
94 94
             foreach ($queries as $query) {
95
-                $string .= $query . ";\n";
95
+                $string .= $query.";\n";
96 96
             }
97 97
 
98 98
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
         if (is_dir($path)) {
121 121
             $path = realpath($path);
122
-            $path = $path . '/doctrine_migration_' . date('YmdHis') . '.sql';
122
+            $path = $path.'/doctrine_migration_'.date('YmdHis').'.sql';
123 123
         }
124 124
 
125 125
         return $path;
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Migration.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
          * properly, so I had to violate LoD here (so please, let's find a way to solve it on v2).
101 101
          */
102 102
         return $this->configuration->getQueryWriter()
103
-                                   ->write($path, $direction, $sql);
103
+                                    ->write($path, $direction, $sql);
104 104
     }
105 105
 
106 106
     /**
Please login to merge, or discard this patch.