Passed
Push — master ( dcc4bc...d68858 )
by Nikolay
06:05
created
src/Core/Asterisk/Configs/CdrManagerConf.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@
 block discarded – undo
19 19
 
20 20
     protected function generateConfigProtected(): void
21 21
     {
22
-        $conf = "[general]\n" .
23
-            "enabled=yes\n" .
24
-            "\n" .
25
-            "[mappings]\n" .
26
-            "linkedid => linkedid\n" .
22
+        $conf = "[general]\n".
23
+            "enabled=yes\n".
24
+            "\n".
25
+            "[mappings]\n".
26
+            "linkedid => linkedid\n".
27 27
             "recordingfile => recordingfile\n\n";
28 28
 
29
-        Util::fileWriteContent($this->config->path('asterisk.astetcdir') . "/cdr_manager.conf", $conf);
29
+        Util::fileWriteContent($this->config->path('asterisk.astetcdir')."/cdr_manager.conf", $conf);
30 30
     }
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/CdrConf.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@
 block discarded – undo
18 18
 
19 19
     protected function generateConfigProtected(): void
20 20
     {
21
-        $conf = "[general]\n" .
22
-            "enable=yes\n" .
23
-            "unanswered=yes\n\n" .
24
-            "[sqlite]\n" .
25
-            "usegmtime=no\n" .
26
-            "loguniqueid=yes\n" .
21
+        $conf = "[general]\n".
22
+            "enable=yes\n".
23
+            "unanswered=yes\n\n".
24
+            "[sqlite]\n".
25
+            "usegmtime=no\n".
26
+            "loguniqueid=yes\n".
27 27
             "loguserfield=yes\n";
28
-        file_put_contents($this->config->path('asterisk.astetcdir') . '/cdr.conf', $conf);
28
+        file_put_contents($this->config->path('asterisk.astetcdir').'/cdr.conf', $conf);
29 29
     }
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/RtpConf.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@
 block discarded – undo
19 19
 
20 20
     protected function generateConfigProtected(): void
21 21
     {
22
-        $conf = "[general]\n" .
23
-            "rtpstart={$this->generalSettings['RTPPortFrom']}\n" .
22
+        $conf = "[general]\n".
23
+            "rtpstart={$this->generalSettings['RTPPortFrom']}\n".
24 24
             "rtpend={$this->generalSettings['RTPPortTo']}\n\n";
25 25
 
26
-        Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/rtp.conf', $conf);
26
+        Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/rtp.conf', $conf);
27 27
     }
28 28
 }
29 29
\ No newline at end of file
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/QueueRulesConf.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,6 +19,6 @@
 block discarded – undo
19 19
     protected function generateConfigProtected(): void
