Completed
Branch master (01bfb0)
by Nik
03:53
created
src/Application/Application.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -105,8 +105,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
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/Application/Command/InitCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -142,8 +142,7 @@
 block discarded – undo
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
             }
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.