Passed
Push — master ( 15b19d...384de0 )
by Nikolay
11:50 queued 06:02
created
src/Core/System/Upgrade/Releases/UpdateConfigsUpToVer2020162.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 
23 23
 class UpdateConfigsUpToVer2020162 extends Injectable implements UpgradeSystemConfigInterface
24 24
 {
25
-  	public const PBX_VERSION = '2020.1.62';
25
+        public const PBX_VERSION = '2020.1.62';
26 26
 
27 27
     private ConfigAlias $config;
28 28
     private MikoPBXConfig $mikoPBXConfig;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,19 +71,19 @@
 block discarded – undo
71 71
 
72 72
 
73 73
         $app_number = '10003246';
74
-        $d_app      = DialplanApplications::findFirst('extension="' . $app_number . '"');
74
+        $d_app      = DialplanApplications::findFirst('extension="'.$app_number.'"');
75 75
         if ($d_app === null) {
76
-            $app_text                = '1,Answer()' . "\n" .
77
-                'n,AGI(cdr_connector.php,${ISTRANSFER}dial_answer)' . "\n" .
78
-                'n,Echo()' . "\n" .
79
-                'n,Hangup()' . "\n";
76
+            $app_text = '1,Answer()'."\n".
77
+                'n,AGI(cdr_connector.php,${ISTRANSFER}dial_answer)'."\n".
78
+                'n,Echo()'."\n".
79
+                'n,Hangup()'."\n";
80 80
             $d_app                   = new DialplanApplications();
81 81
             $d_app->applicationlogic = base64_encode($app_text);
82 82
             $d_app->extension        = $app_number;
83 83
             $d_app->description      = 'Echos audio and video back to the caller as soon as it is received. Used to test connection delay.';
84 84
             $d_app->name             = 'Echo test';
85 85
             $d_app->type             = 'plaintext';
86
-            $d_app->uniqid           = 'DIALPLAN-APPLICATION-' . md5(time());
86
+            $d_app->uniqid           = 'DIALPLAN-APPLICATION-'.md5(time());
87 87
 
88 88
             if ($d_app->save()) {
89 89
                 $extension = Extensions::findFirst("number = '{$app_number}'");
Please login to merge, or discard this patch.
src/Core/System/Upgrade/UpdateSystemConfig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         if ($previous_version !== $current_version) {
47 47
             $upgradeClasses      = [];
48 48
             $upgradeClassesDir   = appPath('src/Core/System/Upgrade/Releases');
49
-            $upgradeClassesFiles = glob($upgradeClassesDir . '/*.php', GLOB_NOSORT);
49
+            $upgradeClassesFiles = glob($upgradeClassesDir.'/*.php', GLOB_NOSORT);
50 50
             foreach ($upgradeClassesFiles as $file) {
51 51
                 $className        = pathinfo($file)['filename'];
52 52
                 $moduleModelClass = "\\MikoPBX\\Core\\System\\Upgrade\\Releases\\{$className}";
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                 if (version_compare($previous_version, $releaseNumber, '<')) {
61 61
                     $processor = new $upgradeClass();
62 62
                     $processor->processUpdate();
63
-                    Util::echoWithSyslog(' - UpdateConfigs: Upgrade system up to ' . $releaseNumber . ' ');
63
+                    Util::echoWithSyslog(' - UpdateConfigs: Upgrade system up to '.$releaseNumber.' ');
64 64
                     Util::echoGreenDone();
65 65
                 }
66 66
             }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         /** @var \MikoPBX\Common\Models\PbxExtensionModules $modules */
81 81
         $modules = PbxExtensionModules::find();
82 82
         foreach ($modules as $module) {
83
-            if ( ! is_dir("{$this->config->path('core.modulesDir')}/{$module->uniqid}")) {
83
+            if (!is_dir("{$this->config->path('core.modulesDir')}/{$module->uniqid}")) {
84 84
                 $module->delete();
85 85
             }
86 86
         }
Please login to merge, or discard this patch.
src/Core/Asterisk/AGI.php 3 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -104,7 +104,8 @@  discard block
 block discarded – undo
104 104
     /**
105 105
      * Считываем переданные скрипту переменные.
106 106
      */
107
-    private function readRequestData(){
107
+    private function readRequestData()
108
+    {
108 109
         if($this->in !== false){
109 110
             $str = PHP_EOL;
110 111
             // read the request
@@ -226,7 +227,7 @@  discard block
 block discarded – undo
226 227
         if ($ret['code'] != AGIRES_OK){
227 228
             // some sort of error
228 229
             $ret['data'] = $str;
229
-        }else{
230
+        } else{
230 231
             // Normal AGI RES OK response
231 232
             $parse    = explode(' ', trim($str));
232 233
             $in_token = false;
@@ -237,15 +238,15 @@  discard block
 block discarded – undo
237 238
                     if ($token[strlen($token) - 1] == ')') {
238 239
                         $in_token = false;
239 240
                     }
240
-                }elseif ($token[0] == '('){
241
+                } elseif ($token[0] == '('){
241 242
                     if ($token[strlen($token) - 1] != ')') {
242 243
                         $in_token = true;
243 244
                     }
244 245
                     $ret['data'] .= ' ' . trim($token, '() ');
245
-                }elseif (strpos($token, '=')){
246
+                } elseif (strpos($token, '=')){
246 247
                     $token          = explode('=', $token);
247 248
                     $ret[$token[0]] = $token[1];
248
-                }elseif ($token != ''){
249
+                } elseif ($token != ''){
249 250
                     $ret['data'] .= ' ' . $token;
250 251
                 }
251 252
             }
@@ -277,9 +278,11 @@  discard block
 block discarded – undo
277 278
         $ret['code'] = substr($str, 0, 3);
278 279
         $str         = trim(substr($str, 3));
279 280
 
280
-        if ($str[0] === '-') // We have a multiline response!
281
+        if ($str[0] === '-') {
282
+            // We have a multiline response!
281 283
         {
282 284
             $count = 0;
285
+        }
283 286
             $str   = substr($str, 1) . "\n";
284 287
             $line  = fgets($this->in, 4096);
285 288
             while (substr($line, 0, 3) != $ret['code'] && $count < 5) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
      */
411 411
     public function hangup($channel = '')
412 412
     {
413
-        return $this->evaluate("HANGUP $channel");
413
+        return $this->evaluate("hangup $channel");
414 414
     }
415 415
 
416 416
     /**
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
             $options = join(',', $options);
577 577
         }
578 578
 
579
-        return $this->evaluate("EXEC $application $options");
579
+        return $this->evaluate("exec $application $options");
580 580
     }
581 581
 
582 582
     /**
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -8,19 +8,19 @@  discard block
 block discarded – undo
8 8
 
9 9
 namespace MikoPBX\Core\Asterisk;
10 10
 
11
-define('AST_DIGIT_ANY',                 '0123456789#*');
12
-define('AGIRES_OK',                     200);
13
-define('AST_STATE_DOWN',                0);
14
-define('AST_STATE_RESERVED',            1);
15
-define('AST_STATE_OFFHOOK',             2);
16
-define('AST_STATE_DIALING',             3);
17
-define('AST_STATE_RING',                4);
18
-define('AST_STATE_RINGING',             5);
19
-define('AST_STATE_UP',                  6);
20
-define('AST_STATE_BUSY',                7);
21
-define('AST_STATE_DIALING_OFFHOOK',     8);
22
-define('AST_STATE_PRERING',             9);
23
-define('AUDIO_FILENO',                  3);
11
+define('AST_DIGIT_ANY', '0123456789#*');
12
+define('AGIRES_OK', 200);
13
+define('AST_STATE_DOWN', 0);
14
+define('AST_STATE_RESERVED', 1);
15
+define('AST_STATE_OFFHOOK', 2);
16
+define('AST_STATE_DIALING', 3);
17
+define('AST_STATE_RING', 4);
18
+define('AST_STATE_RINGING', 5);
19
+define('AST_STATE_UP', 6);
20
+define('AST_STATE_BUSY', 7);
21
+define('AST_STATE_DIALING_OFFHOOK', 8);
22
+define('AST_STATE_PRERING', 9);
23
+define('AUDIO_FILENO', 3);
24 24
 
25 25
 /**
26 26
  * AGI class
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
         $this->conLogBusy = false;
95 95
         ob_implicit_flush(1);
96 96
         // Open stdin & stdout.
97
-        $this->in  = defined('STDIN') ? STDIN  : fopen('php://stdin',  'r');
98
-        $this->out = defined('STDOUT')? STDOUT : fopen('php://stdout', 'w');
97
+        $this->in  = defined('STDIN') ? STDIN  : fopen('php://stdin', 'r');
98
+        $this->out = defined('STDOUT') ? STDOUT : fopen('php://stdout', 'w');
99 99
         $this->request = [];
100 100
 
101 101
         $this->readRequestData();
@@ -104,18 +104,18 @@  discard block
 block discarded – undo
104 104
     /**
105 105
      * Считываем переданные скрипту переменные.
106 106
      */
107
-    private function readRequestData(){
108
-        if($this->in !== false){
107
+    private function readRequestData() {
108
+        if ($this->in !== false) {
109 109
             $str = PHP_EOL;
110 110
             // read the request
111 111
             $resIn = fgets($this->in);
112
-            if($resIn !== false){
112
+            if ($resIn !== false) {
113 113
                 $str = $resIn;
114 114
             }
115 115
             while ($str !== PHP_EOL) {
116 116
                 $this->request[substr($str, 0, strpos($str, ':'))] = trim(substr($str, strpos($str, ':') + 1));
117 117
                 $resIn = fgets($this->in);
118
-                if($resIn === false){
118
+                if ($resIn === false) {
119 119
                     break;
120 120
                 }
121 121
                 $str = $resIn;
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
     {
168 168
         $broken = ['code' => 500, 'result' => -1, 'data' => ''];
169 169
 
170
-        if( !is_resource($this->out) ){
170
+        if (!is_resource($this->out)) {
171 171
             return $broken;
172 172
         }
173 173
 
174
-        if ( !fwrite($this->out, trim($command) . "\n")) {
174
+        if (!fwrite($this->out, trim($command)."\n")) {
175 175
             return $broken;
176 176
         }
177 177
         fflush($this->out);
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         // parse result
180 180
         $str = '';
181 181
         $ret = [];
182
-        if(!$this->evaluateReadResponse($str, $ret)){
182
+        if (!$this->evaluateReadResponse($str, $ret)) {
183 183
             return $broken;
184 184
         }
185 185
 
@@ -196,30 +196,30 @@  discard block
 block discarded – undo
196 196
     private function evaluateParseResponse($str, &$ret):void{
197 197
         $ret['result'] = null;
198 198
         $ret['data']   = '';
199
-        if ($ret['code'] != AGIRES_OK){
199
+        if ($ret['code'] != AGIRES_OK) {
200 200
             // some sort of error
201 201
             $ret['data'] = $str;
202
-        }else{
202
+        } else {
203 203
             // Normal AGI RES OK response
204 204
             $parse    = explode(' ', trim($str));
205 205
             $in_token = false;
206 206
             foreach ($parse as $token) {
207
-                if ($in_token){
207
+                if ($in_token) {
208 208
                     // we previously hit a token starting with ')' but not ending in ')'
209
-                    $ret['data'] .= ' ' . trim($token, '() ');
209
+                    $ret['data'] .= ' '.trim($token, '() ');
210 210
                     if ($token[strlen($token) - 1] == ')') {
211 211
                         $in_token = false;
212 212
                     }
213
-                }elseif ($token[0] == '('){
213
+                }elseif ($token[0] == '(') {
214 214
                     if ($token[strlen($token) - 1] != ')') {
215 215
                         $in_token = true;
216 216
                     }
217
-                    $ret['data'] .= ' ' . trim($token, '() ');
218
-                }elseif (strpos($token, '=')){
217
+                    $ret['data'] .= ' '.trim($token, '() ');
218
+                }elseif (strpos($token, '=')) {
219 219
                     $token          = explode('=', $token);
220 220
                     $ret[$token[0]] = $token[1];
221
-                }elseif ($token != ''){
222
-                    $ret['data'] .= ' ' . $token;
221
+                }elseif ($token != '') {
222
+                    $ret['data'] .= ' '.$token;
223 223
                 }
224 224
             }
225 225
             $ret['data'] = trim($ret['data']);
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      */
235 235
     private function evaluateReadResponse(string & $str, array & $ret): bool{
236 236
         $result = true;
237
-        if(!is_resource($this->in)){
237
+        if (!is_resource($this->in)) {
238 238
             return $result;
239 239
         }
240 240
 
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
         if ($str[0] === '-') // We have a multiline response!
254 254
         {
255 255
             $count = 0;
256
-            $str   = substr($str, 1) . "\n";
256
+            $str   = substr($str, 1)."\n";
257 257
             $line  = fgets($this->in, 4096);
258 258
             while (substr($line, 0, 3) != $ret['code'] && $count < 5) {
259
-                $str   .= $line;
259
+                $str .= $line;
260 260
                 $line  = fgets($this->in, 4096);
261 261
                 $count = (trim($line) == '') ? $count + 1 : 0;
262 262
             }
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
         return $this->exec(
603 603
             'Dial',
604 604
             trim(
605
-                "$type/$identifier" . $this->option_delim . $timeout . $this->option_delim . $options . $this->option_delim . $url,
605
+                "$type/$identifier".$this->option_delim.$timeout.$this->option_delim.$options.$this->option_delim.$url,
606 606
                 $this->option_delim
607 607
             )
608 608
         );
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
      */
623 623
     public function exec_goto($a, $b = null, $c = null)
624 624
     {
625
-        return $this->exec('Goto', trim($a . $this->option_delim . $b . $this->option_delim . $c, $this->option_delim));
625
+        return $this->exec('Goto', trim($a.$this->option_delim.$b.$this->option_delim.$c, $this->option_delim));
626 626
     }
627 627
 
628 628
 
Please login to merge, or discard this patch.
src/PBXCoreREST/Workers/WorkerMergeUploadedFile.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
         if ((int)$settings['resumableTotalSize'] === $resultFileSize){
40 40
             file_put_contents($progress_file, '100');
41 41
         } else {
42
-            Util::sysLogMsg('UploadFile', "File {$settings['fullUploadedFileName']} size {$resultFileSize} does not equal {$settings['resumableTotalSize']}");
42
+            Util::sysLogMsg('UploadFile', "file {$settings['fullUploadedFileName']} size {$resultFileSize} does not equal {$settings['resumableTotalSize']}");
43 43
         }
44 44
 
45 45
         // Delete uploaded file after 10 minutes
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
     public function start($argv): void
20 20
     {
21 21
         $settings_file = trim($argv[1]);
22
-        if ( ! file_exists($settings_file)) {
22
+        if (!file_exists($settings_file)) {
23 23
             Util::sysLogMsg(__CLASS__, 'File with settings not found');
24 24
             return;
25 25
         }
26 26
         $settings = json_decode(file_get_contents($settings_file), true);
27
-        $progress_file = $settings['tempDir'] . '/merging_progress';
27
+        $progress_file = $settings['tempDir'].'/merging_progress';
28 28
         $this->mergeFilesInDirectory(
29 29
             $settings['tempDir'],
30 30
             $settings['resumableFilename'],
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
         // Check filesize is equal uploaded size
37 37
         $resultFileSize = filesize($settings['fullUploadedFileName']);
38
-        if ((int)$settings['resumableTotalSize'] === $resultFileSize){
38
+        if ((int) $settings['resumableTotalSize'] === $resultFileSize) {
39 39
             file_put_contents($progress_file, '100');
40 40
         } else {
41 41
             Util::sysLogMsg('UploadFile', "File {$settings['fullUploadedFileName']} size {$resultFileSize} does not equal {$settings['resumableTotalSize']}");
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         // Delete uploaded file after 10 minutes
45 45
         Util::mwExecBg(
46
-            '/sbin/shell_functions.sh killprocesses ' . $settings['tempDir'] . ' -TERM 0;rm -rf ' . $settings['tempDir'],
46
+            '/sbin/shell_functions.sh killprocesses '.$settings['tempDir'].' -TERM 0;rm -rf '.$settings['tempDir'],
47 47
             '/dev/null',
48 48
             600
49 49
         );
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
         // Restore original file from chunks
70 70
         if (($fp = fopen($result_file, 'w')) !== false) {
71 71
             for ($i = 1; $i <= $total_files; $i++) {
72
-                $tmp_file = $tempDir . '/' . $fileName . '.part' . $i;
72
+                $tmp_file = $tempDir.'/'.$fileName.'.part'.$i;
73 73
                 fwrite($fp, file_get_contents($tmp_file));
74 74
                 unlink($tmp_file);
75
-                $currentProgress = round($i / $total_files * 100)-1; //Up to 99%
75
+                $currentProgress = round($i / $total_files * 100) - 1; //Up to 99%
76 76
                 file_put_contents($progress_file, $currentProgress, 2);
77 77
             }
78 78
             fclose($fp);
79 79
         } else {
80
-            Util::sysLogMsg('UploadFile', 'cannot create the destination file - ' . $result_file);
80
+            Util::sysLogMsg('UploadFile', 'cannot create the destination file - '.$result_file);
81 81
 
82 82
             return;
83 83
         }
84
-        Util::sysLogMsg('UploadFile', 'destination file - ' . $result_file);
84
+        Util::sysLogMsg('UploadFile', 'destination file - '.$result_file);
85 85
     }
86 86
 }
87 87
 
Please login to merge, or discard this patch.
src/Core/Workers/WorkerModelsEvents.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     private int $timeout = 2;
106 106
     private array $arrObject;
107 107
     private array $PRIORITY_R;
108
-    protected int $maxProc=1;
108
+    protected int $maxProc = 1;
109 109
 
110 110
 
111 111
     /**
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         foreach ($additionalModules as $appClass) {
191 191
             // Проверим, зависит ли объект от измененных данных.
192 192
             $dependences = $appClass->dependenceModels();
193
-            if (in_array($called_class, $dependences)){
193
+            if (in_array($called_class, $dependences)) {
194 194
                 // Получаем новые настройки.
195 195
                 $appClass->getSettings();
196 196
             }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                 break;
239 239
             case Codecs::class:
240 240
                 $this->modified_tables[self::R_IAX] = true;
241
-                $this->modified_tables[self::R_SIP]     = true;
241
+                $this->modified_tables[self::R_SIP] = true;
242 242
                 break;
243 243
             case IncomingRoutingTable::class:
244 244
                 $this->modified_tables[self::R_DIALPLAN] = true;
@@ -310,16 +310,16 @@  discard block
 block discarded – undo
310 310
                     $this->modified_tables[self::R_NATS]    = true;
311 311
                 }
312 312
                 if ($this->pbxSettings->itHasTimeZoneSettings()) {
313
-                    $this->modified_tables[self::R_TIMEZONE]    = true;
314
-                    $this->modified_tables[self::R_NGINX]    = true;
315
-                    $this->modified_tables[self::R_PHP_FPM]    = true;
313
+                    $this->modified_tables[self::R_TIMEZONE] = true;
314
+                    $this->modified_tables[self::R_NGINX] = true;
315
+                    $this->modified_tables[self::R_PHP_FPM] = true;
316 316
                     $this->modified_tables[self::R_REST_API_WORKER] = true;
317 317
                 }
318 318
                 if ($this->pbxSettings->itHasNTPSettings()) {
319
-                    $this->modified_tables[self::R_NTP]    = true;
319
+                    $this->modified_tables[self::R_NTP] = true;
320 320
                 }
321 321
                 if ($this->pbxSettings->itHasCallRecordSettings()) {
322
-                    $this->modified_tables[ self::R_CALL_EVENTS_WORKER]  = true;
322
+                    $this->modified_tables[self::R_CALL_EVENTS_WORKER] = true;
323 323
                 }
324 324
                 break;
325 325
             case Sip::class:
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
      */
491 491
     public function reloadNginx(): void
492 492
     {
493
-        $nginxConf  = new NginxConf();
493
+        $nginxConf = new NginxConf();
494 494
         $nginxConf->reStart();
495 495
     }
496 496
 
Please login to merge, or discard this patch.
src/AdminCabinet/Providers/AssetProvider.php 3 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $di->set(
52 52
             self::SERVICE_NAME,
53
-            function () use ($di) {
53
+            function() use ($di) {
54 54
                 $assets = new AssetProvider();
55 55
                 $assets->initializeClassVariables();
56 56
                 $dispatcher = $di->get('dispatcher');
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                     $action = 'index';
64 64
                 }
65 65
                 if ($session !== null && $session->has('versionHash')) {
66
-                    $version = (string)$session->get('versionHash');
66
+                    $version = (string) $session->get('versionHash');
67 67
                 } else {
68 68
                     $version = str_replace(PHP_EOL, '', file_get_contents('/etc/version'));
69 69
                 }
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     {
291 291
         $language   = $di->getShared('language');
292 292
         $langJSFile = "js/cache/localization-{$language}-{$version}.min.js";
293
-        if ( ! file_exists($langJSFile)) {
293
+        if (!file_exists($langJSFile)) {
294 294
             $arrStr = [];
295 295
             foreach ($di->getShared('messages') as $key => $value) {
296 296
                 $arrStr[$key] = str_replace(
@@ -318,24 +318,24 @@  discard block
 block discarded – undo
318 318
      */
319 319
     private function generateFilesAndLinks($controller, string $action, string $version): void
320 320
     {
321
-        $resultCombinedName = Text::uncamelize(ucfirst($controller) . ucfirst($action), '-');
322
-        $resultCombinedName = strlen($resultCombinedName) !== '' ? $resultCombinedName . '-' : '';
321
+        $resultCombinedName = Text::uncamelize(ucfirst($controller).ucfirst($action), '-');
322
+        $resultCombinedName = strlen($resultCombinedName) !== '' ? $resultCombinedName.'-' : '';
323 323
 
324 324
 
325 325
         foreach ($this->headerCollectionJS as $resource) {
326
-            $resource->setPath($resource->getPath() . '?v=' . $version);
326
+            $resource->setPath($resource->getPath().'?v='.$version);
327 327
         }
328 328
         foreach ($this->footerCollectionJS as $resource) {
329
-            $resource->setPath($resource->getPath() . '?v=' . $version);
329
+            $resource->setPath($resource->getPath().'?v='.$version);
330 330
         }
331 331
         foreach ($this->semanticCollectionJS as $resource) {
332
-            $resource->setPath($resource->getPath() . '?v=' . $version);
332
+            $resource->setPath($resource->getPath().'?v='.$version);
333 333
         }
334 334
         foreach ($this->semanticCollectionCSS as $resource) {
335
-            $resource->setPath($resource->getPath() . '?v=' . $version);
335
+            $resource->setPath($resource->getPath().'?v='.$version);
336 336
         }
337 337
         foreach ($this->footerCollectionACE as $resource) {
338
-            $resource->setPath($resource->getPath() . '?v=' . $version);
338
+            $resource->setPath($resource->getPath().'?v='.$version);
339 339
         }
340 340
 
341 341
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,8 @@
 block discarded – undo
50 50
     {
51 51
         $di->set(
52 52
             self::SERVICE_NAME,
53
-            function () use ($di) {
53
+            function () use ($di)
54
+            {
54 55
                 $assets = new AssetProvider();
55 56
                 $assets->initializeClassVariables();
56 57
                 $dispatcher = $di->get('dispatcher');
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
                 $assets->makeHeaderAssets($session, $moduleName);
73 73
 
74 74
                 // Generates Controllers assets
75
-                $method_name = "make{$controller}Assets";
75
+                $method_name = "make{$controller}assets";
76 76
                 if (method_exists($assets, $method_name)) {
77 77
                     $assets->$method_name($action);
78 78
                 }
Please login to merge, or discard this patch.
src/Core/System/Network.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         }
30 30
 
31 31
         Util::killByName('pcapsipdump');
32
-        $log_dir = System::getLogDir() . '/pcapsipdump';
32
+        $log_dir = System::getLogDir().'/pcapsipdump';
33 33
         Util::mwMkdir($log_dir);
34 34
 
35 35
         $network         = new Network();
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         foreach ($arr_eth as $eth) {
39 39
             $pid_file = "/var/run/pcapsipdump_{$eth}.pid";
40 40
             Util::mwExecBg(
41
-                $pcapsipdumpPath . ' -T 120 -P ' . $pid_file . ' -i ' . $eth . ' -m \'^(INVITE|REGISTER)$\' -L ' . $log_dir . '/dump.db'
41
+                $pcapsipdumpPath.' -T 120 -P '.$pid_file.' -i '.$eth.' -m \'^(INVITE|REGISTER)$\' -L '.$log_dir.'/dump.db'
42 42
             );
43 43
         }
44 44
     }
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
         /** @var \MikoPBX\Common\Models\LanInterfaces $res */
147 147
         $res = LanInterfaces::findFirst("internet = '1'");
148 148
         if (null !== $res) {
149
-            if ( ! empty($res->primarydns) && '127.0.0.1' != $res->primarydns) {
149
+            if (!empty($res->primarydns) && '127.0.0.1' != $res->primarydns) {
150 150
                 $dns[] = $res->primarydns;
151 151
             }
152
-            if ( ! empty($res->secondarydns) && '127.0.0.1' != $res->secondarydns) {
152
+            if (!empty($res->secondarydns) && '127.0.0.1' != $res->secondarydns) {
153 153
                 $dns[] = $res->secondarydns;
154 154
             }
155 155
         }
@@ -165,39 +165,39 @@  discard block
 block discarded – undo
165 165
     public function generatePdnsdConfig($named_dns): void
166 166
     {
167 167
         $tempDir   = $this->di->getShared('config')->path('core.tempDir');
168
-        $cache_dir = $tempDir . '/pdnsd/cache';
168
+        $cache_dir = $tempDir.'/pdnsd/cache';
169 169
         Util::mwMkdir($cache_dir);
170 170
 
171
-        $conf = 'global {' . "\n" .
172
-            '	perm_cache=10240;' . "\n" .
173
-            '	cache_dir="' . $cache_dir . '";' . "\n" .
174
-            '	pid_file = /var/run/pdnsd.pid;' . "\n" .
175
-            '	run_as="nobody";' . "\n" .
176
-            '	server_ip = 127.0.0.1;' . "\n" .
177
-            '	status_ctl = on;' . "\n" .
178
-            '	query_method=udp_tcp;' . "\n" .
179
-            '	min_ttl=15m;' . "\n" .
180
-            '	max_ttl=1w;' . "\n" .
181
-            '	timeout=10;' . "\n" .
182
-            '	neg_domain_pol=on;' . "\n" .
183
-            '	run_as=root;' . "\n" .
184
-            '	daemon=on;' . "\n" .
185
-            '}' . "\n" .
186
-            'server {' . "\n" .
187
-            '	label = "main";' . "\n" .
188
-            '	ip = ' . implode(', ', $named_dns) . ';' . "\n" .
189
-            '	interface=lo;' . "\n" .
190
-            '	uptest=if;' . "\n" .
191
-            '	interval=10m;' . "\n" .
192
-            '	purge_cache=off;' . "\n" .
171
+        $conf = 'global {'."\n".
172
+            '	perm_cache=10240;'."\n".
173
+            '	cache_dir="'.$cache_dir.'";'."\n".
174
+            '	pid_file = /var/run/pdnsd.pid;'."\n".
175
+            '	run_as="nobody";'."\n".
176
+            '	server_ip = 127.0.0.1;'."\n".
177
+            '	status_ctl = on;'."\n".
178
+            '	query_method=udp_tcp;'."\n".
179
+            '	min_ttl=15m;'."\n".
180
+            '	max_ttl=1w;'."\n".
181
+            '	timeout=10;'."\n".
182
+            '	neg_domain_pol=on;'."\n".
183
+            '	run_as=root;'."\n".
184
+            '	daemon=on;'."\n".
185
+            '}'."\n".
186
+            'server {'."\n".
187
+            '	label = "main";'."\n".
188
+            '	ip = '.implode(', ', $named_dns).';'."\n".
189
+            '	interface=lo;'."\n".
190
+            '	uptest=if;'."\n".
191
+            '	interval=10m;'."\n".
192
+            '	purge_cache=off;'."\n".
193 193
             '}';
194 194
 
195
-        $pdnsdConfFile  = '/etc/pdnsd.conf';
195
+        $pdnsdConfFile = '/etc/pdnsd.conf';
196 196
         $savedConf = '';
197
-        if(file_exists($pdnsdConfFile)){
197
+        if (file_exists($pdnsdConfFile)) {
198 198
             $savedConf = file_get_contents($pdnsdConfFile);
199 199
         }
200
-        if($savedConf != $conf){
200
+        if ($savedConf != $conf) {
201 201
             file_put_contents($pdnsdConfFile, $conf);
202 202
         }
203 203
         $pdnsdPath = Util::which('pdnsd');
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         if (!empty($pid) && $savedConf === $conf) {
206 206
             // Выполним дополнительную проверку, работает ли сервер.
207 207
             $resultResolve = gethostbynamel('lic.miko.ru');
208
-            if($resultResolve !== false){
208
+            if ($resultResolve !== false) {
209 209
                 // Ничего делать не нужно. Конфиг не изменился. Рестарт не требуется.
210 210
                 return;
211 211
             }
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
                  */
283 283
                 $pid_file = "/var/run/udhcpc_{$if_name}";
284 284
                 $pid_pcc  = Util::getPidOfProcess($pid_file);
285
-                if ( ! empty($pid_pcc)) {
285
+                if (!empty($pid_pcc)) {
286 286
                     // Завершаем старый процесс.
287 287
                     $killPath = Util::which('kill');
288 288
                     $catPath  = Util::which('cat');
@@ -411,10 +411,10 @@  discard block
 block discarded – undo
411 411
 
412 412
             $result = [''];
413 413
             if (file_exists('/etc/static-routes')) {
414
-                $command = "{$catPath} /etc/static-routes " .
415
-                    "| {$grepPath} '^rout' " .
416
-                    "| {$busyboxPath} awk -F ';' '{print $1}' " .
417
-                    "| {$grepPath} '{$if_name}\$' " .
414
+                $command = "{$catPath} /etc/static-routes ".
415
+                    "| {$grepPath} '^rout' ".
416
+                    "| {$busyboxPath} awk -F ';' '{print $1}' ".
417
+                    "| {$grepPath} '{$if_name}\$' ".
418 418
                     "| {$awkPath} -F 'dev {$if_name}' '{ print $1 }'";
419 419
                 Util::mwExec($command, $result);
420 420
             }
@@ -424,19 +424,19 @@  discard block
 block discarded – undo
424 424
 
425 425
             if ($if_data['vlanid'] > 0) {
426 426
                 // Пока только статика.
427
-                $lan_config = "auto {$if_data['interface_orign']}.{$if_data['vlanid']}\n" .
428
-                    "iface {$if_data['interface_orign']}.{$if_data['vlanid']} inet static \n" .
429
-                    "address {$ipaddr}\n" .
430
-                    "netmask {$subnet}\n" .
431
-                    "gateway {$gateway}\n" .
432
-                    "dns-nameservers 127.0.0.1\n" .
433
-                    "vlan_raw_device {$if_data['interface_orign']}\n" .
434
-                    "{$routs_add}\n" .
427
+                $lan_config = "auto {$if_data['interface_orign']}.{$if_data['vlanid']}\n".
428
+                    "iface {$if_data['interface_orign']}.{$if_data['vlanid']} inet static \n".
429
+                    "address {$ipaddr}\n".
430
+                    "netmask {$subnet}\n".
431
+                    "gateway {$gateway}\n".
432
+                    "dns-nameservers 127.0.0.1\n".
433
+                    "vlan_raw_device {$if_data['interface_orign']}\n".
434
+                    "{$routs_add}\n".
435 435
                     "{$routs_rem}\n";
436 436
             } elseif (trim($if_data['dhcp']) === '1') {
437
-                $lan_config = "auto {$if_name}\n" .
438
-                    "iface {$if_name} inet dhcp\n" .
439
-                    "{$routs_add}\n" .
437
+                $lan_config = "auto {$if_name}\n".
438
+                    "iface {$if_name} inet dhcp\n".
439
+                    "{$routs_add}\n".
440 440
                     "{$routs_rem}\n";
441 441
             } else {
442 442
                 if (empty($ipaddr)) {
@@ -449,13 +449,13 @@  discard block
 block discarded – undo
449 449
                     echo "Caught exception: $ipaddr $subnet", $e->getMessage(), "\n";
450 450
                     continue;
451 451
                 }
452
-                $lan_config = "auto {$if_name}\n" .
453
-                    "iface {$if_name} inet static\n" .
454
-                    "address {$ipaddr}\n" .
455
-                    "netmask {$subnet}\n" .
456
-                    "gateway {$gateway}\n" .
457
-                    "dns-nameservers 127.0.0.1\n" .
458
-                    "{$routs_add}\n" .
452
+                $lan_config = "auto {$if_name}\n".
453
+                    "iface {$if_name} inet static\n".
454
+                    "address {$ipaddr}\n".
455
+                    "netmask {$subnet}\n".
456
+                    "gateway {$gateway}\n".
457
+                    "dns-nameservers 127.0.0.1\n".
458
+                    "{$routs_add}\n".
459 459
                     "{$routs_rem}\n";
460 460
             }
461 461
             file_put_contents("/etc/network/interfaces.d/{$if_name}", $lan_config);
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
         $net_mask = explode(".", $net_mask);
547 547
 
548 548
         foreach ($net_mask as $oct_ect) {
549
-            $bits += strlen(str_replace("0", "", decbin((int)$oct_ect)));
549
+            $bits += strlen(str_replace("0", "", decbin((int) $oct_ect)));
550 550
         }
551 551
 
552 552
         return $bits;
@@ -603,13 +603,13 @@  discard block
 block discarded – undo
603 603
         $data->name      = $name;
604 604
         $data->interface = $name;
605 605
         $data->dhcp      = '1';
606
-        $data->internet  = ($general === true) ? '1' : '0';;
606
+        $data->internet  = ($general === true) ? '1' : '0'; ;
607 607
         $data->disabled  = '0';
608 608
         $data->vlanid    = '0';
609 609
         $data->hostname  = 'mikopbx';
610 610
         $data->domain    = '';
611 611
         $data->topology  = 'private';
612
-        $data->primarydns= '';
612
+        $data->primarydns = '';
613 613
         $data->save();
614 614
 
615 615
         return $data->toArray();
@@ -630,15 +630,15 @@  discard block
 block discarded – undo
630 630
     public function hostnameConfigure(): void
631 631
     {
632 632
         $data       = Network::getHostName();
633
-        $hosts_conf = "127.0.0.1 localhost\n" .
633
+        $hosts_conf = "127.0.0.1 localhost\n".
634 634
             "127.0.0.1 {$data['hostname']}\n";
635
-        if ( ! empty($data['domain'])) {
635
+        if (!empty($data['domain'])) {
636 636
             $hosts_conf .= "127.0.0.1 {$data['hostname']}.{$data['domain']}\n";
637 637
         }
638 638
         Util::fileWriteContent('/etc/hosts', $hosts_conf);
639 639
 
640 640
         $hostnamePath = Util::which('hostname');
641
-        Util::mwExec($hostnamePath . ' ' . escapeshellarg("{$data['hostname']}"));
641
+        Util::mwExec($hostnamePath.' '.escapeshellarg("{$data['hostname']}"));
642 642
     }
643 643
 
644 644
     /**
@@ -652,12 +652,12 @@  discard block
 block discarded – undo
652 652
 
653 653
         $pidFile = '/var/run/openvpn.pid';
654 654
         $pid     = Util::getPidOfProcess('openvpn');
655
-        if ( ! empty($pid)) {
655
+        if (!empty($pid)) {
656 656
             // Завершаем процесс.
657 657
             $busyboxPath = Util::which('busybox');
658 658
             Util::mwExec("{$busyboxPath} kill '$pid'");
659 659
         }
660
-        if ( ! empty($data)) {
660
+        if (!empty($data)) {
661 661
             $openvpnPath = Util::which('openvpn');
662 662
             Util::mwExecBg("{$openvpnPath} --config /etc/openvpn.ovpn --writepid {$pidFile}", '/dev/null', 5);
663 663
         }
@@ -867,12 +867,12 @@  discard block
 block discarded – undo
867 867
         if ($res === null) {
868 868
             return;
869 869
         }
870
-        if (empty($res->primarydns) && ! empty($data['primarydns'])) {
870
+        if (empty($res->primarydns) && !empty($data['primarydns'])) {
871 871
             $res->writeAttribute('primarydns', $data['primarydns']);
872 872
         } elseif (empty($res->secondarydns) && $res->primarydns !== $data['primarydns']) {
873 873
             $res->writeAttribute('secondarydns', $data['primarydns']);
874 874
         }
875
-        if (empty($res->secondarydns) && ! empty($data['secondarydns'])) {
875
+        if (empty($res->secondarydns) && !empty($data['secondarydns'])) {
876 876
             $res->writeAttribute('secondarydns', $data['secondarydns']);
877 877
         }
878 878
         $res->save();
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
     {
916 916
         // Настройка по умолчанию.
917 917
         $interface = trim(getenv('interface'));
918
-        if ( ! Util::isSystemctl()) {
918
+        if (!Util::isSystemctl()) {
919 919
             // Для MIKO LFS Edition.
920 920
             $busyboxPath = Util::which('busybox');
921 921
             Util::mwExec("{$busyboxPath} ifconfig $interface 192.168.2.1 netmask 255.255.255.0");
Please login to merge, or discard this patch.
src/Modules/PbxExtensionState.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -41,16 +41,16 @@  discard block
 block discarded – undo
41 41
         $this->moduleUniqueID = $moduleUniqueID;
42 42
         $this->modulesRoot    = $this->getDI()->getShared('config')->path('core.modulesDir');
43 43
         $moduleJson           = "{$this->modulesRoot}/{$this->moduleUniqueID}/module.json";
44
-        if ( ! file_exists($moduleJson)) {
45
-            $this->messages[] = 'module.json not found for module ' . $this->moduleUniqueID;
44
+        if (!file_exists($moduleJson)) {
45
+            $this->messages[] = 'module.json not found for module '.$this->moduleUniqueID;
46 46
 
47 47
             return;
48 48
         }
49 49
 
50 50
         $jsonString            = file_get_contents($moduleJson);
51 51
         $jsonModuleDescription = json_decode($jsonString, true);
52
-        if ( ! is_array($jsonModuleDescription)) {
53
-            $this->messages[] = 'module.json parsing error ' . $this->moduleUniqueID;
52
+        if (!is_array($jsonModuleDescription)) {
53
+            $this->messages[] = 'module.json parsing error '.$this->moduleUniqueID;
54 54
 
55 55
             return;
56 56
         }
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
             }
94 94
         }
95 95
         $success = $this->makeBeforeEnableTest();
96
-        if ( ! $success) {
96
+        if (!$success) {
97 97
             return false;
98 98
         }
99 99
 
100 100
         $this->reloadConfigClass();
101 101
         // Если ошибок нет, включаем Firewall и модуль
102
-        if ( ! $this->enableFirewallSettings()) {
102
+        if (!$this->enableFirewallSettings()) {
103 103
             $this->messages[] = 'Error on enable firewall settings';
104 104
 
105 105
             return false;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                 if (array_key_exists($network->id, $previousRules)) {
181 181
                     $newRule->action = $previousRules[$network->id];
182 182
                 }
183
-                if ( ! $newRule->save()) {
183
+                if (!$newRule->save()) {
184 184
                     $this->messages[] = $newRule->getMessages();
185 185
                 }
186 186
             }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     {
208 208
         if ($this->configClass !== null
209 209
             && method_exists($this->configClass, 'createNginxLocations')
210
-            && ! empty($this->configClass->createNginxLocations())) {
210
+            && !empty($this->configClass->createNginxLocations())) {
211 211
             $nginxConf = new NginxConf();
212 212
             $nginxConf->generateModulesConf();
213 213
             $nginxConf->reStart();
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     {
225 225
         if ($this->configClass !== null
226 226
             && method_exists($this->configClass, 'generateFail2BanJails')
227
-            && ! empty($this->configClass->generateFail2BanJails())) {
227
+            && !empty($this->configClass->generateFail2BanJails())) {
228 228
             IptablesConf::reloadFirewall();
229 229
         }
230 230
     }
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
     public function disableModule(): bool
237 237
     {
238 238
         $success = $this->makeBeforeDisableTest();
239
-        if ( ! $success) {
239
+        if (!$success) {
240 240
             return false;
241 241
         }
242 242
         $this->reloadConfigClass();
243 243
         // Если ошибок нет, выключаем Firewall и модуль
244
-        if ( ! $this->disableFirewallSettings()) {
244
+        if (!$this->disableFirewallSettings()) {
245 245
             $this->messages[] = 'Error on disable firewall settings';
246 246
 
247 247
             return false;
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
             && method_exists($this->configClass, 'onBeforeModuleDisable')
301 301
             && $this->configClass->onBeforeModuleDisable() === false) {
302 302
             $messages = $this->configClass->getMessages();
303
-            if ( ! empty($messages)) {
303
+            if (!empty($messages)) {
304 304
                 $this->messages = $messages;
305 305
             } else {
306 306
                 $this->messages[] = 'Error on the Module enable function at onBeforeModuleDisable';
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
             $className        = pathinfo($file)['filename'];
319 319
             $moduleModelClass = "\\Modules\\{$this->moduleUniqueID}\\Models\\{$className}";
320 320
             try {
321
-                if ( ! class_exists($moduleModelClass)) {
321
+                if (!class_exists($moduleModelClass)) {
322 322
                     continue;
323 323
                 }
324 324
                 $reflection = new ReflectionClass($moduleModelClass);
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
                 }
331 331
                 $records = $moduleModelClass::find();
332 332
                 foreach ($records as $record) {
333
-                    if ( ! $record->beforeDelete()) {
333
+                    if (!$record->beforeDelete()) {
334 334
                         foreach ($record->getMessages() as $message) {
335 335
                             $this->messages[] = $message->getMessage();
336 336
                         }
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
             $savedState[$detailRule->networkfilterid] = $detailRule->action;
383 383
         }
384 384
         $this->db->begin(true);
385
-        if ( ! $currentRules->delete()) {
385
+        if (!$currentRules->delete()) {
386 386
             $this->messages[] = $currentRules->getMessages();
387 387
 
388 388
             return false;
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             $previousRuleSettings->key = "{$this->moduleUniqueID}FirewallSettings";
395 395
         }
396 396
         $previousRuleSettings->value = json_encode($savedState);
397
-        if ( ! $previousRuleSettings->save()) {
397
+        if (!$previousRuleSettings->save()) {
398 398
             $this->messages[] = $previousRuleSettings->getMessages();
399 399
         }
400 400
         if (count($errors) > 0) {
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
             && method_exists($this->configClass, 'onBeforeModuleEnable')
448 448
             && $this->configClass->onBeforeModuleEnable() === false) {
449 449
             $messages = $this->configClass->getMessages();
450
-            if ( ! empty($messages)) {
450
+            if (!empty($messages)) {
451 451
                 $this->messages = $messages;
452 452
             } else {
453 453
                 $this->messages[] = 'Error on the enableModule function at onBeforeModuleEnable';
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
             $moduleModelClass = "\\Modules\\{$this->moduleUniqueID}\\Models\\{$className}";
468 468
 
469 469
             try {
470
-                if ( ! class_exists($moduleModelClass)) {
470
+                if (!class_exists($moduleModelClass)) {
471 471
                     continue;
472 472
                 }
473 473
                 $reflection = new ReflectionClass($moduleModelClass);
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
                                     'modulename' => $record->getRepresent(true),
498 498
                                 ]
499 499
                             );
500
-                            $success          = false;
500
+                            $success = false;
501 501
                         }
502 502
                     }
503 503
                 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     private function reloadConfigClass(): void
70 70
     {
71 71
         $class_name      = str_replace('Module', '', $this->moduleUniqueID);
72
-        $configClassName = "\\Modules\\{$this->moduleUniqueID}\\Lib\\{$class_name}Conf";
72
+        $configClassName = "\\Modules\\{$this->moduleUniqueID}\\Lib\\{$class_name}conf";
73 73
         if (class_exists($configClassName)) {
74 74
             $this->configClass = new $configClassName();
75 75
         } else {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
         $this->db->begin(true);
153 153
         $defaultRules         = $this->configClass->getDefaultFirewallRules();
154
-        $previousRuleSettings = PbxSettings::findFirstByKey("{$this->moduleUniqueID}FirewallSettings");
154
+        $previousRuleSettings = PbxSettings::findFirstByKey("{$this->moduleUniqueID}firewallsettings");
155 155
         $previousRules        = [];
156 156
         if ($previousRuleSettings !== null) {
157 157
             $previousRules = json_decode($previousRuleSettings->value, true);
@@ -388,10 +388,10 @@  discard block
 block discarded – undo
388 388
             return false;
389 389
         }
390 390
 
391
-        $previousRuleSettings = PbxSettings::findFirstByKey("{$this->moduleUniqueID}FirewallSettings");
391
+        $previousRuleSettings = PbxSettings::findFirstByKey("{$this->moduleUniqueID}firewallsettings");
392 392
         if ($previousRuleSettings === null) {
393 393
             $previousRuleSettings      = new PbxSettings();
394
-            $previousRuleSettings->key = "{$this->moduleUniqueID}FirewallSettings";
394
+            $previousRuleSettings->key = "{$this->moduleUniqueID}firewallsettings";
395 395
         }
396 396
         $previousRuleSettings->value = json_encode($savedState);
397 397
         if ( ! $previousRuleSettings->save()) {
Please login to merge, or discard this patch.
src/Modules/PbxExtensionUtils.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         $moduleAgiBinDir = "{$moduleDir}/agi-bin";
115 115
         $files           = glob("$moduleAgiBinDir/*.{php}", GLOB_BRACE);
116 116
         foreach ($files as $file) {
117
-            $newFilename = $agiBinDir . '/' . basename($file);
117
+            $newFilename = $agiBinDir.'/'.basename($file);
118 118
             Util::createUpdateSymlink($file, $newFilename);
119 119
         }
120 120
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             $needDisable = false;
136 136
             $moduleDir   = PbxExtensionUtils::getModuleDir($module['uniqid']);
137 137
             $moduleJson  = "{$moduleDir}/module.json";
138
-            if ( ! file_exists($moduleJson)) {
138
+            if (!file_exists($moduleJson)) {
139 139
                 $needDisable = true;
140 140
             }
141 141
             $jsonString            = file_get_contents($moduleJson);
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
                 } catch (ErrorAlias $exception) {
152 152
                     Util::sysLogMsg(__CLASS__, "Can not disable module {$module['uniqid']} Message: {$exception}");
153 153
                 } finally {
154
-                    $currentModule           = PbxExtensionModules::findFirstByUniqid($module['uniqid']);
155
-                    if ($currentModule->disabled==='0'){
154
+                    $currentModule = PbxExtensionModules::findFirstByUniqid($module['uniqid']);
155
+                    if ($currentModule->disabled === '0') {
156 156
                         $currentModule->disabled = '1';
157 157
                         $currentModule->update();
158 158
                     }
Please login to merge, or discard this patch.