Passed
Pull Request — master (#23)
by Nikolay
09:42 queued 03:08
created
src/Core/Asterisk/Configs/DialplanApplicationConf.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
         $app_data = '';
65 65
         foreach ($arr_data_app as $row) {
66 66
             if ('' === $app_data) {
67
-                $app_data .= "exten => _{$app['extension']},$row" . "\n\t";
67
+                $app_data .= "exten => _{$app['extension']},$row"."\n\t";
68 68
             } else {
69
-                $app_data .= "same => $row" . "\n\t";
69
+                $app_data .= "same => $row"."\n\t";
70 70
             }
71 71
         }
72 72
 
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
     private function generatePhpApp($app): string
82 82
     {
83 83
         $agiBinDir = $this->config->path('asterisk.astagidir');
84
-        $text_app     = "#!/usr/bin/php\n";
85
-        $text_app     .= base64_decode($app['applicationlogic']);
84
+        $text_app = "#!/usr/bin/php\n";
85
+        $text_app .= base64_decode($app['applicationlogic']);
86 86
         file_put_contents("{$agiBinDir}/{$app['uniqid']}.php", $text_app);
87 87
         chmod("{$agiBinDir}/{$app['uniqid']}.php", 0755);
88 88
 
89
-        $result = 'exten => _' . $app['extension'] . ',1,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Gosub(set_orign_chan,s,1))' . "\n\t";
90
-        $result .= 'same => n,Gosub(dial_app,${EXTEN},1)' . "\n\t";
89
+        $result = 'exten => _'.$app['extension'].',1,ExecIf($["${CHANNEL(channeltype)}" == "Local"]?Gosub(set_orign_chan,s,1))'."\n\t";
90
+        $result .= 'same => n,Gosub(dial_app,${EXTEN},1)'."\n\t";
91 91
         $result .= "same => n,AGI({$app['uniqid']}.php)\n";
92 92
 
93 93
         return $result;
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/ChanDahdiConf.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@
 block discarded – undo
18 18
 
19 19
     protected function generateConfigProtected(): void
20 20
     {
21
-        $conf = "[trunkgroups]\n" .
22
-            "[channels]\n" .
21
+        $conf = "[trunkgroups]\n".
22
+            "[channels]\n".
23 23
             "";
24 24
 
25
-        file_put_contents($this->config->path('asterisk.astetcdir') . '/chan_dahdi.conf', $conf);
25
+        file_put_contents($this->config->path('asterisk.astetcdir').'/chan_dahdi.conf', $conf);
26 26
     }
27 27
 
28 28
 }
29 29
\ No newline at end of file
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/UdptlConf.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') . '/udptl.conf', $conf);
22
+        file_put_contents($this->config->path('asterisk.astetcdir').'/udptl.conf', $conf);
23 23
     }
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/CcssConf.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
 
19 19
     protected function generateConfigProtected(): void
20 20
     {
21
-        $conf = "[general]\n" .
21
+        $conf = "[general]\n".
22 22
             "cc_max_requests = 20\n";
23 23
 
24
-        file_put_contents($this->config->path('asterisk.astetcdir') . '/ccss.conf', $conf);
24
+        file_put_contents($this->config->path('asterisk.astetcdir').'/ccss.conf', $conf);
25 25
     }
26 26
 
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/AclConf.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function getSettings(): void
26 26
     {
27 27
         // Настройки для текущего класса.
28
-        $this->data_peers     = $this->getPeers();
28
+        $this->data_peers = $this->getPeers();
29 29
     }
30 30
 
31 31
     /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             $deny         = (trim($peer['deny']) === '') ? '0.0.0.0/0.0.0.0' : $peer['deny'];
62 62
             $permit       = (trim($peer['permit']) === '') ? '0.0.0.0/0.0.0.0' : $peer['permit'];
63 63
 
64
-            $options  = [
64
+            $options = [
65 65
                 'deny'   => $deny,
66 66
                 'permit' => $permit,
67 67
             ];
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
         }
72 72
 
73
-        Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/acl.conf', $conf_acl);
73
+        Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/acl.conf', $conf_acl);
74 74
     }
75 75
 
76 76
 
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/CdrSqlite3CustomConf.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@
 block discarded – undo
26 26
             $values .= "'\${CDR($value)}'";
27 27
         }
28 28
 
29
-        $conf = "[master]\n" .
30
-            "table=cdr\n" .
31
-            "columns => $cal \n" .
29
+        $conf = "[master]\n".
30
+            "table=cdr\n".
31
+            "columns => $cal \n".
32 32
             "values => $values \n";
33 33
 
34
-        file_put_contents($this->config->path('asterisk.astetcdir') . "/cdr_sqlite3_custom.conf", $conf);
34
+        file_put_contents($this->config->path('asterisk.astetcdir')."/cdr_sqlite3_custom.conf", $conf);
35 35
     }
36 36
 }
37 37
\ No newline at end of file
Please login to merge, or discard this patch.
src/Core/Asterisk/Configs/MusicOnHoldConf.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@
 block discarded – undo
19 19
 
20 20
     protected function generateConfigProtected(): void
