Failed Conditions
Pull Request — master (#535)
by Luís
05:26
created
lib/Doctrine/DBAL/Migrations/Tools/Console/Command/GenerateCommand.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -106,6 +106,11 @@
 block discarded – undo
106 106
         return $this->instanceTemplate;
107 107
     }
108 108
 
109
+    /**
110
+     * @param string $version
111
+     * @param string $up
112
+     * @param string $down
113
+     */
109 114
     protected function generateMigration(Configuration $configuration, InputInterface $input, $version, $up = null, $down = null)
110 115
     {
111 116
         $placeHolders = [
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
         $replacements = [
118 118
             $configuration->getMigrationsNamespace(),
119 119
             $version,
120
-            $up ? "        " . implode("\n        ", explode("\n", $up)) : null,
121
-            $down ? "        " . implode("\n        ", explode("\n", $down)) : null,
120
+            $up ? "        ".implode("\n        ", explode("\n", $up)) : null,
121
+            $down ? "        ".implode("\n        ", explode("\n", $down)) : null,
122 122
         ];
123 123
 
124 124
         $code = str_replace($placeHolders, $replacements, $this->getTemplate());
@@ -126,12 +126,12 @@  discard block
 block discarded – undo
126 126
 
127 127
         $directoryHelper = new MigrationDirectoryHelper($configuration);
128 128
         $dir             = $directoryHelper->getMigrationDirectory();
129
-        $path            = $dir . '/Version' . $version . '.php';
129
+        $path            = $dir.'/Version'.$version.'.php';
130 130
 
131 131
         file_put_contents($path, $code);
132 132
 
133 133
         if ($editorCmd = $input->getOption('editor-cmd')) {
134
-            proc_open($editorCmd . ' ' . escapeshellarg($path), [], $pipes);
134
+            proc_open($editorCmd.' '.escapeshellarg($path), [], $pipes);
135 135
         }
136 136
 
137 137
         return $path;
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
 
152 152
     private function loadTemplateFile(string $customTemplate, OutputInterface $output) : void
153 153
     {
154
-        $customTemplate = getcwd() . '/' . $customTemplate;
154
+        $customTemplate = getcwd().'/'.$customTemplate;
155 155
 
156
-        if ( ! is_file($customTemplate) || ! is_readable($customTemplate)) {
156
+        if (!is_file($customTemplate) || !is_readable($customTemplate)) {
157 157
             throw new \InvalidArgumentException(
158
-                'The specified template "' . $customTemplate . '" cannot be found or is not readable.'
158
+                'The specified template "'.$customTemplate.'" cannot be found or is not readable.'
159 159
             );
160 160
         }
161 161
 
Please login to merge, or discard this patch.