20 20
     {
21 21
         $conf = '';
22
-        file_put_contents($this->config->path('asterisk.astetcdir') . '/queuerules.conf', $conf);
22
+        file_put_contents($this->config->path('asterisk.astetcdir').'/queuerules.conf', $conf);
23 23
     }
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
src/Modules/Logger.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
     {
30 30
         $this->module_name = $module_name;
31 31
         $this->debug    = true;
32
-        $logPath        = System::getLogDir() . '/' . $this->module_name . '/';
33
-        if (!is_dir($logPath)){
32
+        $logPath        = System::getLogDir().'/'.$this->module_name.'/';
33
+        if (!is_dir($logPath)) {
34 34
             Util::mwMkdir($logPath);
35 35
             Util::addRegularWWWRights($logPath);
36 36
         }
37
-        $logFile  = $logPath . $class . '.log';
37
+        $logFile = $logPath.$class.'.log';
38 38
         $adapter       = new FileLogger($logFile);
39 39
         $this->logger  = new \Phalcon\Logger(
40 40
             'messages',
Please login to merge, or discard this patch.
src/Core/Workers/WorkerAmiListener.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
     public function callback($parameters): void
61 61
     {
62 62
         if ($this->replyOnPingRequest($parameters)){
63
-           return;
63
+            return;
64 64
         }
65 65
 
66 66
         if ('CdrConnector' !== $parameters['UserEvent']) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     protected BeanstalkClient $client;
19 19
 
20 20
     protected AsteriskManager $am;
21
-    protected int $maxProc=1;
21
+    protected int $maxProc = 1;
22 22
 
23 23
     /**
24 24
      * Установка фильтра
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function callback($parameters): void
64 64
     {
65
-        if ($this->replyOnPingRequest($parameters)){
65
+        if ($this->replyOnPingRequest($parameters)) {
66 66
            return;
67 67
         }
68 68
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         }
102 102
 
103 103
         if ($message_is_sent === false) {
104
-            Util::sysLogMsg('CDR_AMI_Connector', "Error send data to queue. " . $error);
104
+            Util::sysLogMsg('CDR_AMI_Connector', "Error send data to queue. ".$error);
105 105
         }
106 106
         // Логируем оповещение.
107 107
         Util::logMsgDb('WorkerCallEvents::class', json_decode($result, true));
Please login to merge, or discard this patch.
src/AdminCabinet/Controllers/UsersController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         if ($extension) {
26 26
             $result = false;
27 27
         }
28
-        $this->view->emailAvailable=$result;
28
+        $this->view->emailAvailable = $result;
29 29
     }
30 30
 
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,8 @@
 block discarded – undo
13 13
 
14 14
 
15 15
 
16
-class UsersController extends BaseController {
16
+class UsersController extends BaseController
17
+{
17 18
 
18 19
     /**
19 20
      * Проверка на доступность емейл адреса
Please login to merge, or discard this patch.
src/Common/Providers/DatabaseProviderBase.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
                                         $variable  = str_replace(':', '', $variable);
74 74
                                         $statement = str_replace(":$variable", "'$value'", $statement);
75 75
                                         $statement = preg_replace('/= \?/', " = '{$value}'", $statement, 1);
76
-                                      //  $statement = preg_replace('/\?/', " = '{$value}'", $statement, 1);
76
+                                        //  $statement = preg_replace('/\?/', " = '{$value}'", $statement, 1);
77 77
                                     }
78 78
                                 }
79 79
                                 $logger->debug($statement);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $di->setShared(
43 43
             $serviceName,
44
-            function () use ($dbConfig) {
45
-                $dbclass    = 'Phalcon\Db\Adapter\Pdo\\' . $dbConfig['adapter'];
44
+            function() use ($dbConfig) {
45
+                $dbclass = 'Phalcon\Db\Adapter\Pdo\\'.$dbConfig['adapter'];
46 46
 
47 47
                 $folderWithDB = dirname($dbConfig['dbfile']);
48
-                if (!is_dir($folderWithDB)){
48
+                if (!is_dir($folderWithDB)) {
49 49
                     Util::mwMkdir($folderWithDB, true);
50 50
                 }
51 51
 
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
                     // Слушаем все события базы данных
68 68
                     $eventsManager->attach(
69 69
                         'db',
70
-                        function ($event, $connection) use ($logger) {
70
+                        function($event, $connection) use ($logger) {
71 71
                             if ($event->getType() === 'beforeQuery') {
72 72
                                 $statement = $connection->getSQLStatement();
73 73
                                 $variables = $connection->getSqlVariables();
74 74
                                 if (is_array($variables)) {
75 75
                                     foreach ($variables as $variable => $value) {
76 76
                                         if (is_array($value)) {
77
-                                            $value = '(' . implode(', ', $value) . ')';
77
+                                            $value = '('.implode(', ', $value).')';
78 78
                                         }
79 79
                                         $variable  = str_replace(':', '', $variable);
80 80
                                         $statement = str_replace(":$variable", "'$value'", $statement);
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,8 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $di->setShared(
43 43
             $serviceName,
44
-            function () use ($dbConfig) {
44
+            function () use ($dbConfig)
45
+            {
45 46
                 $dbclass    = 'Phalcon\Db\Adapter\Pdo\\' . $dbConfig['adapter'];
46 47
 
47 48
                 $folderWithDB = dirname($dbConfig['dbfile']);
@@ -67,7 +68,8 @@  discard block
 block discarded – undo
67 68
                     // Слушаем все события базы данных
68 69
                     $eventsManager->attach(
69 70
                         'db',
70
-                        function ($event, $connection) use ($logger) {
71
+                        function ($event, $connection) use ($logger)
72
+                        {
71 73
                             if ($event->getType() === 'beforeQuery') {
72 74
                                 $statement = $connection->getSQLStatement();
73 75
                                 $variables = $connection->getSqlVariables();
Please login to merge, or discard this patch.
src/Common/Models/ModelsBase.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@
 block discarded – undo
194 194
                     . '= :field'
195 195
                     . $index . ':';
196 196
                 $bindField
197
-                                                      = $mappedFields[$index];
197
+                                                        = $mappedFields[$index];
198 198
                 $parameters['bind']['field' . $index] = $currentDeleteRecord->$bindField;
199 199
             }
200 200
             $relatedRecords = $relatedModel::find($parameters);
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
                 'lifetime' => 5, //seconds
70 70
             ],
71 71
         ];
72
-        $modules    = PbxExtensionModules::find($parameters)->toArray();
72
+        $modules = PbxExtensionModules::find($parameters)->toArray();
73 73
         foreach ($modules as $module) {
74 74
             $moduleDir = PbxExtensionUtils::getModuleDir($module['uniqid']);
75 75
 
76 76
             $moduleJson = "{$moduleDir}/module.json";
77
-            if ( ! file_exists($moduleJson)) {
77
+            if (!file_exists($moduleJson)) {
78 78
                 continue;
79 79
             }
80 80
             $jsonString            = file_get_contents($moduleJson);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             }
86 86
 
87 87
             $moduleModelsDir = "{$moduleDir}/Models";
88
-            $results         = glob($moduleModelsDir . '/*.php', GLOB_NOSORT);
88
+            $results         = glob($moduleModelsDir.'/*.php', GLOB_NOSORT);
89 89
             foreach ($results as $file) {
90 90
                 $className        = pathinfo($file)['filename'];
91 91
                 $moduleModelClass = "\\Modules\\{$module['uniqid']}\\Models\\{$className}";
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
                 $newErrorMessage = $this->t('ConstraintViolation');
121 121
                 $newErrorMessage .= "<ul class='list'>";
122 122
                 if ($relatedRecords === false) {
123
-                    throw new Model\Exception('Error on models relationship ' . $errorMessage);
123
+                    throw new Model\Exception('Error on models relationship '.$errorMessage);
124 124
                 }
125 125
                 if ($relatedRecords instanceof Resultset) {
126 126
                     foreach ($relatedRecords as $item) {
127 127
                         if ($item instanceof ModelsBase) {
128
-                            $newErrorMessage .= '<li>' . $item->getRepresent(true) . '</li>';
128
+                            $newErrorMessage .= '<li>'.$item->getRepresent(true).'</li>';
129 129
                         }
130 130
                     }
131 131
                 } elseif ($relatedRecords instanceof ModelsBase) {
132
-                    $newErrorMessage .= '<li>' . $relatedRecords->getRepresent(true) . '</li>';
132
+                    $newErrorMessage .= '<li>'.$relatedRecords->getRepresent(true).'</li>';
133 133
                 } else {
134 134
                     $newErrorMessage .= '<li>Unknown object</li>';
135 135
                 }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                 if (empty($this->id)) {
181 181
                     $name .= $this->t('mo_NewElementCallQueues');
182 182
                 } else {
183
-                    $name .= $this->t('mo_CallQueueShort4Dropdown') . ': ' . $this->name;
183
+                    $name .= $this->t('mo_CallQueueShort4Dropdown').': '.$this->name;
184 184
                 }
185 185
                 break;
186 186
             case ConferenceRooms::class:
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                 if (empty($this->id)) {
189 189
                     $name .= $this->t('mo_NewElementConferenceRooms');
190 190
                 } else {
191
-                    $name .= $this->t('mo_ConferenceRoomsShort4Dropdown') . ': ' . $this->name;;
191
+                    $name .= $this->t('mo_ConferenceRoomsShort4Dropdown').': '.$this->name; ;
192 192
                 }
193 193
                 break;
194 194
             case CustomFiles::class:
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 if (empty($this->id)) {
200 200
                     $name .= $this->t('mo_NewElementDialplanApplications');
201 201
                 } else {
202
-                    $name .= $this->t('mo_ApplicationShort4Dropdown') . ': ' . $this->name;;
202
+                    $name .= $this->t('mo_ApplicationShort4Dropdown').': '.$this->name; ;
203 203
                 }
204 204
                 break;
205 205
             case ExtensionForwardingRights::class:
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 if (empty($this->id)) {
262 262
                     $name .= $this->t('mo_NewElementIax');
263 263
                 } elseif ($this->disabled === '1') {
264
-                    $name .= "{$this->description} ({$this->t( 'mo_Disabled' )})";
264
+                    $name .= "{$this->description} ({$this->t('mo_Disabled')})";
265 265
                 } else {
266 266
                     $name .= $this->description;
267 267
                 }
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                 if (empty($this->id)) {
272 272
                     $name .= $this->t('mo_NewElementIvrMenu');
273 273
                 } else {
274
-                    $name .= $this->t('mo_IVRMenuShort4Dropdown') . ': ' . $this->name;
274
+                    $name .= $this->t('mo_IVRMenuShort4Dropdown').': '.$this->name;
275 275
                 }
276 276
                 break;
277 277
             case IvrMenuActions::class:
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                 $name = '<i class="map signs icon"></i> ';
285 285
                 if (empty($this->id)) {
286 286
                     $name .= $this->t('mo_NewElementIncomingRoutingTable');
287
-                } elseif ( ! empty($this->note)) {
287
+                } elseif (!empty($this->note)) {
288 288
                     $name .= $this->t('repIncomingRoutingTable', ['represent' => $this->note]);
289 289
                 } else {
290 290
                     $name .= $this->t('repIncomingRoutingTableNumber', ['represent' => $this->id]);
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
                 if (empty($this->id)) {
300 300
                     $name .= $this->t('mo_NewElementNetworkFilters');
301 301
                 } else {
302
-                    $name .= $this->description . '('
303
-                        . $this->t('fw_PermitNetwork') . ': ' . $this->permit
302
+                    $name .= $this->description.'('
303
+                        . $this->t('fw_PermitNetwork').': '.$this->permit
304 304
                         . ')';
305 305
                 }
306 306
                 break;
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                 $name = '<i class="random icon"></i> ';
309 309
                 if (empty($this->id)) {
310 310
                     $name .= $this->t('mo_NewElementOutgoingRoutingTable');
311
-                } elseif ( ! empty($this->rulename)) {
311
+                } elseif (!empty($this->rulename)) {
312 312
                     $name .= $this->t('repOutgoingRoutingTable', ['represent' => $this->rulename]);
313 313
                 } else {
314 314
                     $name .= $this->t('repOutgoingRoutingTableNumber', ['represent' => $this->id]);
@@ -318,24 +318,24 @@  discard block
 block discarded – undo
318 318
                 $name = '<i class="time icon"></i> ';
319 319
                 if (empty($this->id)) {
320 320
                     $name .= $this->t('mo_NewElementOutWorkTimes');
321
-                } elseif ( ! empty($this->description)) {
321
+                } elseif (!empty($this->description)) {
322 322
                     $name .= $this->t('repOutWorkTimes', ['represent' => $this->description]);
323 323
                 } else {
324 324
                     $represent = '';
325 325
                     if (is_numeric($this->date_from)) {
326
-                        $represent .= date("d/m/Y", $this->date_from) . '-';
326
+                        $represent .= date("d/m/Y", $this->date_from).'-';
327 327
                     }
328 328
                     if (is_numeric($this->date_to)) {
329
-                        $represent .= date("d/m/Y", $this->date_to) . ' ';
329
+                        $represent .= date("d/m/Y", $this->date_to).' ';
330 330
                     }
331 331
                     if (isset($this->weekday_from)) {
332
-                        $represent .= $this->t(date('D', strtotime("Sunday +{$this->weekday_from} days"))) . '-';
332
+                        $represent .= $this->t(date('D', strtotime("Sunday +{$this->weekday_from} days"))).'-';
333 333
                     }
334 334
                     if (isset($this->weekday_to)) {
335
-                        $represent .= $this->t(date('D', strtotime("Sunday +{$this->weekday_to} days"))) . ' ';
335
+                        $represent .= $this->t(date('D', strtotime("Sunday +{$this->weekday_to} days"))).' ';
336 336
                     }
337 337
                     if (isset($this->time_from) || isset($this->time_to)) {
338
-                        $represent .= $this->time_from . ' - ' . $this->time_to . ' ';
338
+                        $represent .= $this->time_from.' - '.$this->time_to.' ';
339 339
                     }
340 340
                     $name .= $this->t('repOutWorkTimes', ['represent' => $represent]);
341 341
                 }
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                 break;
353 353
             case PbxExtensionModules::class:
354 354
                 $name = '<i class="puzzle piece icon"></i> '
355
-                    . $this->t('mo_ModuleShort4Dropdown') . ': '
355
+                    . $this->t('mo_ModuleShort4Dropdown').': '
356 356
                     . $this->name;
357 357
                 break;
358 358
             case Sip::class:
@@ -360,14 +360,14 @@  discard block
 block discarded – undo
360 360
                 if (empty($this->id)) {
361 361
                     $name .= $this->t('mo_NewElementSip');
362 362
                 } elseif ($this->disabled === '1') {
363
-                    $name .= "{$this->description} ({$this->t( 'mo_Disabled' )})";
363
+                    $name .= "{$this->description} ({$this->t('mo_Disabled')})";
364 364
                 } else {
365 365
                     $name .= $this->description;
366 366
                 }
367 367
 
368 368
                 break;
369 369
             case Users::class:
370
-                $name = '<i class="user outline icon"></i> ' . $this->username;
370
+                $name = '<i class="user outline icon"></i> '.$this->username;
371 371
                 break;
372 372
             case SoundFiles::class:
373 373
                 $name = '<i class="file audio outline icon"></i> ';
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
             $link     = $this->getWebInterfaceLink();
387 387
             $category = explode('\\', static::class)[3];
388 388
             $result   = $this->t(
389
-                'rep' . $category,
389
+                'rep'.$category,
390 390
                 [
391 391
                     'represent' => "<a href='{$link}'>{$name}</a>",
392 392
                 ]
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 
412 412
         if (strlen($s) > $max_length) {
413 413
             $offset = ($max_length - 3) - strlen($s);
414
-            $s      = substr($s, 0, strrpos($s, ' ', $offset)) . '...';
414
+            $s      = substr($s, 0, strrpos($s, ' ', $offset)).'...';
415 415
         }
416 416
 
417 417
         return $s;
@@ -430,80 +430,80 @@  discard block
 block discarded – undo
430 430
         $link    = '#';
431 431
         switch (static::class) {
432 432
             case AsteriskManagerUsers::class:
433
-                $link = $url->get('asterisk-managers/modify/' . $this->id, null, null, $baseUri);
433
+                $link = $url->get('asterisk-managers/modify/'.$this->id, null, null, $baseUri);
434 434
                 break;
435 435
             case CallQueueMembers::class:
436
-                $link = $url->get('call-queues/modify/' . $this->CallQueues->uniqid, null, null, $baseUri);
436
+                $link = $url->get('call-queues/modify/'.$this->CallQueues->uniqid, null, null, $baseUri);
437 437
                 break;
438 438
             case CallQueues::class:
439
-                $link = $url->get('call-queues/modify/' . $this->uniqid, null, null, $baseUri);
439
+                $link = $url->get('call-queues/modify/'.$this->uniqid, null, null, $baseUri);
440 440
                 break;
441 441
             case ConferenceRooms::class:
442
-                $link = $url->get('conference-rooms/modify/' . $this->uniqid, null, null, $baseUri);
442
+                $link = $url->get('conference-rooms/modify/'.$this->uniqid, null, null, $baseUri);
443 443
                 break;
444 444
             case CustomFiles::class:
445
-                $link = $url->get('custom-files/modify/' . $this->id, null, null, $baseUri);
445
+                $link = $url->get('custom-files/modify/'.$this->id, null, null, $baseUri);
446 446
                 break;
447 447
             case DialplanApplications::class:
448
-                $link = $url->get('dialplan-applications/modify/' . $this->uniqid, null, null, $baseUri);
448
+                $link = $url->get('dialplan-applications/modify/'.$this->uniqid, null, null, $baseUri);
449 449
                 break;
450 450
             case ExtensionForwardingRights::class:
451 451
 
452 452
                 break;
453 453
             case Extensions::class:
454
-                $link = $url->get('extensions/modify/' . $this->id, null, null, $baseUri);
454
+                $link = $url->get('extensions/modify/'.$this->id, null, null, $baseUri);
455 455
                 break;
456 456
             case ExternalPhones::class:
457 457
                 if ($this->Extensions->is_general_user_number === "1") {
458
-                    $parameters    = [
459
-                        'conditions' => 'is_general_user_number="1" AND type="' . Extensions::TYPE_EXTERNAL . '" AND userid=:userid:',
458
+                    $parameters = [
459
+                        'conditions' => 'is_general_user_number="1" AND type="'.Extensions::TYPE_EXTERNAL.'" AND userid=:userid:',
460 460
                         'bind'       => [
461 461
                             'userid' => $this->Extensions->userid,
462 462
                         ],
463 463
                     ];
464 464
                     $needExtension = Extensions::findFirst($parameters);
465
-                    $link          = $url->get('extensions/modify/' . $needExtension->id, null, null, $baseUri);
465
+                    $link          = $url->get('extensions/modify/'.$needExtension->id, null, null, $baseUri);
466 466
                 } else {
467
-                    $link = '#';//TODO сделать если будет раздел для допоплнинельных номеров пользователя
467
+                    $link = '#'; //TODO сделать если будет раздел для допоплнинельных номеров пользователя
468 468
                 }
469 469
                 break;
470 470
             case Fail2BanRules::class:
471
-                $link = '#';//TODO сделать если будет fail2ban
471
+                $link = '#'; //TODO сделать если будет fail2ban
472 472
                 break;
473 473
             case FirewallRules::class:
474
-                $link = $url->get('firewall/modify/' . $this->NetworkFilters->id, null, null, $baseUri);
474
+                $link = $url->get('firewall/modify/'.$this->NetworkFilters->id, null, null, $baseUri);
475 475
                 break;
476 476
             case Iax::class:
477
-                $link = $url->get('providers/modifyiax/' . $this->Providers->id, null, null, $baseUri);
477
+                $link = $url->get('providers/modifyiax/'.$this->Providers->id, null, null, $baseUri);
478 478
                 break;
479 479
             case IvrMenu::class:
480
-                $link = $url->get('ivr-menu/modify/' . $this->uniqid, null, null, $baseUri);
480
+                $link = $url->get('ivr-menu/modify/'.$this->uniqid, null, null, $baseUri);
481 481
                 break;
482 482
             case IvrMenuActions::class:
483
-                $link = $url->get('ivr-menu/modify/' . $this->IvrMenu->uniqid, null, null, $baseUri);
483
+                $link = $url->get('ivr-menu/modify/'.$this->IvrMenu->uniqid, null, null, $baseUri);
484 484
                 break;
485 485
             case Codecs::class:
486 486
                 break;
487 487
             case IncomingRoutingTable::class:
488
-                $link = $url->get('incoming-routes/modify/' . $this->id, null, null, $baseUri);
488
+                $link = $url->get('incoming-routes/modify/'.$this->id, null, null, $baseUri);
489 489
                 break;
490 490
             case LanInterfaces::class:
491 491
                 $link = $url->get('network/index/', null, null, $baseUri);
492 492
                 break;
493 493
             case NetworkFilters::class:
494
-                $link = $url->get('firewall/modify/' . $this->id, null, null, $baseUri);
494
+                $link = $url->get('firewall/modify/'.$this->id, null, null, $baseUri);
495 495
                 break;
496 496
             case OutgoingRoutingTable::class:
497
-                $link = $url->get('outbound-routes/modify/' . $this->id, null, null, $baseUri);
497
+                $link = $url->get('outbound-routes/modify/'.$this->id, null, null, $baseUri);
498 498
                 break;
499 499
             case OutWorkTimes::class:
500
-                $link = $url->get('out-off-work-time/modify/' . $this->id, null, null, $baseUri);
500
+                $link = $url->get('out-off-work-time/modify/'.$this->id, null, null, $baseUri);
501 501
                 break;
502 502
             case Providers::class:
503 503
                 if ($this->type === "IAX") {
504
-                    $link = $url->get('providers/modifyiax/' . $this->uniqid, null, null, $baseUri);
504
+                    $link = $url->get('providers/modifyiax/'.$this->uniqid, null, null, $baseUri);
505 505
                 } else {
506
-                    $link = $url->get('providers/modifysip/' . $this->uniqid, null, null, $baseUri);
506
+                    $link = $url->get('providers/modifysip/'.$this->uniqid, null, null, $baseUri);
507 507
                 }
508 508
                 break;
509 509
             case PbxSettings::class:
@@ -515,26 +515,26 @@  discard block
 block discarded – undo
515 515
             case Sip::class:
516 516
                 if ($this->Extensions) { // Это внутренний номер?
517 517
                     if ($this->Extensions->is_general_user_number === "1") {
518
-                        $link = $url->get('extensions/modify/' . $this->Extensions->id, null, null, $baseUri);
518
+                        $link = $url->get('extensions/modify/'.$this->Extensions->id, null, null, $baseUri);
519 519
                     } else {
520
-                        $link = '#';//TODO сделать если будет раздел для допоплнинельных номеров пользователя
520
+                        $link = '#'; //TODO сделать если будет раздел для допоплнинельных номеров пользователя
521 521
                     }
522 522
                 } elseif ($this->Providers) { // Это провайдер
523
-                    $link = $url->get('providers/modifysip/' . $this->Providers->id, null, null, $baseUri);
523
+                    $link = $url->get('providers/modifysip/'.$this->Providers->id, null, null, $baseUri);
524 524
                 }
525 525
                 break;
526 526
             case Users::class:
527
-                $parameters    = [
527
+                $parameters = [
528 528
                     'conditions' => 'userid=:userid:',
529 529
                     'bind'       => [
530 530
                         'userid' => $this->id,
531 531
                     ],
532 532
                 ];
533 533
                 $needExtension = Extensions::findFirst($parameters);
534
-                $link          = $url->get('extensions/modify/' . $needExtension->id, null, null, $baseUri);
534
+                $link          = $url->get('extensions/modify/'.$needExtension->id, null, null, $baseUri);
535 535
                 break;
536 536
             case SoundFiles::class:
537
-                $link = $url->get('sound-files/modify/' . $this->id, null, null, $baseUri);
537
+                $link = $url->get('sound-files/modify/'.$this->id, null, null, $baseUri);
538 538
                 break;
539 539
             default:
540 540
         }
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
         $metaData      = $this->di->get('modelsMetadata');
551 551
         $defaultValues = $metaData->getDefaultValues($this);
552 552
         foreach ($defaultValues as $field => $value) {
553
-            if ( ! isset($this->{$field})) {
553
+            if (!isset($this->{$field})) {
554 554
                 $this->{$field} = $value;
555 555
             }
556 556
         }
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
                 = $currentDeleteRecord->_modelsManager->getRelations(get_class($currentDeleteRecord));
685 685
         foreach ($relations as $relation) {
686 686
             $foreignKey = $relation->getOption('foreignKey');
687
-            if ( ! array_key_exists('action', $foreignKey)) {
687
+            if (!array_key_exists('action', $foreignKey)) {
688 688
                 continue;
689 689
             }
690 690
             // Check if there are some record which restrict delete current record
@@ -702,10 +702,10 @@  discard block
 block discarded – undo
702 702
                     ? ' OR ' : '';
703 703
                 $parameters['conditions']             .= $referencedField
704 704
                     . '= :field'
705
-                    . $index . ':';
705
+                    . $index.':';
706 706
                 $bindField
707 707
                                                       = $mappedFields[$index];
708
-                $parameters['bind']['field' . $index] = $currentDeleteRecord->$bindField;
708
+                $parameters['bind']['field'.$index] = $currentDeleteRecord->$bindField;
709 709
             }
710 710
             $relatedRecords = $relatedModel::find($parameters);
711 711
             switch ($foreignKey['action']) {
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
     private function processSettingsChanges(string $action): void
779 779
     {
780 780
         if (php_sapi_name() !== 'cli') {
781
-            if ( ! $this->hasSnapshotData()) {
781
+            if (!$this->hasSnapshotData()) {
782 782
                 return;
783 783
             } // nothing changed
784 784
 
Please login to merge, or discard this patch.