Passed
Pull Request — master (#23)
by Nikolay
09:42 queued 03:08
created
src/Core/Asterisk/Configs/IVRConf.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
         /** @var Sip $sip_peer */
28 28
         foreach ($db_data as $sip_peer) {
29 29
             $len = strlen($sip_peer['extension']);
30
-            if(!in_array($len, $arr_lens)){
30
+            if (!in_array($len, $arr_lens)) {
31 31
                 $arr_lens[] = $len;
32 32
             }
33 33
         }
34 34
 
35
-        $db_data           = IvrMenu::find()->toArray();
35
+        $db_data = IvrMenu::find()->toArray();
36 36
         // Генерация внутреннего номерного плана.
37 37
         $conf = '';
38 38
         foreach ($db_data as $ivr) {
@@ -48,13 +48,13 @@  discard block
 block discarded – undo
48 48
             }
49 49
             $try_count_ivr = $ivr['number_of_repeat'];
50 50
             $conf          .= "[ivr-{$ivr['extension']}] \n";
51
-            $conf          .= 'exten => s,1,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Gosub(set_orign_chan,s,1))' . "\n\t";
51
+            $conf          .= 'exten => s,1,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Gosub(set_orign_chan,s,1))'."\n\t";
52 52
             $conf          .= "same => n,Set(APPEXTEN={$ivr['extension']})\n\t";
53
-            $conf          .= 'same => n,Gosub(dial_app,${EXTEN},1)' . "\n\t";
54
-            $conf          .= 'same => n,Answer()' . "\n\t";
55
-            $conf          .= 'same => n,Set(try_count=0); №6' . "\n\t";
56
-            $conf          .= 'same => n,Set(try_count=$[${try_count} + 1])' . "\n\t";
57
-            $conf          .= 'same => n,GotoIf($[${try_count} > ' . $try_count_ivr . ']?internal,' . $ivr['timeout_extension'] . ',1)' . "\n\t";
53
+            $conf          .= 'same => n,Gosub(dial_app,${EXTEN},1)'."\n\t";
54
+            $conf          .= 'same => n,Answer()'."\n\t";
55
+            $conf          .= 'same => n,Set(try_count=0); №6'."\n\t";
56
+            $conf          .= 'same => n,Set(try_count=$[${try_count} + 1])'."\n\t";
57
+            $conf          .= 'same => n,GotoIf($[${try_count} > '.$try_count_ivr.']?internal,'.$ivr['timeout_extension'].',1)'."\n\t";
58 58
             $conf          .= "same => n,Set(TIMEOUT(digit)=2) \n\t";
59 59
             $conf          .= "same => n,Background({$audio_message}) \n\t";
60 60
             if ($timeout_wait_exten > 0) {
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
             $conf .= "exten => t,1,Goto(s,6)\n";
72 72
 
73 73
             if ($ivr['allow_enter_any_internal_extension'] === '1') {
74
-                foreach ($arr_lens as $len){
74
+                foreach ($arr_lens as $len) {
75 75
                     $extension = Util::getExtensionX($len);
76
-                    $conf .= 'exten => _'.$extension.',1,ExecIf($["${DIALPLAN_EXISTS(internal,${EXTEN},1)}" == "0"]?Goto(i,1))' . "\n\t";
77
-                    $conf .= 'same => n,ExecIf($["${PJSIP_ENDPOINT(${EXTEN},auth)}x" == "x"]?Goto(i,1))' . "\n\t";
78
-                    $conf .= 'same => n,Goto(internal,${EXTEN},1)' . "\n";
76
+                    $conf .= 'exten => _'.$extension.',1,ExecIf($["${DIALPLAN_EXISTS(internal,${EXTEN},1)}" == "0"]?Goto(i,1))'."\n\t";
77
+                    $conf .= 'same => n,ExecIf($["${PJSIP_ENDPOINT(${EXTEN},auth)}x" == "x"]?Goto(i,1))'."\n\t";
78
+                    $conf .= 'same => n,Goto(internal,${EXTEN},1)'."\n";
79 79
                 }
80 80
             }
81 81
         }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     public function extensionGenHints(): string
92 92
     {
93 93
         $conf = '';
94
-        $db_data           = IvrMenu::find()->toArray();
94
+        $db_data = IvrMenu::find()->toArray();
95 95
         foreach ($db_data as $ivr) {
96 96
             $conf .= "exten => {$ivr['extension']},hint,Custom:{$ivr['extension']} \n";
97 97
         }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             $time_str = implode($out);
118 118
             preg_match_all('/^\d{2}:\d{2}:\d{2}.?\d{0,2}$/', $time_str, $matches, PREG_SET_ORDER, 0);
119 119
             if (count($matches) > 0) {
120
-                $data   = date_parse($time_str);
120
+                $data = date_parse($time_str);
121 121
                 $result += $data['minute'] * 60 + $data['second'];
122 122
             }
123 123
         }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $ivr_ext_conf = '';
136 136
         $db_data           = IvrMenu::find()->toArray();
137 137
         foreach ($db_data as $ivr) {
138
-            $ivr_ext_conf .= "exten => {$ivr['extension']},1,Goto(ivr-{$ivr['extension']},s,1)" . "\n";
138
+            $ivr_ext_conf .= "exten => {$ivr['extension']},1,Goto(ivr-{$ivr['extension']},s,1)"."\n";
139 139
         }
140 140
         $ivr_ext_conf .= "\n";
141 141
 
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
     public function extensionGenInternalTransfer(): string
149 149
     {
150 150
         $conf = '';
151
-        $db_data           = IvrMenu::find()->toArray();
151
+        $db_data = IvrMenu::find()->toArray();
152 152
         foreach ($db_data as $ivr) {
153
-            $conf .= 'exten => _' . $ivr['extension'] . ',1,Set(__ISTRANSFER=transfer_)' . " \n\t";
154
-            $conf .= 'same => n,Goto(internal,${EXTEN},1)' . " \n";
153
+            $conf .= 'exten => _'.$ivr['extension'].',1,Set(__ISTRANSFER=transfer_)'." \n\t";
154
+            $conf .= 'same => n,Goto(internal,${EXTEN},1)'." \n";
155 155
         }
156 156
 
157 157
         return $conf;
Please login to merge, or discard this patch.
src/Core/System/SystemLoader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     public function startSystem(): bool
28 28
     {
29 29
         $this->di->getShared('registry')->booting = true;
30
-        $storage                          = new Storage();
30
+        $storage = new Storage();
31 31
         Util::echoWithSyslog(' - Mount storage disk... ');
32 32
         $storage->saveFstab();
33 33
         $storage->configure();
@@ -122,12 +122,12 @@  discard block
 block discarded – undo
122 122
         Util::echoGreenDone();
123 123
 
124 124
         Util::echoWithSyslog(' - Configuring Asterisk...'.PHP_EOL);
125
-        $pbx                              = new PBX();
125
+        $pbx = new PBX();
126 126
         $pbx->configure();
127 127
 
128 128
         Util::echoWithSyslog(' - Start Asterisk... ');
129 129
         $pbx->start();
130
-        $system                           = new System();
130
+        $system = new System();
131 131
         $system->onAfterPbxStarted();
132 132
         Util::echoGreenDone();
133 133
 
Please login to merge, or discard this patch.
src/Common/Models/Codecs.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,17 +33,17 @@
 block discarded – undo
33 33
      * Audio or Video codec
34 34
      * @Column(type="string", nullable=true)
35 35
      */
36
-    public ?string $type='audio';
36
+    public ?string $type = 'audio';
37 37
 
38 38
     /**
39 39
      * @Column(type="integer", nullable=true, default="1")
40 40
      */
41
-    public ?string $priority='1';
41
+    public ?string $priority = '1';
42 42
 
43 43
     /**
44 44
      * @Column(type="string", length=1, nullable=true)
45 45
      */
46
-    public ?string $disabled='0';
46
+    public ?string $disabled = '0';
47 47
 
48 48
     /**
49 49
      * @Column(type="string", nullable=true)
Please login to merge, or discard this patch.
src/PBXCoreREST/Workers/WorkerMakeLogFilesArchive.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@
 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("WorkerMakeLogFilesArchive", 'File with settings not found');
24 24
             return;
25 25
         }
26 26
         $file_data = json_decode(file_get_contents($settings_file), true);
27
-        if ( ! isset($file_data['result_file'])) {
27
+        if (!isset($file_data['result_file'])) {
28 28
             Util::sysLogMsg("WorkerMakeLogFilesArchive", 'Wrong settings');
29 29
             return;
30 30
         }
Please login to merge, or discard this patch.
src/Core/System/SentryErrorLogger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
             SentrySdk::init()->bindClient($client);
67 67
 
68 68
             SentrySdk::getCurrentHub()->configureScope(
69
-                function (Scope $scope): void {
69
+                function(Scope $scope): void {
70 70
                     if (isset($this->email)) {
71 71
                         $scope->setUser(['id' => $this->email], true);
72 72
                     }
Please login to merge, or discard this patch.
src/AdminCabinet/Library/LanguageSelector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         if (($list = strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']))) {
21 21
             if (preg_match_all('/([a-z]{1,8}(?:-[a-z]{1,8})?)(?:;q=([0-9.]+))?/', $list, $list)) {
22 22
                 $language = array_combine($list[1], $list[2]);
23
-                if (is_array($language)){
23
+                if (is_array($language)) {
24 24
                     foreach ($language as $n => $v) {
25 25
                         $this->language[$n] = $v ? $v : 1;
26 26
                     }
Please login to merge, or discard this patch.
src/Core/Workers/WorkerLogRotate.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $managedCache = $this->di->get('managedCache');
29 29
         $lastLogRotate = $managedCache->get('lastCoreWorkerLogRotateProcessing');
30
-        if ($lastLogRotate===null){
30
+        if ($lastLogRotate === null) {
31 31
             //System Logs
32 32
             NatsConf::logRotate();
33 33
             PHPConf::rotateLog();
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function logRotate(string $moduleUniqid): void
51 51
     {
52
-        $logPath        = System::getLogDir() . '/' . $moduleUniqid . '/';
53
-        if ( ! file_exists($logPath)) {
52
+        $logPath = System::getLogDir().'/'.$moduleUniqid.'/';
53
+        if (!file_exists($logPath)) {
54 54
             return;
55 55
         }
56 56
 
57
-        $results         = glob($logPath . '*.log', GLOB_NOSORT);
57
+        $results         = glob($logPath.'*.log', GLOB_NOSORT);
58 58
         $textConfig = '';
59 59
         foreach ($results as $file) {
60
-            $textConfig .= $file . ' {
60
+            $textConfig .= $file.' {
61 61
     start 0
62 62
     rotate 9
63 63
     size 10M
Please login to merge, or discard this patch.
src/AdminCabinet/Forms/SystemDiagnosticForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
         $this->add($filenames);
33 33
 
34 34
         $this->add(new Text('filter', ['value' => '']));
35
-        $this->add(new Numeric('lines',  ['value' => '500']));
36
-        $this->add(new Numeric('offset',  ['value' => '0']));
35
+        $this->add(new Numeric('lines', ['value' => '500']));
36
+        $this->add(new Numeric('offset', ['value' => '0']));
37 37
 
38 38
     }
39 39
 }
40 40
\ No newline at end of file
Please login to merge, or discard this patch.
src/AdminCabinet/Controllers/ExtensionsController.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -215,11 +215,11 @@
 block discarded – undo
215 215
 
216 216
         $form = new ExtensionEditForm(
217 217
             $extension, [
218
-                          'network_filters'        => $arrNetworkFilters,
219
-                          'external_extension'     => $externalExtension,
220
-                          'forwarding_extensions'  => $forwardingExtensions,
221
-                          'internalextension_mask' => $internalExtensionMask,
222
-                      ]
218
+                            'network_filters'        => $arrNetworkFilters,
219
+                            'external_extension'     => $externalExtension,
220
+                            'forwarding_extensions'  => $forwardingExtensions,
221
+                            'internalextension_mask' => $internalExtensionMask,
222
+                        ]
223 223
         );
224 224
 
225 225
         $this->view->form      = $form;
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -80,14 +80,14 @@  discard block
 block discarded – undo
80 80
                     $extensionTable[$extension->userid]['email']    = $extension->email;
81 81
                     $extensionTable[$extension->userid]['secret']   = $extension->secret;
82 82
 
83
-                    if ( ! array_key_exists('mobile', $extensionTable[$extension->userid])) {
83
+                    if (!array_key_exists('mobile', $extensionTable[$extension->userid])) {
84 84
                         $extensionTable[$extension->userid]['mobile'] = '';
85 85
                     }
86 86
                     if ($extension->avatar) {
87 87
                         $filename    = md5($extension->avatar);
88 88
                         $imgCacheDir = appPath('sites/admin-cabinet/assets/img/cache');
89 89
                         $imgFile     = "{$imgCacheDir}/$filename.jpg";
90
-                        if ( ! file_exists($imgFile)) {
90
+                        if (!file_exists($imgFile)) {
91 91
                             $this->base64ToJpeg($extension->avatar, $imgFile);
92 92
                         }
93 93
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             $extension->Sip                    = new Sip();
153 153
             $extension->Sip->disabled          = 0;
154 154
             $extension->Sip->type              = 'peer';
155
-            $extension->Sip->uniqid            = Extensions::TYPE_SIP.strtoupper('-PHONE-' . md5(time()));
155
+            $extension->Sip->uniqid            = Extensions::TYPE_SIP.strtoupper('-PHONE-'.md5(time()));
156 156
             $extension->Sip->busylevel         = 1;
157 157
             $extension->Sip->qualify           = '1';
158 158
             $extension->Sip->qualifyfreq       = 60;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             $arrNetworkFilters[$filter->id] = $filter->getRepresent();
175 175
         }
176 176
 
177
-        $parameters        = [
177
+        $parameters = [
178 178
             'conditions' => 'type = "'.Extensions::TYPE_EXTERNAL.'" AND is_general_user_number = "1" AND userid=:userid:',
179 179
             'bind'       => [
180 180
                 'userid' => $extension->userid,
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
             $externalExtension->type                     = Extensions::TYPE_EXTERNAL;
188 188
             $externalExtension->is_general_user_number   = '1';
189 189
             $externalExtension->ExternalPhones           = new ExternalPhones();
190
-            $externalExtension->ExternalPhones->uniqid   = Extensions::TYPE_EXTERNAL.strtoupper('-' . md5(time()));
190
+            $externalExtension->ExternalPhones->uniqid   = Extensions::TYPE_EXTERNAL.strtoupper('-'.md5(time()));
191 191
             $externalExtension->ExternalPhones->disabled = '0';
192 192
         }
193 193
 
194
-        $forwardingExtensions  = [];
194
+        $forwardingExtensions = [];
195 195
         $forwardingExtensions[''] = $this->translation->_('ex_SelectNumber');
196 196
 
197 197
         $parameters = [
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
             'conditions' => 'type = "'.Extensions::TYPE_SIP.'"',
236 236
             'column'     => 'number',
237 237
         ];
238
-        $query      = Extensions::maximum($parameters);
238
+        $query = Extensions::maximum($parameters);
239 239
         if ($query === null) {
240 240
             $query = 200;
241 241
         }
242
-        $result       = (int)$query + 1;
242
+        $result       = (int) $query + 1;
243 243
         $extensionsLength = PbxSettings::getValueByKey('PBXInternalExtensionLength');
244 244
         $maxExtension = (10 ** $extensionsLength) - 1;
245 245
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
      */
254 254
     public function saveAction(): void
255 255
     {
256
-        if ( ! $this->request->isPost()) {
256
+        if (!$this->request->isPost()) {
257 257
             return;
258 258
         }
259 259
 
@@ -275,21 +275,21 @@  discard block
 block discarded – undo
275 275
             $fwdEntity->ringlength = 45;
276 276
         } else {
277 277
             $extension = $sipEntity->Extensions;
278
-            if ( ! $extension) {
278
+            if (!$extension) {
279 279
                 $extension = new Extensions();
280 280
             }
281 281
             $userEntity = $extension->Users;
282
-            if ( ! $userEntity) {
282
+            if (!$userEntity) {
283 283
                 $userEntity = new Users();
284 284
             }
285 285
             $fwdEntity = $extension->ExtensionForwardingRights;
286
-            if ( ! $fwdEntity) {
286
+            if (!$fwdEntity) {
287 287
                 $fwdEntity = new ExtensionForwardingRights();
288 288
             }
289 289
         }
290 290
 
291 291
         // Заполним параметры пользователя
292
-        if ( ! $this->saveUser($userEntity, $data)) {
292
+        if (!$this->saveUser($userEntity, $data)) {
293 293
             $this->view->success = false;
294 294
             $this->db->rollback();
295 295
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         }
298 298
 
299 299
         // Заполним параметры внутреннего номера
300
-        if ( ! $this->saveExtension($extension, $userEntity, $data, false)) {
300
+        if (!$this->saveExtension($extension, $userEntity, $data, false)) {
301 301
             $this->view->success = false;
302 302
             $this->db->rollback();
303 303
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         }
306 306
 
307 307
         // Заполним параметры SIP учетки
308
-        if ( ! $this->saveSip($sipEntity, $data)) {
308
+        if (!$this->saveSip($sipEntity, $data)) {
309 309
             $this->view->success = false;
310 310
             $this->db->rollback();
311 311
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
 
316 316
         // Заполним параметры маршрутизации
317
-        if ( ! $this->saveForwardingRights($fwdEntity, $data)) {
317
+        if (!$this->saveForwardingRights($fwdEntity, $data)) {
318 318
             $this->view->success = false;
319 319
             $this->db->rollback();
320 320
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
         }
323 323
 
324 324
         // Если мобильный не указан, то не будем его добавлять в базу
325
-        if ( ! empty($data['mobile_number'])) {
325
+        if (!empty($data['mobile_number'])) {
326 326
             $externalPhone = ExternalPhones::findFirstByUniqid($data['mobile_uniqid']);
327 327
             if ($externalPhone === null) {
328 328
                 $externalPhone   = new ExternalPhones();
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
             }
333 333
 
334 334
             // Заполним параметры Extension для мобильного
335
-            if ( ! $this->saveExtension($mobileExtension, $userEntity, $data, true)) {
335
+            if (!$this->saveExtension($mobileExtension, $userEntity, $data, true)) {
336 336
                 $this->view->success = false;
337 337
                 $this->db->rollback();
338 338
 
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             }
341 341
 
342 342
             // Заполним параметры ExternalPhones для мобильного
343
-            if ( ! $this->saveExternalPhones($externalPhone, $data)) {
343
+            if (!$this->saveExternalPhones($externalPhone, $data)) {
344 344
                 $this->view->success = false;
345 345
                 $this->db->rollback();
346 346
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
             }
349 349
         } else {
350 350
             // Удалить номер мобильного если он был привязан к пользователю
351
-            $parameters          = [
351
+            $parameters = [
352 352
                 'conditions' => 'type="'.Extensions::TYPE_EXTERNAL.'" AND is_general_user_number = "1" AND userid=:userid:',
353 353
                 'bind'       => [
354 354
                     'userid' => $userEntity->id,
@@ -390,16 +390,16 @@  discard block
 block discarded – undo
390 390
         foreach ($userEntity as $name => $value) {
391 391
             switch ($name) {
392 392
                 case 'role':
393
-                    if (array_key_exists('user_' . $name, $data)) {
394
-                        $userEntity->$name = ($userEntity->$name === 'user') ? 'user' : $data['user_' . $name]; // не повышаем роль
393
+                    if (array_key_exists('user_'.$name, $data)) {
394
+                        $userEntity->$name = ($userEntity->$name === 'user') ? 'user' : $data['user_'.$name]; // не повышаем роль
395 395
                     }
396 396
                     break;
397 397
                 case 'language':
398 398
                     $userEntity->$name = PbxSettings::getValueByKey('PBXLanguage');
399 399
                     break;
400 400
                 default:
401
-                    if (array_key_exists('user_' . $name, $data)) {
402
-                        $userEntity->$name = $data['user_' . $name];
401
+                    if (array_key_exists('user_'.$name, $data)) {
402
+                        $userEntity->$name = $data['user_'.$name];
403 403
                     }
404 404
             }
405 405
         }
@@ -491,20 +491,20 @@  discard block
 block discarded – undo
491 491
                     break;
492 492
                 case 'disabled':
493 493
                 case 'disablefromuser':
494
-                    if (array_key_exists('sip_' . $name, $data)) {
495
-                        $sipEntity->$name = ($data['sip_' . $name] === 'on') ? '1' : '0';
494
+                    if (array_key_exists('sip_'.$name, $data)) {
495
+                        $sipEntity->$name = ($data['sip_'.$name] === 'on') ? '1' : '0';
496 496
                     } else {
497 497
                         $sipEntity->$name = "0";
498 498
                     }
499 499
                     break;
500 500
                 case 'networkfilterid':
501
-                    if ( ! array_key_exists('sip_' . $name, $data)) {
501
+                    if (!array_key_exists('sip_'.$name, $data)) {
502 502
                         continue 2;
503 503
                     }
504
-                    if ($data['sip_' . $name] === 'none') {
504
+                    if ($data['sip_'.$name] === 'none') {
505 505
                         $sipEntity->$name = null;
506 506
                     } else {
507
-                        $sipEntity->$name = $data['sip_' . $name];
507
+                        $sipEntity->$name = $data['sip_'.$name];
508 508
                     }
509 509
                     break;
510 510
                 case 'extension':
@@ -517,8 +517,8 @@  discard block
 block discarded – undo
517 517
                     $sipEntity->setManualAttributes($data['sip_manualattributes']);
518 518
                     break;
519 519
                 default:
520
-                    if (array_key_exists('sip_' . $name, $data)) {
521
-                        $sipEntity->$name = $data['sip_' . $name];
520
+                    if (array_key_exists('sip_'.$name, $data)) {
521
+                        $sipEntity->$name = $data['sip_'.$name];
522 522
                     }
523 523
             }
524 524
         }
@@ -548,8 +548,8 @@  discard block
 block discarded – undo
548 548
                     $forwardingRight->$name = $data['number'];
549 549
                     break;
550 550
                 default:
551
-                    if (array_key_exists('fwd_' . $name, $data)) {
552
-                        $forwardingRight->$name = ($data['fwd_' . $name] === -1) ? '' : $data['fwd_' . $name];
551
+                    if (array_key_exists('fwd_'.$name, $data)) {
552
+                        $forwardingRight->$name = ($data['fwd_'.$name] === -1) ? '' : $data['fwd_'.$name];
553 553
                     }
554 554
             }
555 555
         }
@@ -586,15 +586,15 @@  discard block
 block discarded – undo
586 586
                     $externalPhone->$name = $data['user_username'];
587 587
                     break;
588 588
                 case 'disabled':
589
-                    if (array_key_exists('mobile_' . $name, $data)) {
590
-                        $externalPhone->$name = ($data['mobile_' . $name] === 'on') ? '1' : '0';
589
+                    if (array_key_exists('mobile_'.$name, $data)) {
590
+                        $externalPhone->$name = ($data['mobile_'.$name] === 'on') ? '1' : '0';
591 591
                     } else {
592 592
                         $externalPhone->$name = '0';
593 593
                     }
594 594
                     break;
595 595
                 default:
596
-                    if (array_key_exists('mobile_' . $name, $data)) {
597
-                        $externalPhone->$name = $data['mobile_' . $name];
596
+                    if (array_key_exists('mobile_'.$name, $data)) {
597
+                        $externalPhone->$name = $data['mobile_'.$name];
598 598
                     }
599 599
             }
600 600
         }
@@ -623,13 +623,13 @@  discard block
 block discarded – undo
623 623
 
624 624
         $errors = null;
625 625
         if ($extension !== null && $extension->ExtensionForwardingRights
626
-            && ! $extension->ExtensionForwardingRights->delete()) {
626
+            && !$extension->ExtensionForwardingRights->delete()) {
627 627
             $errors = $extension->ExtensionForwardingRights->getMessages();
628 628
         }
629 629
 
630
-        if ( ! $errors && $extension) {
630
+        if (!$errors && $extension) {
631 631
             $user = $extension->Users;
632
-            if ( ! $user->delete()) {
632
+            if (!$user->delete()) {
633 633
                 $errors = $user->getMessages();
634 634
             }
635 635
         }
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
      */
750 750
     public function GetPhonesRepresentAction(): void
751 751
     {
752
-        if ( ! $this->request->isPost()) {
752
+        if (!$this->request->isPost()) {
753 753
             return;
754 754
         }
755 755
         $numbers = $this->request->getPost('numbers');
Please login to merge, or discard this patch.