Passed
Push — master ( 15b19d...384de0 )
by Nikolay
11:50 queued 06:02
created
src/AdminCabinet/Providers/FlashProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     {
33 33
         $di->setShared(
34 34
             self::SERVICE_NAME,
35
-            function () {
35
+            function() {
36 36
                 $cssClasses = [
37 37
                     'error'   => 'ui negative message',
38 38
                     'success' => 'ui positive message',
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@
 block discarded – undo
32 32
     {
33 33
         $di->setShared(
34 34
             self::SERVICE_NAME,
35
-            function () {
35
+            function ()
36
+            {
36 37
                 $cssClasses = [
37 38
                     'error'   => 'ui negative message',
38 39
                     'success' => 'ui positive message',
Please login to merge, or discard this patch.
src/AdminCabinet/Providers/BeanstalkConnectionProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     {
33 33
         $di->setShared(
34 34
             self::SERVICE_NAME,
35
-            function () {
35
+            function() {
36 36
                 return new BeanstalkClient(WorkerModelsEvents::class);
37 37
             }
38 38
         );
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@
 block discarded – undo
32 32
     {
33 33
         $di->setShared(
34 34
             self::SERVICE_NAME,
35
-            function () {
35
+            function ()
36
+            {
36 37
                 return new BeanstalkClient(WorkerModelsEvents::class);
37 38
             }
38 39
         );
Please login to merge, or discard this patch.
src/AdminCabinet/Providers/ElementsProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     {
33 33
         $di->setShared(
34 34
             self::SERVICE_NAME,
35
-            function () {
35
+            function() {
36 36
                 return new Elements();
37 37
             }
38 38
         );
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@
 block discarded – undo
32 32
     {
33 33
         $di->setShared(
34 34
             self::SERVICE_NAME,
35
-            function () {
35
+            function ()
36
+            {
36 37
                 return new Elements();
37 38
             }
38 39
         );
Please login to merge, or discard this patch.
src/AdminCabinet/Providers/ViewProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     {
34 34
         $di->setShared(
35 35
             self::SERVICE_NAME,
36
-            function () {
36
+            function() {
37 37
                 $viewsDir = appPath('src/AdminCabinet/Views');
38 38
                 $view = new View();
39 39
                 $view->setViewsDir($viewsDir);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@
 block discarded – undo
33 33
     {
34 34
         $di->setShared(
35 35
             self::SERVICE_NAME,
36
-            function () {
36
+            function ()
37
+            {
37 38
                 $viewsDir = appPath('src/AdminCabinet/Views');
38 39
                 $view = new View();
39 40
                 $view->setViewsDir($viewsDir);
Please login to merge, or discard this patch.
src/AdminCabinet/Providers/SessionProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         $phpSessionDir = $di->getShared('config')->path('www.phpSessionDir');
35 35
         $di->setShared(
36 36
             self::SERVICE_NAME,
37
-            function () use ($phpSessionDir) {
37
+            function() use ($phpSessionDir) {
38 38
                 $session = new SessionManager();
39 39
                 $files   = new SessionAdapter(
40 40
                     [
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,8 @@
 block discarded – undo
34 34
         $phpSessionDir = $di->getShared('config')->path('www.phpSessionDir');
35 35
         $di->setShared(
36 36
             self::SERVICE_NAME,
37
-            function () use ($phpSessionDir) {
37
+            function () use ($phpSessionDir)
38
+            {
38 39
                 $session = new SessionManager();
39 40
                 $files   = new SessionAdapter(
40 41
                     [
Please login to merge, or discard this patch.
src/AdminCabinet/Providers/DispatcherProvider.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $di->setShared(
37 37
             self::SERVICE_NAME,
38
-            function () {
38
+            function() {
39 39
                 $eventsManager = new EventsManager();
40 40
 
41 41
                 /**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 /**
53 53
                  * Handle exceptions and not-found exceptions using NotFoundPlugin
54 54
                  */
55
-                if (! class_exists(PrettyPageHandler::class)) {
55
+                if (!class_exists(PrettyPageHandler::class)) {
56 56
                     $eventsManager->attach(
57 57
                         'dispatch:beforeException',
58 58
                         new NotFoundPlugin()
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,8 @@
 block discarded – undo
35 35
     {
36 36
         $di->setShared(
37 37
             self::SERVICE_NAME,
38
-            function () {
38
+            function ()
39
+            {
39 40
                 $eventsManager = new EventsManager();
40 41
 
41 42
                 /**
Please login to merge, or discard this patch.
src/AdminCabinet/Providers/VoltProvider.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
         $appConfig = $di->getShared('config')->adminApplication;
32 32
         $di->setShared(
33 33
             self::SERVICE_NAME,
34
-            function () use ($view, $di, $appConfig) {
35
-                $voltCacheDir = $appConfig->voltCacheDir . '/';
34
+            function() use ($view, $di, $appConfig) {
35
+                $voltCacheDir = $appConfig->voltCacheDir.'/';
36 36
                 $volt         = new VoltEngine($view, $di);
37 37
                 $volt->setOptions(
38 38
                     [
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
                 $compiler->addFunction('in_array', 'in_array');
45 45
 
46 46
                 if ($appConfig->debugMode === true) {
47
-                    $cacheFiles = glob($appConfig->voltCacheDir . '/*.php');
48
-                    if ($cacheFiles!==false){
47
+                    $cacheFiles = glob($appConfig->voltCacheDir.'/*.php');
48
+                    if ($cacheFiles !== false) {
49 49
                         array_map(
50 50
                             'unlink',
51 51
                             $cacheFiles
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
         $appConfig = $di->getShared('config')->adminApplication;
32 32
         $di->setShared(
33 33
             self::SERVICE_NAME,
34
-            function () use ($view, $di, $appConfig) {
34
+            function () use ($view, $di, $appConfig)
35
+            {
35 36
                 $voltCacheDir = $appConfig->voltCacheDir . '/';
36 37
                 $volt         = new VoltEngine($view, $di);
37 38
                 $volt->setOptions(
Please login to merge, or discard this patch.
src/AdminCabinet/Providers/LanguageSelectorProvider.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
31 31
     {
32 32
         $di->setShared(
33 33
             self::SERVICE_NAME,
34
-            function () use ($di){
34
+            function() use ($di){
35 35
                 $roSession = $di->getShared('sessionRO');
36 36
                 if ($roSession !== null && array_key_exists(
37 37
                         'WebAdminLanguage',
38 38
                         $roSession
39
-                    ) && ! empty($roSession['WebAdminLanguage'])) {
39
+                    ) && !empty($roSession['WebAdminLanguage'])) {
40 40
                     $language = $roSession['WebAdminLanguage'];
41 41
                 } elseif (array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) {
42 42
                     $ls       = new LanguageSelector();
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
     {
32 32
         $di->setShared(
33 33
             self::SERVICE_NAME,
34
-            function () use ($di){
34
+            function () use ($di)
35
+            {
35 36
                 $roSession = $di->getShared('sessionRO');
36 37
                 if ($roSession !== null && array_key_exists(
37 38
                         'WebAdminLanguage',
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/QueueConf.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             $q_conf .= "\n";
87 87
         }
88 88
 
89
-        Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/queues.conf', $q_conf);
89
+        Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/queues.conf', $q_conf);
90 90
 
91 91
     }
92 92
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         // Генерация внутреннего номерного плана.
141 141
         $conf = "[queue_agent_answer]\n";
142 142
         $conf .= "exten => s,1,NoOp(--- Answer Queue ---)\n\t";
143
-        $conf .= 'same => n,Gosub(queue_answer,${EXTEN},1)' . "\n\t";
143
+        $conf .= 'same => n,Gosub(queue_answer,${EXTEN},1)'."\n\t";
144 144
         $conf .= "same => n,Return()\n\n";
145 145
 
146 146
         return $conf;
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
         $conf = '';
171 171
         $db_data = $this->getQueueData();
172 172
         foreach ($db_data as $queue) {
173
-            $conf .= 'exten => _' . $queue['extension'] . ',1,Set(__ISTRANSFER=transfer_)' . " \n\t";
174
-            $conf .= 'same => n,Goto(internal,${EXTEN},1)' . " \n";
173
+            $conf .= 'exten => _'.$queue['extension'].',1,Set(__ISTRANSFER=transfer_)'." \n\t";
174
+            $conf .= 'same => n,Goto(internal,${EXTEN},1)'." \n";
175 175
         }
176 176
         $conf .= "\n";
177 177
 
@@ -190,36 +190,36 @@  discard block
 block discarded – undo
190 190
         $queue_ext_conf = '';
191 191
         $db_data = $this->getQueueData();
192 192
         foreach ($db_data as $queue) {
193
-            $calleridPrefix = preg_replace('/[^a-zA-Zа-яА-Я0-9 ]/ui', '', $queue['callerid_prefix']??'');
193
+            $calleridPrefix = preg_replace('/[^a-zA-Zа-яА-Я0-9 ]/ui', '', $queue['callerid_prefix'] ?? '');
194 194
 
195 195
             $queue_ext_conf .= "exten => {$queue['extension']},1,NoOp(--- Start Queue ---) \n\t";
196 196
             $queue_ext_conf .= "same => n,Answer() \n\t";
197
-            $queue_ext_conf .= 'same => n,Set(__QUEUE_SRC_CHAN=${CHANNEL})' . "\n\t";
198
-            $queue_ext_conf .= 'same => n,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Gosub(set_orign_chan,s,1))' . "\n\t";
199
-            $queue_ext_conf .= 'same => n,Set(CHANNEL(hangup_handler_wipe)=hangup_handler,s,1)' . "\n\t";
200
-            $queue_ext_conf .= 'same => n,Gosub(queue_start,${EXTEN},1)' . "\n\t";
197
+            $queue_ext_conf .= 'same => n,Set(__QUEUE_SRC_CHAN=${CHANNEL})'."\n\t";
198
+            $queue_ext_conf .= 'same => n,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Gosub(set_orign_chan,s,1))'."\n\t";
199
+            $queue_ext_conf .= 'same => n,Set(CHANNEL(hangup_handler_wipe)=hangup_handler,s,1)'."\n\t";
200
+            $queue_ext_conf .= 'same => n,Gosub(queue_start,${EXTEN},1)'."\n\t";
201 201
 
202 202
             $options = '';
203 203
             if (isset($queue['caller_hear']) && $queue['caller_hear'] === 'ringing') {
204 204
                 $options .= 'r'; // Установить КПВ (гудки) вместо Музыки на Удержании для ожидающих в очереди
205 205
             }
206
-            $ringlength     = (trim($queue['timeout_to_redirect_to_extension']) == '') ? 300 : $queue['timeout_to_redirect_to_extension'];
207
-            if(!empty($calleridPrefix)){
206
+            $ringlength = (trim($queue['timeout_to_redirect_to_extension']) == '') ? 300 : $queue['timeout_to_redirect_to_extension'];
207
+            if (!empty($calleridPrefix)) {
208 208
                 $queue_ext_conf .= "same => n,Set(CALLERID(name)={$calleridPrefix}:".'${CALLERID(name)}'.") \n\t";
209 209
             }
210 210
 
211 211
             $queue_ext_conf .= "same => n,Queue({$queue['uniqid']},CkT{$options},,,{$ringlength},,,queue_agent_answer) \n\t";
212 212
             // Оповестим о завершении работы очереди.
213
-            $queue_ext_conf .= 'same => n,Gosub(queue_end,${EXTEN},1)' . "\n\t";
213
+            $queue_ext_conf .= 'same => n,Gosub(queue_end,${EXTEN},1)'."\n\t";
214 214
 
215 215
             if (trim($queue['timeout_extension']) !== '') {
216 216
                 // Если по таймауту не ответили, то выполним переадресацию.
217
-                $queue_ext_conf .= 'same => n,ExecIf($["${QUEUESTATUS}" == "TIMEOUT"]?Goto(internal,' . $queue['timeout_extension'] . ',1))' . " \n\t";
217
+                $queue_ext_conf .= 'same => n,ExecIf($["${QUEUESTATUS}" == "TIMEOUT"]?Goto(internal,'.$queue['timeout_extension'].',1))'." \n\t";
218 218
             }
219 219
             if (trim($queue['redirect_to_extension_if_empty']) !== '') {
220 220
                 // Если пустая очередь, то выполним переадресацию.
221
-                $exp            = '$["${QUEUESTATUS}" == "JOINEMPTY" || "${QUEUESTATUS}" == "LEAVEEMPTY" ]';
222
-                $queue_ext_conf .= 'same => n,ExecIf(' . $exp . '?Goto(internal,' . $queue['redirect_to_extension_if_empty'] . ',1))' . " \n\t";
221
+                $exp = '$["${QUEUESTATUS}" == "JOINEMPTY" || "${QUEUESTATUS}" == "LEAVEEMPTY" ]';
222
+                $queue_ext_conf .= 'same => n,ExecIf('.$exp.'?Goto(internal,'.$queue['redirect_to_extension_if_empty'].',1))'." \n\t";
223 223
             }
224 224
             $queue_ext_conf .= "\n";
225 225
         }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      */
233 233
     public static function queueReload(): void
234 234
     {
235
-        $queue            = new self();
235
+        $queue = new self();
236 236
         $queue->generateConfig();
237 237
         $out = [];
238 238
         $asteriskPath = Util::which('asterisk');
Please login to merge, or discard this patch.