Completed
Push — master ( 2254f4...00cf4f )
by Nik
02:41
created
src/Application/Command/InitCommand.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     protected function initialize(InputInterface $input, OutputInterface $output)
86 86
     {
87
-        $this->tmplDir = __DIR__ . '/../../../tmpl';
87
+        $this->tmplDir = __DIR__.'/../../../tmpl';
88 88
         $this->questionHelper = $this->getHelper('question');
89 89
         
90 90
         parent::initialize($input, $output);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $this->createEnvironmentsDir($input, $output);
101 101
         $this->createConfiguration($input, $output);
102 102
         
103
-        $output->writeln('<info>' . static::COMPLETED_LOGO . '</info>');
103
+        $output->writeln('<info>'.static::COMPLETED_LOGO.'</info>');
104 104
     }
105 105
 
106 106
     /**
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
111 111
      */
112 112
     protected function createEnvironmentsDir(InputInterface $input, OutputInterface $output)
113 113
     {
114
-        $targetDir = getcwd() . '/' . $this->envDir;
115
-        $tmplDir = $this->tmplDir . '/environments';
114
+        $targetDir = getcwd().'/'.$this->envDir;
115
+        $tmplDir = $this->tmplDir.'/environments';
116 116
         
117 117
         $output->writeln('  - Environment settings');
118 118
         
119 119
         if (file_exists($targetDir))
120 120
         {
121 121
             $question = new ConfirmationQuestion(
122
-                '    <error>Directory ' . $targetDir . ' already exists</error>' . PHP_EOL 
122
+                '    <error>Directory '.$targetDir.' already exists</error>'.PHP_EOL 
123 123
                 . '    <info>Overwrite? [Y/n]</info> ',
124 124
                 true,
125 125
                 '/^(y|j)/i'
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 
138 138
         foreach ($iterator as $item)
139 139
         {
140
-            $itemPath = $targetDir . '/' . $iterator->getSubPathName();
140
+            $itemPath = $targetDir.'/'.$iterator->getSubPathName();
141 141
 
142 142
             if ($item->isDir())
143 143
             {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             }
150 150
         }
151 151
         
152
-        $output->writeln('    Created directory settings of environments: <comment>' . $targetDir . '</comment>');
152
+        $output->writeln('    Created directory settings of environments: <comment>'.$targetDir.'</comment>');
153 153
     }
154 154
 
155 155
     /**
@@ -160,14 +160,14 @@  discard block
 block discarded – undo
160 160
      */
161 161
     protected function createConfiguration(InputInterface $input, OutputInterface $output)
162 162
     {
163
-        $path = $this->getApplication()->getRoot() . '/.jedi.php';
163
+        $path = $this->getApplication()->getRoot().'/.jedi.php';
164 164
 
165 165
         $output->writeln('  - Configuration');
166 166
 
167 167
         if (file_exists($path))
168 168
         {
169 169
             $question = new ConfirmationQuestion(
170
-                '    <error>Configuration file ' . $path . ' already exists</error>' . PHP_EOL
170
+                '    <error>Configuration file '.$path.' already exists</error>'.PHP_EOL
171 171
                 . '    <info>Overwrite? [Y/n]</info> ',
172 172
                 true,
173 173
                 '/^(y|j)/i'
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
         $fs = new Filesystem();
183 183
         
184 184
         $question = new Question('    <info>Enter path to web directory relative to ' 
185
-            . $this->getApplication()->getRoot(). ':</info> ' . PHP_EOL 
186
-            . '    (or do not specify if you are already in the web directory)' . PHP_EOL);
185
+            . $this->getApplication()->getRoot().':</info> '.PHP_EOL 
186
+            . '    (or do not specify if you are already in the web directory)'.PHP_EOL);
187 187
         
188
-        $question->setValidator(function ($answer) use ($fs) {
188
+        $question->setValidator(function($answer) use ($fs) {
189 189
             $path = $answer;
190 190
             
191 191
             if ($answer === null)
@@ -194,12 +194,12 @@  discard block
 block discarded – undo
194 194
             }
195 195
             elseif (!$fs->isAbsolutePath($answer))
196 196
             {
197
-                $path = $this->getApplication()->getRoot() . '/' . $answer;
197
+                $path = $this->getApplication()->getRoot().'/'.$answer;
198 198
             }
199 199
             
200 200
             if (!is_dir($path))
201 201
             {
202
-                throw new \RuntimeException('Directory "' . $path . '" is missing');
202
+                throw new \RuntimeException('Directory "'.$path.'" is missing');
203 203
             }
204 204
             
205 205
             return $answer;
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         
208 208
         $webDir = $this->questionHelper->ask($input, $output, $question);
209 209
 
210
-        $content = file_get_contents($this->tmplDir . '/.jedi.php');
210
+        $content = file_get_contents($this->tmplDir.'/.jedi.php');
211 211
         $content = str_replace(
212 212
             ['%web-dir%', '%env-dir%'], 
213 213
             [addslashes($webDir), addslashes($this->envDir)],
@@ -215,6 +215,6 @@  discard block
 block discarded – undo
215 215
         );
216 216
         $fs->dumpFile($path, $content);
217 217
 
218
-        $output->writeln('    Created configuration file of application <comment>' . $path . '</comment>');
218
+        $output->writeln('    Created configuration file of application <comment>'.$path.'</comment>');
219 219
     }
220 220
 }
221 221
\ No newline at end of file
Please login to merge, or discard this patch.