@@ -60,7 +60,7 @@ |
||
60 | 60 | * instead of any other one. |
61 | 61 | */ |
62 | 62 | if ($input->getOption('configuration')) { |
63 | - $outputWriter->write("Loading configuration from command option: " . $input->getOption('configuration')); |
|
63 | + $outputWriter->write("Loading configuration from command option: ".$input->getOption('configuration')); |
|
64 | 64 | |
65 | 65 | return $this->loadConfig($input->getOption('configuration'), $outputWriter); |
66 | 66 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | $dir = $this->getRealPath($directory); |
40 | 40 | |
41 | - $files = glob(rtrim($dir, '/') . '/Version*.php'); |
|
41 | + $files = glob(rtrim($dir, '/').'/Version*.php'); |
|
42 | 42 | |
43 | 43 | return $this->loadMigrations($files, $namespace); |
44 | 44 | } |
@@ -234,7 +234,7 @@ |
||
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 | /** |
@@ -170,14 +170,14 @@ discard block |
||
170 | 170 | if (is_array($sql)) { |
171 | 171 | foreach ($sql as $key => $query) { |
172 | 172 | $this->sql[] = $query; |
173 | - if ( ! empty($params[$key])) { |
|
173 | + if (!empty($params[$key])) { |
|
174 | 174 | $queryTypes = $types[$key] ?? []; |
175 | 175 | $this->addQueryParams($params[$key], $queryTypes); |
176 | 176 | } |
177 | 177 | } |
178 | 178 | } else { |
179 | 179 | $this->sql[] = $sql; |
180 | - if ( ! empty($params)) { |
|
180 | + if (!empty($params)) { |
|
181 | 181 | $this->addQueryParams($params, $types); |
182 | 182 | } |
183 | 183 | } |
@@ -207,11 +207,11 @@ discard block |
||
207 | 207 | { |
208 | 208 | $queries = $this->execute($direction, true); |
209 | 209 | |
210 | - if ( ! empty($this->params)) { |
|
210 | + if (!empty($this->params)) { |
|
211 | 211 | throw MigrationException::migrationNotConvertibleToSql($this->class); |
212 | 212 | } |
213 | 213 | |
214 | - $this->outputWriter->write("\n-- Version " . $this->version . "\n"); |
|
214 | + $this->outputWriter->write("\n-- Version ".$this->version."\n"); |
|
215 | 215 | |
216 | 216 | $sqlQueries = [$this->version => $queries]; |
217 | 217 | |
@@ -264,12 +264,12 @@ discard block |
||
264 | 264 | $this->state = self::STATE_PRE; |
265 | 265 | $fromSchema = $this->schemaProvider->createFromSchema(); |
266 | 266 | |
267 | - $this->migration->{'pre' . ucfirst($direction)}($fromSchema); |
|
267 | + $this->migration->{'pre'.ucfirst($direction)}($fromSchema); |
|
268 | 268 | |
269 | 269 | if ($direction === self::DIRECTION_UP) { |
270 | - $this->outputWriter->write("\n" . sprintf(' <info>++</info> migrating <comment>%s</comment>', $this->version) . "\n"); |
|
270 | + $this->outputWriter->write("\n".sprintf(' <info>++</info> migrating <comment>%s</comment>', $this->version)."\n"); |
|
271 | 271 | } else { |
272 | - $this->outputWriter->write("\n" . sprintf(' <info>--</info> reverting <comment>%s</comment>', $this->version) . "\n"); |
|
272 | + $this->outputWriter->write("\n".sprintf(' <info>--</info> reverting <comment>%s</comment>', $this->version)."\n"); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | $this->state = self::STATE_EXEC; |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | $this->executeRegisteredSql($dryRun, $timeAllQueries); |
283 | 283 | |
284 | 284 | $this->state = self::STATE_POST; |
285 | - $this->migration->{'post' . ucfirst($direction)}($toSchema); |
|
285 | + $this->migration->{'post'.ucfirst($direction)}($toSchema); |
|
286 | 286 | |
287 | - if ( ! $dryRun) { |
|
287 | + if (!$dryRun) { |
|
288 | 288 | if ($direction === self::DIRECTION_UP) { |
289 | 289 | $this->markMigrated(); |
290 | 290 | } else { |
@@ -392,13 +392,13 @@ discard block |
||
392 | 392 | |
393 | 393 | private function executeRegisteredSql($dryRun = false, $timeAllQueries = false) |
394 | 394 | { |
395 | - if ( ! $dryRun) { |
|
396 | - if ( ! empty($this->sql)) { |
|
395 | + if (!$dryRun) { |
|
396 | + if (!empty($this->sql)) { |
|
397 | 397 | foreach ($this->sql as $key => $query) { |
398 | 398 | $queryStart = microtime(true); |
399 | 399 | |
400 | - if ( ! isset($this->params[$key])) { |
|
401 | - $this->outputWriter->write(' <comment>-></comment> ' . $query); |
|
400 | + if (!isset($this->params[$key])) { |
|
401 | + $this->outputWriter->write(' <comment>-></comment> '.$query); |
|
402 | 402 | $this->connection->executeQuery($query); |
403 | 403 | } else { |
404 | 404 | $this->outputWriter->write(sprintf(' <comment>-</comment> %s (with parameters)', $query)); |
@@ -78,7 +78,7 @@ discard block |
||
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 |
||
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 |
||
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; |
@@ -100,7 +100,7 @@ |
||
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 | /** |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * migrations. |
141 | 141 | */ |
142 | 142 | $migrations = $this->configuration->getMigrations(); |
143 | - if ( ! isset($migrations[$to]) && $to > 0) { |
|
143 | + if (!isset($migrations[$to]) && $to > 0) { |
|
144 | 144 | throw MigrationException::unknownMigrationVersion($to); |
145 | 145 | } |
146 | 146 | |
@@ -155,11 +155,11 @@ discard block |
||
155 | 155 | * means we are already at the destination return an empty array() |
156 | 156 | * to signify that there is nothing left to do. |
157 | 157 | */ |
158 | - if ($from === $to && empty($migrationsToExecute) && ! empty($migrations)) { |
|
158 | + if ($from === $to && empty($migrationsToExecute) && !empty($migrations)) { |
|
159 | 159 | return $this->noMigrations(); |
160 | 160 | } |
161 | 161 | |
162 | - if ( ! $dryRun && false === $this->migrationsCanExecute($confirm)) { |
|
162 | + if (!$dryRun && false === $this->migrationsCanExecute($confirm)) { |
|
163 | 163 | return []; |
164 | 164 | } |
165 | 165 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | /** |
171 | 171 | * If there are no migrations to execute throw an exception. |
172 | 172 | */ |
173 | - if (empty($migrationsToExecute) && ! $this->noMigrationException) { |
|
173 | + if (empty($migrationsToExecute) && !$this->noMigrationException) { |
|
174 | 174 | throw MigrationException::noMigrationsToExecute(); |
175 | 175 | } elseif (empty($migrationsToExecute)) { |
176 | 176 | return $this->noMigrations(); |
@@ -42,6 +42,6 @@ |
||
42 | 42 | */ |
43 | 43 | private static function isACustomPharBuild($gitversion) |
44 | 44 | { |
45 | - return $gitversion !== '@' . 'git-version@'; |
|
45 | + return $gitversion !== '@'.'git-version@'; |
|
46 | 46 | } |
47 | 47 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | public function __construct($em) |
39 | 39 | { |
40 | - if ( ! $this->isEntityManager($em)) { |
|
40 | + if (!$this->isEntityManager($em)) { |
|
41 | 41 | throw new \InvalidArgumentException(sprintf( |
42 | 42 | '$em is not a valid Doctrine ORM Entity Manager, got "%s"', |
43 | 43 | is_object($em) ? get_class($em) : gettype($em) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | return $this->proxyFactory->createProxy( |
72 | 72 | Schema::class, |
73 | - function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) { |
|
73 | + function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) { |
|
74 | 74 | $initializer = null; |
75 | 75 | $wrappedObject = $originalSchemaManipulator->createFromSchema(); |
76 | 76 | |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | { |
88 | 88 | $originalSchemaManipulator = $this->originalSchemaManipulator; |
89 | 89 | |
90 | - if ($fromSchema instanceof LazyLoadingInterface && ! $fromSchema->isProxyInitialized()) { |
|
90 | + if ($fromSchema instanceof LazyLoadingInterface && !$fromSchema->isProxyInitialized()) { |
|
91 | 91 | return $this->proxyFactory->createProxy( |
92 | 92 | Schema::class, |
93 | - function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) { |
|
93 | + function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) { |
|
94 | 94 | $initializer = null; |
95 | 95 | $wrappedObject = $originalSchemaManipulator->createToSchema($fromSchema); |
96 | 96 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function getSqlDiffToMigrate(Schema $fromSchema, Schema $toSchema) |
112 | 112 | { |
113 | 113 | if ($toSchema instanceof LazyLoadingInterface |
114 | - && ! $toSchema->isProxyInitialized()) { |
|
114 | + && !$toSchema->isProxyInitialized()) { |
|
115 | 115 | return []; |
116 | 116 | } |
117 | 117 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $dir = $dir ? $dir : getcwd(); |
47 | 47 | $dir = rtrim($dir, '/'); |
48 | 48 | |
49 | - if ( ! file_exists($dir)) { |
|
49 | + if (!file_exists($dir)) { |
|
50 | 50 | throw new \InvalidArgumentException(sprintf('Migrations directory "%s" does not exist.', $dir)); |
51 | 51 | } |
52 | 52 | |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | |
65 | 65 | private function appendDir($dir) |
66 | 66 | { |
67 | - return DIRECTORY_SEPARATOR . $dir; |
|
67 | + return DIRECTORY_SEPARATOR.$dir; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | private function createDirIfNotExists($dir) |
71 | 71 | { |
72 | - if ( ! file_exists($dir)) { |
|
72 | + if (!file_exists($dir)) { |
|
73 | 73 | mkdir($dir, 0755, true); |
74 | 74 | } |
75 | 75 | } |