@@ -105,8 +105,7 @@ discard block |
||
105 | 105 | { |
106 | 106 | $output->writeln(PHP_EOL . '<error>No configuration loaded.</error> ' |
107 | 107 | . 'Please run <info>init</info> command first'); |
108 | - } |
|
109 | - else |
|
108 | + } else |
|
110 | 109 | { |
111 | 110 | switch ($this->getBitrixStatus()) |
112 | 111 | { |
@@ -179,8 +178,7 @@ discard block |
||
179 | 178 | if ($cliFile === false) |
180 | 179 | { |
181 | 180 | continue; |
182 | - } |
|
183 | - elseif (!Loader::includeModule($module['ID'])) |
|
181 | + } elseif (!Loader::includeModule($module['ID'])) |
|
184 | 182 | { |
185 | 183 | continue; |
186 | 184 | } |
@@ -224,8 +222,7 @@ discard block |
||
224 | 222 | if ($filesystem->isAbsolutePath($this->configuration['web-dir'])) |
225 | 223 | { |
226 | 224 | $this->setDocumentRoot($this->configuration['web-dir']); |
227 | - } |
|
228 | - else |
|
225 | + } else |
|
229 | 226 | { |
230 | 227 | $this->setDocumentRoot($this->getRoot() . '/' . $this->configuration['web-dir']); |
231 | 228 | } |
@@ -258,8 +255,7 @@ discard block |
||
258 | 255 | if ($this->bitrixStatus === static::BITRIX_STATUS_COMPLETE) |
259 | 256 | { |
260 | 257 | return static::BITRIX_STATUS_COMPLETE; |
261 | - } |
|
262 | - elseif (!$this->checkBitrix()) |
|
258 | + } elseif (!$this->checkBitrix()) |
|
263 | 259 | { |
264 | 260 | return static::BITRIX_STATUS_UNAVAILABLE; |
265 | 261 | } |
@@ -284,8 +280,7 @@ discard block |
||
284 | 280 | { |
285 | 281 | $this->bitrixStatus = static::BITRIX_STATUS_COMPLETE; |
286 | 282 | } |
287 | - } |
|
288 | - catch (ConnectionException $e) |
|
283 | + } catch (ConnectionException $e) |
|
289 | 284 | { |
290 | 285 | $this->bitrixStatus = static::BITRIX_STATUS_NO_DB_CONNECTION; |
291 | 286 | } |
@@ -363,12 +358,10 @@ discard block |
||
363 | 358 | if (preg_match("#[^\\\\/a-zA-Z0-9_]#", $file)) |
364 | 359 | { |
365 | 360 | return false; |
366 | - } |
|
367 | - elseif ($arFile[0] === 'bitrix') |
|
361 | + } elseif ($arFile[0] === 'bitrix') |
|
368 | 362 | { |
369 | 363 | return false; |
370 | - } |
|
371 | - elseif ($arFile[2] !== 'tests') |
|
364 | + } elseif ($arFile[2] !== 'tests') |
|
372 | 365 | { |
373 | 366 | return false; |
374 | 367 | } |
@@ -84,7 +84,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -142,8 +142,7 @@ discard block |
||
142 | 142 | if ($item->isDir()) |
143 | 143 | { |
144 | 144 | $fs->mkdir($itemPath); |
145 | - } |
|
146 | - else |
|
145 | + } else |
|
147 | 146 | { |
148 | 147 | $fs->copy($item, $itemPath, true); |
149 | 148 | } |
@@ -191,8 +190,7 @@ discard block |
||
191 | 190 | if ($answer === null) |
192 | 191 | { |
193 | 192 | $path = $this->getApplication()->getRoot(); |
194 | - } |
|
195 | - elseif (!$fs->isAbsolutePath($answer)) |
|
193 | + } elseif (!$fs->isAbsolutePath($answer)) |
|
196 | 194 | { |
197 | 195 | $path = $this->getApplication()->getRoot() . '/' . $answer; |
198 | 196 | } |