@@ -15,13 +15,13 @@ |
||
15 | 15 | */ |
16 | 16 | protected function doLoad($file) |
17 | 17 | { |
18 | - if (! class_exists(Yaml::class)) { |
|
18 | + if (!class_exists(Yaml::class)) { |
|
19 | 19 | throw MigrationException::yamlConfigurationNotAvailable(); |
20 | 20 | } |
21 | 21 | |
22 | 22 | $config = Yaml::parse(file_get_contents($file)); |
23 | 23 | |
24 | - if (! is_array($config)) { |
|
24 | + if (!is_array($config)) { |
|
25 | 25 | throw new \InvalidArgumentException('Not valid configuration.'); |
26 | 26 | } |
27 | 27 |
@@ -28,12 +28,12 @@ |
||
28 | 28 | return null; |
29 | 29 | } |
30 | 30 | |
31 | - if (! file_exists($this->filename)) { |
|
31 | + if (!file_exists($this->filename)) { |
|
32 | 32 | return null; |
33 | 33 | } |
34 | 34 | |
35 | 35 | $params = include $this->filename; |
36 | - if (! is_array($params)) { |
|
36 | + if (!is_array($params)) { |
|
37 | 37 | throw new \InvalidArgumentException('The connection file has to return an array with database configuration parameters.'); |
38 | 38 | } |
39 | 39 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | protected function setConfiguration(array $config) |
47 | 47 | { |
48 | 48 | foreach ($config as $configurationKey => $configurationValue) { |
49 | - if (! isset($this->configurationProperties[$configurationKey])) { |
|
49 | + if (!isset($this->configurationProperties[$configurationKey])) { |
|
50 | 50 | $msg = sprintf('Migrations configuration key "%s" does not exist.', $configurationKey); |
51 | 51 | throw MigrationException::configurationNotValid($msg); |
52 | 52 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } elseif (strcasecmp($migrationOrganisation, static::VERSIONS_ORGANIZATION_BY_YEAR_AND_MONTH) === 0) { |
81 | 81 | $this->setMigrationsAreOrganizedByYearAndMonth(); |
82 | 82 | } else { |
83 | - $msg = 'Unknown ' . var_export($migrationOrganisation, true) . ' for configuration "organize_migrations".'; |
|
83 | + $msg = 'Unknown '.var_export($migrationOrganisation, true).' for configuration "organize_migrations".'; |
|
84 | 84 | throw MigrationException::configurationNotValid($msg); |
85 | 85 | } |
86 | 86 | } |
@@ -98,14 +98,14 @@ discard block |
||
98 | 98 | throw MigrationException::configurationFileAlreadyLoaded(); |
99 | 99 | } |
100 | 100 | |
101 | - $path = getcwd() . '/' . $file; |
|
101 | + $path = getcwd().'/'.$file; |
|
102 | 102 | |
103 | 103 | if (file_exists($path)) { |
104 | 104 | $file = $path; |
105 | 105 | } |
106 | 106 | $this->file = $file; |
107 | 107 | |
108 | - if (! file_exists($file)) { |
|
108 | + if (!file_exists($file)) { |
|
109 | 109 | throw new \InvalidArgumentException('Given config file does not exist'); |
110 | 110 | } |
111 | 111 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | protected function getDirectoryRelativeToFile($file, $input) |
117 | 117 | { |
118 | - $path = realpath(dirname($file) . '/' . $input); |
|
118 | + $path = realpath(dirname($file).'/'.$input); |
|
119 | 119 | |
120 | 120 | return ($path !== false) ? $path : $input; |
121 | 121 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | libxml_use_internal_errors(true); |
18 | 18 | $xml = new \DOMDocument(); |
19 | 19 | $xml->load($file); |
20 | - if (! $xml->schemaValidate(__DIR__ . DIRECTORY_SEPARATOR . 'XML' . DIRECTORY_SEPARATOR . 'configuration.xsd')) { |
|
20 | + if (!$xml->schemaValidate(__DIR__.DIRECTORY_SEPARATOR.'XML'.DIRECTORY_SEPARATOR.'configuration.xsd')) { |
|
21 | 21 | libxml_clear_errors(); |
22 | 22 | throw MigrationException::configurationNotValid('XML configuration did not pass the validation test.'); |
23 | 23 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | public function __construct(?\Closure $closure = null) |
16 | 16 | { |
17 | 17 | if ($closure === null) { |
18 | - $closure = function ($message) { |
|
18 | + $closure = function($message) { |
|
19 | 19 | }; |
20 | 20 | } |
21 | 21 | $this->closure = $closure; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $string = $this->buildMigrationFile($queriesByVersion, $direction); |
64 | 64 | |
65 | 65 | if ($this->outputWriter) { |
66 | - $this->outputWriter->write("\n" . sprintf('Writing migration file to "<info>%s</info>"', $path)); |
|
66 | + $this->outputWriter->write("\n".sprintf('Writing migration file to "<info>%s</info>"', $path)); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return file_put_contents($path, $string); |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | $string = sprintf("-- Doctrine Migration File Generated on %s\n", date('Y-m-d H:i:s')); |
78 | 78 | |
79 | 79 | foreach ($queriesByVersion as $version => $queries) { |
80 | - $string .= "\n-- Version " . $version . "\n"; |
|
80 | + $string .= "\n-- Version ".$version."\n"; |
|
81 | 81 | |
82 | 82 | foreach ($queries as $query) { |
83 | - $string .= $query . ";\n"; |
|
83 | + $string .= $query.";\n"; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $string .= $this->getVersionUpdateQuery($version, $direction); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | if (is_dir($path)) { |
108 | 108 | $path = realpath($path); |
109 | - $path = $path . '/doctrine_migration_' . date('YmdHis') . '.sql'; |
|
109 | + $path = $path.'/doctrine_migration_'.date('YmdHis').'.sql'; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return $path; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | public function __construct($em) |
20 | 20 | { |
21 | - if (! $this->isEntityManager($em)) { |
|
21 | + if (!$this->isEntityManager($em)) { |
|
22 | 22 | throw new \InvalidArgumentException(sprintf( |
23 | 23 | '$em is not a valid Doctrine ORM Entity Manager, got "%s"', |
24 | 24 | is_object($em) ? get_class($em) : gettype($em) |