Completed
Pull Request — master (#537)
by Luís
14:18
created
lib/Doctrine/DBAL/Migrations/Provider/LazySchemaDiffProvider.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     }
40 40
 
41 41
     /**
42
-     * @return Schema
42
+     * @return \ProxyManager\Proxy\VirtualProxyInterface
43 43
      */
44 44
     public function createFromSchema()
45 45
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
         return $this->proxyFactory->createProxy(
49 49
             Schema::class,
50
-            function (& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) {
50
+            function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator) {
51 51
                 $initializer   = null;
52 52
                 $wrappedObject = $originalSchemaManipulator->createFromSchema();
53 53
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $originalSchemaManipulator = $this->originalSchemaManipulator;
66 66
 
67
-        if ($fromSchema instanceof LazyLoadingInterface && ! $fromSchema->isProxyInitialized()) {
67
+        if ($fromSchema instanceof LazyLoadingInterface && !$fromSchema->isProxyInitialized()) {
68 68
             return $this->proxyFactory->createProxy(
69 69
                 Schema::class,
70
-                function (& $wrappedObject, $proxy,  $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) {
70
+                function(& $wrappedObject, $proxy, $method, array $parameters, & $initializer) use ($originalSchemaManipulator, $fromSchema) {
71 71
                     $initializer   = null;
72 72
                     $wrappedObject = $originalSchemaManipulator->createToSchema($fromSchema);
73 73
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         if (
91 91
             $toSchema instanceof LazyLoadingInterface
92
-            && ! $toSchema->isProxyInitialized()
92
+            && !$toSchema->isProxyInitialized()
93 93
         ) {
94 94
             return [];
95 95
         }
Please login to merge, or discard this patch.
Configuration/Connection/Loader/ConnectionConfigurationLoader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     /** @var Configuration */
31 31
     private $configuration;
32 32
 
33
-    public function __construct(Configuration $configuration=null)
33
+    public function __construct(Configuration $configuration = null)
34 34
     {
35 35
         if ($configuration !== null) {
36 36
             $this->configuration = $configuration;
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/VersionCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     {
93 93
         $this->configuration = $this->getMigrationConfiguration($input, $output);
94 94
 
95
-        if ( ! $input->getOption('add') && ! $input->getOption('delete')) {
95
+        if (!$input->getOption('add') && !$input->getOption('delete')) {
96 96
             throw new \InvalidArgumentException('You must specify whether you want to --add or --delete the specified version.');
97 97
         }
98 98
 
@@ -149,26 +149,26 @@  discard block
 block discarded – undo
149 149
 
150 150
     private function mark($version, $all = false)
151 151
     {
152
-        if ( ! $this->configuration->hasVersion($version)) {
152
+        if (!$this->configuration->hasVersion($version)) {
153 153
             throw MigrationException::unknownMigrationVersion($version);
154 154
         }
155 155
 
156 156
         $version = $this->configuration->getVersion($version);
157 157
         if ($this->markMigrated && $this->configuration->hasVersionMigrated($version)) {
158
-            if (! $all) {
158
+            if (!$all) {
159 159
                 throw new \InvalidArgumentException(sprintf('The version "%s" already exists in the version table.', $version));
160 160
             }
161 161
             $marked = true;
162 162
         }
163 163
 
164
-        if ( ! $this->markMigrated && ! $this->configuration->hasVersionMigrated($version)) {
165
-            if (! $all) {
164
+        if (!$this->markMigrated && !$this->configuration->hasVersionMigrated($version)) {
165
+            if (!$all) {
166 166
                 throw new \InvalidArgumentException(sprintf('The version "%s" does not exists in the version table.', $version));
167 167
             }
168 168
             $marked = false;
169 169
         }
170 170
 
171
-        if ( ! isset($marked)) {
171
+        if (!isset($marked)) {
172 172
             if ($this->markMigrated) {
173 173
                 $version->markMigrated();
174 174
             } else {
Please login to merge, or discard this patch.
Doctrine/DBAL/Migrations/Tools/Console/Helper/MigrationDirectoryHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Tools/Console/Helper/ConfigurationHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
DBAL/Migrations/Tools/Console/Helper/MigrationStatusInfosHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
         }
76 76
 
77 77
         //Show normal version number
78
-        return $this->configuration->getDateTime($version) . ' (<comment>' . $version . '</comment>)';
78
+        return $this->configuration->getDateTime($version).' (<comment>'.$version.'</comment>)';
79 79
     }
80 80
 
81 81
     /** @var Version[] */
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,19 +116,19 @@
 block discarded – undo
116 116
         $replacements = [
117 117
             $configuration->getMigrationsNamespace(),
118 118
             $version,
119
-            $up ? "        " . implode("\n        ", explode("\n", $up)) : null,
120
-            $down ? "        " . implode("\n        ", explode("\n", $down)) : null
119
+            $up ? "        ".implode("\n        ", explode("\n", $up)) : null,
120
+            $down ? "        ".implode("\n        ", explode("\n", $down)) : null
121 121
         ];
122 122
         $code = str_replace($placeHolders, $replacements, $this->getTemplate());
123 123
         $code = preg_replace('/^ +$/m', '', $code);
124 124
         $migrationDirectoryHelper = new MigrationDirectoryHelper($configuration);
125 125
         $dir = $migrationDirectoryHelper->getMigrationDirectory();
126
-        $path = $dir . '/Version' . $version . '.php';
126
+        $path = $dir.'/Version'.$version.'.php';
127 127
 
128 128
         file_put_contents($path, $code);
129 129
 
130 130
         if ($editorCmd = $input->getOption('editor-cmd')) {
131
-            proc_open($editorCmd . ' ' . escapeshellarg($path), [], $pipes);
131
+            proc_open($editorCmd.' '.escapeshellarg($path), [], $pipes);
132 132
         }
133 133
 
134 134
         return $path;
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Configuration/XmlConfiguration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
lib/Doctrine/DBAL/Migrations/Configuration/AbstractFileConfiguration.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
 
62 62
     protected function setConfiguration(array $config)
63 63
     {
64
-        foreach($config as $configurationKey => $configurationValue) {
64
+        foreach ($config as $configurationKey => $configurationValue) {
65 65
             if (!isset($this->configurationProperties[$configurationKey])) {
66 66
                 $msg = sprintf('Migrations configuration key "%s" does not exists.', $configurationKey);
67 67
                 throw MigrationException::configurationNotValid($msg);
68 68
             }
69 69
         }
70
-        foreach($this->configurationProperties as $configurationKey => $configurationSetter) {
70
+        foreach ($this->configurationProperties as $configurationKey => $configurationSetter) {
71 71
             if (isset($config[$configurationKey])) {
72 72
                 $this->{$configurationSetter}($config[$configurationKey]);
73 73
             }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         } else if (strcasecmp($migrationOrganisation, static::VERSIONS_ORGANIZATION_BY_YEAR_AND_MONTH) == 0) {
97 97
             $this->setMigrationsAreOrganizedByYearAndMonth();
98 98
         } else {
99
-            $msg = 'Unknown ' . var_export($migrationOrganisation, true) . ' for configuration "organize_migrations".';
99
+            $msg = 'Unknown '.var_export($migrationOrganisation, true).' for configuration "organize_migrations".';
100 100
             throw MigrationException::configurationNotValid($msg);
101 101
         }
102 102
     }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         if ($this->loaded) {
114 114
             throw MigrationException::configurationFileAlreadyLoaded();
115 115
         }
116
-        if (file_exists($path = getcwd() . '/' . $file)) {
116
+        if (file_exists($path = getcwd().'/'.$file)) {
117 117
             $file = $path;
118 118
         }
119 119
         $this->file = $file;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
     protected function getDirectoryRelativeToFile($file, $input)
130 130
     {
131
-        $path = realpath(dirname($file) . '/' . $input);
131
+        $path = realpath(dirname($file).'/'.$input);
132 132
 
133 133
         return ($path !== false) ? $path : $input;
134 134
     }
Please login to merge, or discard this patch.