@@ -43,12 +43,12 @@ |
||
43 | 43 | return null; |
44 | 44 | } |
45 | 45 | |
46 | - if ( ! file_exists($this->filename)) { |
|
46 | + if (!file_exists($this->filename)) { |
|
47 | 47 | return null; |
48 | 48 | } |
49 | 49 | |
50 | 50 | $params = include $this->filename; |
51 | - if ( ! is_array($params)) { |
|
51 | + if (!is_array($params)) { |
|
52 | 52 | throw new \InvalidArgumentException('The connection file has to return an array with database configuration parameters.'); |
53 | 53 | } |
54 | 54 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | libxml_use_internal_errors(true); |
40 | 40 | $xml = new \DOMDocument(); |
41 | 41 | $xml->load($file); |
42 | - if ( ! $xml->schemaValidate(__DIR__ . DIRECTORY_SEPARATOR . "XML" . DIRECTORY_SEPARATOR . "configuration.xsd")) { |
|
42 | + if (!$xml->schemaValidate(__DIR__.DIRECTORY_SEPARATOR."XML".DIRECTORY_SEPARATOR."configuration.xsd")) { |
|
43 | 43 | libxml_clear_errors(); |
44 | 44 | throw MigrationException::configurationNotValid('XML configuration did not pass the validation test.'); |
45 | 45 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function onMigrationsMigrated(MigrationsEventArgs $args) |
35 | 35 | { |
36 | 36 | $conn = $args->getConnection(); |
37 | - if ( ! $args->isDryRun() && ! $conn->isAutoCommit()) { |
|
37 | + if (!$args->isDryRun() && !$conn->isAutoCommit()) { |
|
38 | 38 | $conn->commit(); |
39 | 39 | } |
40 | 40 | } |
@@ -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(); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function __construct(\Closure $closure = null) |
35 | 35 | { |
36 | 36 | if ($closure === null) { |
37 | - $closure = function ($message) { |
|
37 | + $closure = function($message) { |
|
38 | 38 | }; |
39 | 39 | } |
40 | 40 | $this->closure = $closure; |
@@ -74,7 +74,7 @@ |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | //Show normal version number |
77 | - return $this->configuration->getDateTime($version) . ' (<comment>' . $version . '</comment>)'; |
|
77 | + return $this->configuration->getDateTime($version).' (<comment>'.$version.'</comment>)'; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\DBAL\Migrations; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\DBAL\Migrations; |
6 | 6 |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | { |
62 | 62 | $name = $configuration->getName(); |
63 | 63 | $name = $name ? $name : 'Doctrine Database Migrations'; |
64 | - $name = str_repeat(' ', 20) . $name . str_repeat(' ', 20); |
|
65 | - $output->writeln('<question>' . str_repeat(' ', strlen($name)) . '</question>'); |
|
66 | - $output->writeln('<question>' . $name . '</question>'); |
|
67 | - $output->writeln('<question>' . str_repeat(' ', strlen($name)) . '</question>'); |
|
64 | + $name = str_repeat(' ', 20).$name.str_repeat(' ', 20); |
|
65 | + $output->writeln('<question>'.str_repeat(' ', strlen($name)).'</question>'); |
|
66 | + $output->writeln('<question>'.$name.'</question>'); |
|
67 | + $output->writeln('<question>'.str_repeat(' ', strlen($name)).'</question>'); |
|
68 | 68 | $output->writeln(''); |
69 | 69 | } |
70 | 70 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | protected function getMigrationConfiguration(InputInterface $input, OutputInterface $output) |
89 | 89 | { |
90 | - if ( ! $this->migrationConfiguration) { |
|
90 | + if (!$this->migrationConfiguration) { |
|
91 | 91 | if ($this->getHelperSet()->has('configuration') |
92 | 92 | && $this->getHelperSet()->get('configuration') instanceof ConfigurationHelperInterface) { |
93 | 93 | $configHelper = $this->getHelperSet()->get('configuration'); |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | */ |
119 | 119 | private function getOutputWriter(OutputInterface $output) |
120 | 120 | { |
121 | - if ( ! $this->outputWriter) { |
|
122 | - $this->outputWriter = new OutputWriter(function ($message) use ($output) { |
|
121 | + if (!$this->outputWriter) { |
|
122 | + $this->outputWriter = new OutputWriter(function($message) use ($output) { |
|
123 | 123 | return $output->writeln($message); |
124 | 124 | }); |
125 | 125 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | new ConnectionConfigurationLoader($this->configuration), |
148 | 148 | ] |
149 | 149 | ); |
150 | - $connection = $chainLoader->chosen(); |
|
150 | + $connection = $chainLoader->chosen(); |
|
151 | 151 | |
152 | 152 | if ($connection) { |
153 | 153 | return $this->connection = $connection; |