Completed
Pull Request — master (#13)
by
unknown
02:32
created
src/Application/Exception/BitrixException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 		if ($ex = $APPLICATION->GetException())
42 42
 		{
43 43
 			throw new static($message ? $message . ': ' . $ex->GetString() : $ex->GetString());
44
-		}
45
-		else
44
+		} else
46 45
 		{
47 46
 			throw new static($message ? $message : 'Unknown exception');
48 47
 		}
Please login to merge, or discard this patch.
src/Environment/Command/InitCommand.php 1 patch
Braces   +12 added lines, -20 removed lines patch added patch discarded remove patch
@@ -86,8 +86,7 @@  discard block
 block discarded – undo
86 86
         if (!is_array($environments))
87 87
         {
88 88
             throw new \Exception('File with description of environments is missing');
89
-        }
90
-        elseif (count($environments) == 0)
89
+        } elseif (count($environments) == 0)
91 90
         {
92 91
             throw new \Exception('Environments not found in description file');
93 92
         }
@@ -100,8 +99,7 @@  discard block
 block discarded – undo
100 99
             {
101 100
                 throw new \Exception('Invalid environment code!');
102 101
             }
103
-        }
104
-        else
102
+        } else
105 103
         {
106 104
             foreach ($environments as $code => $environment)
107 105
             {
@@ -171,8 +169,7 @@  discard block
 block discarded – undo
171 169
             if ($item->isDir())
172 170
             {
173 171
                 $fs->mkdir($itemPath);
174
-            }
175
-            else
172
+            } else
176 173
             {
177 174
                 $fs->copy($item, $itemPath, true);
178 175
             }
@@ -227,10 +224,10 @@  discard block
 block discarded – undo
227 224
         if ($app->getConfiguration())
228 225
         {
229 226
             $app->addCommands(ModuleCommand::getCommands());
230
-            if ($app->getBitrixStatus() != \Notamedia\ConsoleJedi\Application\Application::BITRIX_STATUS_COMPLETE)
231
-                throw new BitrixException('Bitrix core is not available');
232
-        }
233
-        else
227
+            if ($app->getBitrixStatus() != \Notamedia\ConsoleJedi\Application\Application::BITRIX_STATUS_COMPLETE) {
228
+                            throw new BitrixException('Bitrix core is not available');
229
+            }
230
+        } else
234 231
         {
235 232
             throw new BitrixException('No configuration loaded');
236 233
         }
@@ -265,14 +262,12 @@  discard block
 block discarded – undo
265 262
 
266 263
                 $bar->clear();
267 264
                 $output->writeln($message . '<info>ok</info>');
268
-            }
269
-            catch (ModuleInstallException $e)
265
+            } catch (ModuleInstallException $e)
270 266
             {
271 267
                 $bar->clear();
272 268
                 $output->writeln($e->getMessage(), OutputInterface::VERBOSITY_VERBOSE);
273 269
                 $output->writeln($message . '<comment>not registered</comment> (install it in admin panel)');
274
-            }
275
-            catch (ModuleException $e)
270
+            } catch (ModuleException $e)
276 271
             {
277 272
                 $bar->clear();
278 273
                 $output->writeln($e->getMessage(), OutputInterface::VERBOSITY_VERBOSE);
@@ -346,8 +341,7 @@  discard block
 block discarded – undo
346 341
                 if ($serverId && !$input->getOption('memcache-cold-start'))
347 342
                 {
348 343
                     $memcache->Resume($serverId);
349
-                }
350
-                else
344
+                } else
351 345
                 {
352 346
                     $exception = $APPLICATION->GetException();
353 347
                     $message = 'Invalid memcache config with index ' . $index;
@@ -391,13 +385,11 @@  discard block
 block discarded – undo
391 385
                     if (isset($value['value']) && isset($value['siteId']))
392 386
                     {
393 387
                         Option::set($module, $code, $value['value'], $value['siteId']);
394
-                    }
395
-                    else
388
+                    } else
396 389
                     {
397 390
                         $output->writeln('<error>Invalid option for module "' . $module . '" with code "' . $code. '"</error>');
398 391
                     }
399
-                }
400
-                else
392
+                } else
401 393
                 {
402 394
                     Option::set($module, $code, $value);
403 395
 
Please login to merge, or discard this patch.
src/Module/Module.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,8 +73,7 @@  discard block
 block discarded – undo
73 73
 		try
74 74
 		{
75 75
 			$this->getObject();
76
-		}
77
-		catch (Exception\ModuleNotFoundException $e)
76
+		} catch (Exception\ModuleNotFoundException $e)
78 77
 		{
79 78
 			return false;
80 79
 		}
@@ -342,8 +341,7 @@  discard block
 block discarded – undo
342 341
 					\CEventLog::Log("INFO", "MP_MODULE_DOWNLOADED", "main", $key, $value);
343 342
 				}
344 343
 			}
345
-		}
346
-		else
344
+		} else
347 345
 		{
348 346
 			throw new Exception\ModuleUpdateException('[CL04] UpdateStepModules failed. ' . $errorMessage, $this->getName());
349 347
 		}
Please login to merge, or discard this patch.
src/Module/Command/LoadCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,8 +75,7 @@
 block discarded – undo
75 75
 			try
