Passed
Push — master ( a2c24b...6427d5 )
by Nikolay
12:54 queued 08:08
created
src/Core/Config/Globals.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 $di = new Cli();
15 15
 
16 16
 // Register classes, namespaces, additional libraries with lazzy load
17
-require_once __DIR__ . '/../../../src/Common/Config/ClassLoader.php';
17
+require_once __DIR__.'/../../../src/Common/Config/ClassLoader.php';
18 18
 
19 19
 // Initialize sentry error logger
20 20
 $errorLogger = new SentryErrorLogger('pbx-core-workers');
Please login to merge, or discard this patch.
src/Common/Models/CallDetailRecordsTmp.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,15 +20,15 @@
 block discarded – undo
20 20
     }
21 21
 
22 22
     public function afterSave():void {
23
-        $work_completed = (string)$this->work_completed;
24
-        if( $work_completed === '1'){
23
+        $work_completed = (string) $this->work_completed;
24
+        if ($work_completed === '1') {
25 25
             $newCdr = new CallDetailRecords();
26 26
             $vars   = $this->toArray();
27
-            foreach ($vars as $key => $value){
28
-                if( 'id' === $key){
27
+            foreach ($vars as $key => $value) {
28
+                if ('id' === $key) {
29 29
                     continue;
30 30
                 }
31
-                if(property_exists($newCdr, $key)){
31
+                if (property_exists($newCdr, $key)) {
32 32
                     $newCdr->writeAttribute($key, $value);
33 33
                 }
34 34
             }
Please login to merge, or discard this patch.
src/PBXCoreREST/Lib/IAXStackProcessor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     {
26 26
         $res = new PBXApiResult();
27 27
         $res->processor = __METHOD__;
28
-        $peers  = [];
28
+        $peers = [];
29 29
         $providers = Iax::find();
30 30
         foreach ($providers as $provider) {
31 31
             $peers[] = [
Please login to merge, or discard this patch.
src/PBXCoreREST/Lib/CdrDBProcessor.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $res = new PBXApiResult();
28 28
         $res->processor = __METHOD__;
29 29
         $res->success = true;
30
-        $filter  = [
30
+        $filter = [
31 31
             'order'       => 'id',
32 32
             'columns'     => 'start,answer,endtime,src_num,dst_num,did,linkedid',
33 33
             'miko_tmp_db' => true,
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $message = $client->request(json_encode($filter), 2);
37 37
         if ($message === false) {
38 38
             $res->data = [];
39
-        }else{
39
+        } else {
40 40
             $res->data[] = $message;
41 41
         }
42 42
         return $res;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $res->processor = __METHOD__;
54 54
         $res->success = true;
55 55
 
56
-        $filter  = [
56
+        $filter = [
57 57
             'endtime IS NULL',
58 58
             'order'               => 'id',
59 59
             'columns'             => 'start,answer,src_chan,dst_chan,src_num,dst_num,did,linkedid',
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                 $data = json_decode(file_get_contents($result), true);
76 76
                 unlink($result);
77 77
                 foreach ($data as $row) {
78
-                    if ( ! isset($active_chans[$row['linkedid']])) {
78
+                    if (!isset($active_chans[$row['linkedid']])) {
79 79
                         // Вызов уже не существует.
80 80
                         continue;
81 81
                     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $message = $client->request(json_encode($filter), 2);
37 37
         if ($message === false) {
38 38
             $res->data = [];
39
-        }else{
39
+        } else{
40 40
             $res->data[] = $message;
41 41
         }
42 42
         return $res;
Please login to merge, or discard this patch.
src/PBXCoreREST/Controllers/Cdr/GetController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
                 $range = explode('-', $range[0]);
85 85
                 if ($range[0] === '') {
86 86
                     $end   = $filesize - 1;
87
-                    $start = $end - (int)$range[0];
87
+                    $start = $end - (int) $range[0];
88 88
                 } elseif ($range[1] === '') {
89
-                    $start = (int)$range[0];
89
+                    $start = (int) $range[0];
90 90
                     $end   = $filesize - 1;
91 91
                 } else {
92
-                    $start = (int)$range[0];
93
-                    $end   = (int)$range[1];
92
+                    $start = (int) $range[0];
93
+                    $end   = (int) $range[1];
94 94
                     // if ($end >= $filesize || (! $start && (! $end || $end == ($filesize - 1)))){
95 95
                     // $partial = false;
96 96
                     // }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 $length = $end - $start + 1;
99 99
 
100 100
                 $this->response->resetHeaders();
101
-                if ( ! $fp = fopen($filename, 'rb')) {
101
+                if (!$fp = fopen($filename, 'rb')) {
102 102
                     $this->sendError(500);
103 103
                 } else {
104 104
                     $this->response->setRawHeader('HTTP/1.1 206 Partial Content');
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                     $content = '';
112 112
                     while ($length) {
113 113
                         set_time_limit(0);
114
-                        $read    = ($length > 8192) ? 8192 : $length;
114
+                        $read = ($length > 8192) ? 8192 : $length;
115 115
                         $length  -= $read;
116 116
                         $content .= fread($fp, $read);
117 117
                     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             }
128 128
             $this->response->setHeader('Server', 'nginx');
129 129
 
130
-            $is_download = ! empty($this->request->get('download'));
130
+            $is_download = !empty($this->request->get('download'));
131 131
             if ($is_download) {
132 132
                 $new_filename = $this->request->get('filename');
133 133
                 if (empty($new_filename)) {
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
                 $this->response->setHeader(
138 138
                     'Content-Disposition',
139
-                    "attachment; filename*=UTF-8''" . basename($new_filename)
139
+                    "attachment; filename*=UTF-8''".basename($new_filename)
140 140
                 );
141 141
             }
142 142
             $this->response->sendRaw();
Please login to merge, or discard this patch.
src/Core/System/Configs/SyslogConf.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $syslog_file = '/var/log/messages';
25 25
         $log_file    = self::getSyslogFile();
26
-        if ( ! file_exists($syslog_file)) {
26
+        if (!file_exists($syslog_file)) {
27 27
             file_put_contents($syslog_file, '');
28 28
         }
29 29
         $syslogdPath = Util::which('syslogd');
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
         $logreadPath = Util::which('logread');
32 32
         $killPath = Util::which('kill');
33 33
         $pid = Util::getPidOfProcess($syslogdPath);
34
-        if ( ! empty($pid)) {
34
+        if (!empty($pid)) {
35 35
             $options = file_exists($log_file) ? '>' : '';
36
-            Util::mwExec("{$busyboxPath} {$logreadPath} 2> /dev/null >" . $options . $log_file);
36
+            Util::mwExec("{$busyboxPath} {$logreadPath} 2> /dev/null >".$options.$log_file);
37 37
             // Завершаем процесс.
38 38
             Util::mwExec("{$busyboxPath} {$killPath} '$pid'");
39 39
         }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public static function getSyslogFile(): string
50 50
     {
51
-        $logdir = System::getLogDir() . '/system';
51
+        $logdir = System::getLogDir().'/system';
52 52
         Util::mwMkdir($logdir);
53 53
         return "$logdir/messages";
54 54
     }
Please login to merge, or discard this patch.
src/Core/System/Configs/CronConf.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,11 +60,11 @@
 block discarded – undo
60 60
         $ntpdPath      = Util::which('ntpd');
61 61
         $shPath        = Util::which('sh');
62 62
         if ($restart_night === '1') {
63
-            $mast_have[] = '0 1 * * * ' . $cron_user . $asteriskPath . ' -rx"core restart now" > /dev/null 2> /dev/null' . "\n";
63
+            $mast_have[] = '0 1 * * * '.$cron_user.$asteriskPath.' -rx"core restart now" > /dev/null 2> /dev/null'."\n";
64 64
         }
65
-        $mast_have[] = '*/5 * * * * ' . $cron_user . $ntpdPath . ' -q > /dev/null 2> /dev/null' . "\n";
66
-        $mast_have[] = '*/6 * * * * ' . $cron_user . "{$shPath} {$workersPath}/Cron/cleaner_download_links.sh > /dev/null 2> /dev/null\n";
67
-        $mast_have[] = '*/1 * * * * ' . $cron_user . "{$WorkerSafeScripts}\n";
65
+        $mast_have[] = '*/5 * * * * '.$cron_user.$ntpdPath.' -q > /dev/null 2> /dev/null'."\n";
66
+        $mast_have[] = '*/6 * * * * '.$cron_user."{$shPath} {$workersPath}/Cron/cleaner_download_links.sh > /dev/null 2> /dev/null\n";
67
+        $mast_have[] = '*/1 * * * * '.$cron_user."{$WorkerSafeScripts}\n";
68 68
 
69 69
         $tasks = [];
70 70
 
Please login to merge, or discard this patch.
src/Core/System/Configs/VMWareToolsConf.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
                 . "vmsvc.level = none\n";
42 42
 
43 43
             $dirVM = '/etc/vmware-tools';
44
-            if(!file_exists($dirVM)){
44
+            if (!file_exists($dirVM)) {
45 45
                 Util::mwMkdir($dirVM);
46 46
             }
47 47
 
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/FeaturesConf.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,16 +19,16 @@  discard block
 block discarded – undo
19 19
 
20 20
     protected function generateConfigProtected(): void
21 21
     {
22
-        $conf             = "[general]\n" .
23
-            "featuredigittimeout = {$this->generalSettings['PBXFeatureDigitTimeout']}\n" .
24
-            "atxfernoanswertimeout = {$this->generalSettings['PBXFeatureAtxferNoAnswerTimeout']}\n" .
25
-            "transferdigittimeout = 3\n" .
26
-            "pickupexten = {$this->generalSettings['PickupExten']}\n" .
27
-            "atxferabort = *0\n" .
28
-            "\n" .
29
-            "[featuremap]\n" .
30
-            "atxfer => {$this->generalSettings['PBXFeatureAttendedTransfer']}\n" .
31
-            "disconnect = *0\n" .
22
+        $conf = "[general]\n".
23
+            "featuredigittimeout = {$this->generalSettings['PBXFeatureDigitTimeout']}\n".
24
+            "atxfernoanswertimeout = {$this->generalSettings['PBXFeatureAtxferNoAnswerTimeout']}\n".
25
+            "transferdigittimeout = 3\n".
26
+            "pickupexten = {$this->generalSettings['PickupExten']}\n".
27
+            "atxferabort = *0\n".
28
+            "\n".
29
+            "[featuremap]\n".
30
+            "atxfer => {$this->generalSettings['PBXFeatureAttendedTransfer']}\n".
31
+            "disconnect = *0\n".
32 32
             "blindxfer => {$this->generalSettings['PBXFeatureBlindTransfer']}\n";
33 33
 
34 34
         $additionalModules = $this->di->getShared('pbxConfModules');
@@ -36,6 +36,6 @@  discard block
 block discarded – undo
36 36
             $conf .= $appClass->getFeatureMap();
37 37
         }
38 38
 
39
-        Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/features.conf', $conf);
39
+        Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/features.conf', $conf);
40 40
     }
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.