21 21
     {
22
-        $mohpath    = $this->config->path('asterisk.mohdir');
22
+        $mohpath = $this->config->path('asterisk.mohdir');
23 23
 
24
-        $conf = "[default]\n" .
25
-            "mode=files\n" .
24
+        $conf = "[default]\n".
25
+            "mode=files\n".
26 26
             "directory=$mohpath\n\n";
27 27
 
28
-        Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/musiconhold.conf', $conf);
28
+        Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/musiconhold.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/CelSqlite3CustomConf.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,11 +21,11 @@
 block discarded – undo
21 21
         $cal    = "eventtype, eventtime, cidname, cidnum, cidani, cidrdnis, ciddnid, context, exten, channame, appname, appdata, amaflags, accountcode, uniqueid, userfield, peer, userdeftype, eventextra, linkedid";
22 22
         $values = '\'${eventtype}\',\'${eventtime}\',\'${CALLERID(name)}\',\'${CALLERID(num)}\',\'${CALLERID(ANI)}\',\'${CALLERID(RDNIS)}\',\'${CALLERID(DNID)}\',\'${CHANNEL(context)}\',\'${CHANNEL(exten)}\',\'${CHANNEL(channame)}\',\'${CHANNEL(appname)}\',\'${CHANNEL(appdata)}\',\'${CHANNEL(amaflags)}\',\'${CHANNEL(accountcode)}\',\'${CHANNEL(uniqueid)}\',\'${CHANNEL(userfield)}\',\'${BRIDGEPEER}\',\'${userdeftype}\',\'${eventextra}\',\'${CHANNEL(linkedid)}\'';
23 23
 
24
-        $conf = "[master]\n" .
25
-            "table = cel\n" .
26
-            "columns => $cal \n" .
24
+        $conf = "[master]\n".
25
+            "table = cel\n".
26
+            "columns => $cal \n".
27 27
             "values => $values \n";
28 28
 
29
-        file_put_contents($this->config->path('asterisk.astetcdir') . "/cel_sqlite3_custom.conf", $conf);
29
+        file_put_contents($this->config->path('asterisk.astetcdir')."/cel_sqlite3_custom.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/ManagerConf.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -40,15 +40,15 @@  discard block
 block discarded – undo
40 40
             'CDR(recordingfile)',
41 41
         ];
42 42
 
43
-        $conf = "[general]\n" .
44
-            "enabled = yes\n" .
45
-            "port = {$this->generalSettings['AMIPort']};\n" .
46
-            "bindaddr = 0.0.0.0\n" .
47
-            "displayconnects = no\n" .
48
-            "allowmultiplelogin = yes\n" .
49
-            "webenabled = yes\n" .
50
-            "timestampevents = yes\n" .
51
-            'channelvars=' . implode(',', $vars) . "\n" .
43
+        $conf = "[general]\n".
44
+            "enabled = yes\n".
45
+            "port = {$this->generalSettings['AMIPort']};\n".
46
+            "bindaddr = 0.0.0.0\n".
47
+            "displayconnects = no\n".
48
+            "allowmultiplelogin = yes\n".
49
+            "webenabled = yes\n".
50
+            "timestampevents = yes\n".
51
+            'channelvars='.implode(',', $vars)."\n".
52 52
             "httptimeout = 60\n\n";
53 53
 
54 54
         if ($this->generalSettings['AMIEnabled'] === '1') {
@@ -66,17 +66,17 @@  discard block
 block discarded – undo
66 66
             }
67 67
 
68 68
             foreach ($result as $user) {
69
-                $conf .= '[' . $user['username'] . "]\n";
70
-                $conf .= 'secret=' . $user['secret'] . "\n";
69
+                $conf .= '['.$user['username']."]\n";
70
+                $conf .= 'secret='.$user['secret']."\n";
71 71
 
72 72
                 if (trim($user['deny']) !== '') {
73
-                    $conf .= 'deny=' . $user['deny'] . "\n";
73
+                    $conf .= 'deny='.$user['deny']."\n";
74 74
                 }
75 75
                 if (trim($user['permit']) !== '') {
76
-                    $conf .= 'permit=' . $user['permit'] . "\n";
76
+                    $conf .= 'permit='.$user['permit']."\n";
77 77
                 }
78 78
 
79
-                $keys  = [
79
+                $keys = [
80 80
                     'call',
81 81
                     'cdr',
82 82
                     'originate',
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
             }
116 116
             $conf .= "\n";
117 117
         }
118
-        $conf .= '[phpagi]' . "\n";
119
-        $conf .= 'secret=phpagi' . "\n";
120
-        $conf .= 'deny=0.0.0.0/0.0.0.0' . "\n";
121
-        $conf .= 'permit=127.0.0.1/255.255.255.255' . "\n";
122
-        $conf .= 'read=all' . "\n";
123
-        $conf .= 'write=all' . "\n";
118
+        $conf .= '[phpagi]'."\n";
119
+        $conf .= 'secret=phpagi'."\n";
120
+        $conf .= 'deny=0.0.0.0/0.0.0.0'."\n";
121
+        $conf .= 'permit=127.0.0.1/255.255.255.255'."\n";
122
+        $conf .= 'read=all'."\n";
123
+        $conf .= 'write=all'."\n";
124 124
         $conf .= "eventfilter=!Event: Newexten\n";
125 125
         $conf .= "\n";
126 126
 
@@ -128,6 +128,6 @@  discard block
 block discarded – undo
128 128
         foreach ($additionalModules as $appClass) {
129 129
             $conf .= $appClass->generateManagerConf();
130 130
         }
131
-        Util::fileWriteContent($this->config->path('asterisk.astetcdir') .'/manager.conf', $conf);
131
+        Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/manager.conf', $conf);
132 132
     }
133 133
 }
134 134
\ No newline at end of file
Please login to merge, or discard this patch.