76 76
 			{
77 77
 				$module->register();
78
-			}
79
-			catch (ModuleInstallException $e)
78
+			} catch (ModuleInstallException $e)
80 79
 			{
81 80
 				$output->writeln(sprintf('<comment>%s</comment>', $e->getMessage()), OutputInterface::VERBOSITY_VERBOSE);
82 81
 				$output->writeln(sprintf('Module loaded, but <error>not registered</error>. You need to do it yourself in admin panel.', $module->getName()));
Please login to merge, or discard this patch.
src/Cache/Command/ClearCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
             if (Cache::clearCache(true))
52 52
             {
53 53
                 $output->writeln('<info>All Bitrix cache was deleted</info>');
54
-            }
55
-            else
54
+            } else
56 55
             {
57 56
                 $output->writeln('<error>Error deleting Bitrix cache</error>');
58 57
             }
Please login to merge, or discard this patch.
src/Agent/AgentTrait.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,7 @@
 block discarded – undo
108 108
             {
109 109
                 // @todo warning
110 110
             }
111
-        }
112
-        else
111
+        } else
113 112
         {
114 113
             // @todo warning
115 114
         }
Please login to merge, or discard this patch.
src/Agent/AgentTask.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -200,8 +200,7 @@  discard block
 block discarded – undo
200 200
         if ($this->executionTime instanceof DateTime)
201 201
         {
202 202
             $this->executionTime = $this->executionTime->toString();
203
-        }
204
-        elseif ($this->executionTime === null)
203
+        } elseif ($this->executionTime === null)
205 204
         {
206 205
             $time = new DateTime();
207 206
             $this->executionTime = $time->toString();
@@ -212,8 +211,7 @@  discard block
 block discarded – undo
212 211
             if ($this->$property === true)
213 212
             {
214 213
                 $this->$property = 'Y';
215
-            }
216
-            else
214
+            } else
217 215
             {
218 216
                 $this->$property = 'N';
219 217
             }
Please login to merge, or discard this patch.
src/Application/Command/InitCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
             if (Cache::clearCache(true))
52 52
             {
53 53
                 $output->writeln('<info>All Bitrix cache was deleted</info>');
54
-            }
55
-            else
54
+            } else
56 55
             {
57 56
                 $output->writeln('<error>Error deleting Bitrix cache</error>');
58 57
             }
Please login to merge, or discard this patch.
src/Application/Application.php 1 patch
Braces   +10 added lines, -16 removed lines patch added patch discarded remove patch
@@ -110,8 +110,7 @@  discard block
 block discarded – undo
110 110
         {
111 111
             $output->writeln(PHP_EOL . '<error>No configuration loaded.</error> ' 
112 112
                 . 'Please run <info>init</info> command first');
113
-        }
114
-        else
113
+        } else
115 114
         {
116 115
             switch ($this->getBitrixStatus())
117 116
             {
@@ -184,8 +183,7 @@  discard block
 block discarded – undo
184 183
             if ($cliFile === false)
185 184
             {
186 185
                 continue;
187
-            }
188
-            elseif (!Loader::includeModule($module['ID']))
186
+            } elseif (!Loader::includeModule($module['ID']))
189 187
             {
190 188
                 continue;
191 189
             }
@@ -225,16 +223,16 @@  discard block
 block discarded – undo
225 223
         }
226 224
 
227 225
         //TODO-fox: Проверка на указание в качестве относительного пути /
228
-        if ($this->configuration['web-dir'] == '/')
229
-            $this->configuration['web-dir'] = '';
226
+        if ($this->configuration['web-dir'] == '/') {
227
+                    $this->configuration['web-dir'] = '';
228
+        }
230 229
 
231 230
         $filesystem = new Filesystem();
232 231
         
233 232
         if ($filesystem->isAbsolutePath($this->configuration['web-dir']))
234 233
         {
235 234
             $this->setDocumentRoot($this->configuration['web-dir']);
236
-        }
237
-        else
235
+        } else
238 236
         {
239 237
             $this->setDocumentRoot($this->getRoot() . '/' . $this->configuration['web-dir']);
240 238
         }
@@ -267,8 +265,7 @@  discard block
 block discarded – undo
267 265
         if ($this->bitrixStatus === static::BITRIX_STATUS_COMPLETE)
268 266
         {
269 267
             return static::BITRIX_STATUS_COMPLETE;
270
-        }
271
-        elseif (!$this->checkBitrix())
268
+        } elseif (!$this->checkBitrix())
272 269
         {
273 270
             return static::BITRIX_STATUS_UNAVAILABLE;
274 271
         }
@@ -293,8 +290,7 @@  discard block
 block discarded – undo
293 290
             {
294 291
                 $this->bitrixStatus = static::BITRIX_STATUS_COMPLETE;
295 292
             }
296
-        }
297
-        catch (ConnectionException $e)
293
+        } catch (ConnectionException $e)
298 294
         {
299 295
             $this->bitrixStatus = static::BITRIX_STATUS_NO_DB_CONNECTION;
300 296
         }
@@ -372,12 +368,10 @@  discard block
 block discarded – undo
372 368
             if (preg_match("#[^\\\\/a-zA-Z0-9_]#", $file))
373 369
             {
374 370
                 return false;
375
-            }
376
-            elseif ($arFile[0] === 'bitrix')
371
+            } elseif ($arFile[0] === 'bitrix')
377 372
             {
378 373
                 return false;
379
-            }
380
-            elseif ($arFile[2] !== 'tests')
374
+            } elseif ($arFile[2] !== 'tests')
381 375
             {
382 376
                 return false;
383 377
             }
Please login to merge, or discard this patch.