Passed
Pull Request — master (#20)
by Nikolay
04:51
created
src/Core/Workers/WorkerCdr.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     public const SELECT_CDR_TUBE = 'select_cdr_tube';
25 25
     public const UPDATE_CDR_TUBE = 'update_cdr_tube';
26
-    protected int $maxProc=1;
26
+    protected int $maxProc = 1;
27 27
 
28 28
 
29 29
     private BeanstalkClient $client_queue;
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
         $result = json_decode($result_data, true);
94 94
         if (file_exists($result)) {
95 95
             $file_data = json_decode(file_get_contents($result), true);
96
-            if(!is_dir($result)){
96
+            if (!is_dir($result)) {
97 97
                 Util::mwExec("rm -rf {$result}");
98 98
             }
99 99
             $result = $file_data;
100 100
         }
101
-        if ( ! is_array($result) && ! is_object($result)) {
101
+        if (!is_array($result) && !is_object($result)) {
102 102
             return;
103 103
         }
104 104
         if (count($result) < 1) {
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             if (trim($row['recordingfile']) !== '') {
116 116
                 // Если каналов не существует с ID, то можно удалить временные файлы.
117 117
                 $p_info = pathinfo($row['recordingfile']);
118
-                $fname  = $p_info['dirname'] . '/' . $p_info['filename'] . '.wav';
118
+                $fname  = $p_info['dirname'].'/'.$p_info['filename'].'.wav';
119 119
                 if (file_exists($fname) && !is_dir($fname)) {
120 120
                     Util::mwExec("rm -rf {$fname}");
121 121
                 }
@@ -139,19 +139,19 @@  discard block
 block discarded – undo
139 139
                 $row['answer'] = '';
140 140
                 $billsec       = 0;
141 141
 
142
-                if ( ! empty($row['recordingfile'])) {
142
+                if (!empty($row['recordingfile'])) {
143 143
                     $p_info    = pathinfo($row['recordingfile']);
144 144
                     $file_list = [
145
-                        $p_info['dirname'] . '/' . $p_info['filename'] . '.mp3',
146
-                        $p_info['dirname'] . '/' . $p_info['filename'] . '.wav',
147
-                        $p_info['dirname'] . '/' . $p_info['filename'] . '_in.wav',
148
-                        $p_info['dirname'] . '/' . $p_info['filename'] . '_out.wav',
145
+                        $p_info['dirname'].'/'.$p_info['filename'].'.mp3',
146
+                        $p_info['dirname'].'/'.$p_info['filename'].'.wav',
147
+                        $p_info['dirname'].'/'.$p_info['filename'].'_in.wav',
148
+                        $p_info['dirname'].'/'.$p_info['filename'].'_out.wav',
149 149
                     ];
150 150
                     foreach ($file_list as $file) {
151
-                        if ( ! file_exists($file)) {
151
+                        if (!file_exists($file)) {
152 152
                             continue;
153 153
                         }
154
-                        if(!is_dir($file)){
154
+                        if (!is_dir($file)) {
155 155
                             Util::mwExec("rm -rf {$file}");
156 156
                         }
157 157
                     }
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
                 if (file_exists($row['recordingfile']) && !is_dir($row['recordingfile'])) {
163 163
                     Util::mwExec("rm -rf {$row['recordingfile']}");
164 164
                 }
165
-            } elseif (  ! empty($row['recordingfile']) &&
166
-                        ! file_exists(Util::trimExtensionForFile($row['recordingfile']) . 'wav') &&
167
-                        ! file_exists( $row['recordingfile']) ) {
165
+            } elseif (!empty($row['recordingfile']) &&
166
+                        !file_exists(Util::trimExtensionForFile($row['recordingfile']).'wav') &&
167
+                        !file_exists($row['recordingfile'])) {
168 168
                 /** @var CallDetailRecordsTmp $rec_data */
169 169
                 $rec_data = CallDetailRecordsTmp::findFirst(
170 170
                     "linkedid='{$row['linkedid']}' AND dst_chan='{$row['dst_chan']}'"
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      */
214 214
     private function getActiveIdChannels(): array
215 215
     {
216
-        $am           = Util::getAstManager('off');
216
+        $am = Util::getAstManager('off');
217 217
         return $am->GetChannels(true);
218 218
     }
219 219
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
             $this->no_answered_calls[$row['linkedid']]['NOANSWER'] = false;
229 229
             return;
230 230
         }
231
-        if ( ! array_key_exists($row['dst_num'], $this->internal_numbers)) {
231
+        if (!array_key_exists($row['dst_num'], $this->internal_numbers)) {
232 232
             // dst_num - не является номером сотрудника. Это исходящий.
233 233
             return;
234 234
         }
Please login to merge, or discard this patch.