@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function generateConfigProtected(): void |
| 19 | 19 | { |
| 20 | - $conf = "[modules]\n" . |
|
| 20 | + $conf = "[modules]\n". |
|
| 21 | 21 | "autoload=no\n"; |
| 22 | 22 | |
| 23 | 23 | $modules = [ |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $conf .= $appClass->generateModulesConf(); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/modules.conf', $conf); |
|
| 182 | - Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/codecs.conf', ''); |
|
| 181 | + Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/modules.conf', $conf); |
|
| 182 | + Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/codecs.conf', ''); |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | \ No newline at end of file |
@@ -22,23 +22,23 @@ |
||
| 22 | 22 | // CLI> sip notify yealink-reboot autoprovision_user |
| 23 | 23 | // autoprovision_user - id sip учетной записи. |
| 24 | 24 | $conf = ''; |
| 25 | - $conf .= "[yealink-reboot]\n" . |
|
| 26 | - "Event=>check-sync\;reboot=true\n" . |
|
| 25 | + $conf .= "[yealink-reboot]\n". |
|
| 26 | + "Event=>check-sync\;reboot=true\n". |
|
| 27 | 27 | "Content-Length=>0\n". |
| 28 | 28 | "Content=>\n\n"; |
| 29 | 29 | |
| 30 | - $conf .= "[snom-reboot]\n" . |
|
| 31 | - "Event=>check-sync\;reboot=true\n" . |
|
| 30 | + $conf .= "[snom-reboot]\n". |
|
| 31 | + "Event=>check-sync\;reboot=true\n". |
|
| 32 | 32 | "Content=>\n\n"; |
| 33 | 33 | // Пример |
| 34 | 34 | // CLI> sip notify yealink-action-ok autoprovision_user |
| 35 | 35 | // http://support.yealink.com/faq/faqInfo?id=173 |
| 36 | - $conf .= "[yealink-action-ok]\n" . |
|
| 37 | - "Content-Type=>message/sipfrag\n" . |
|
| 38 | - "Event=>ACTION-URI\n" . |
|
| 36 | + $conf .= "[yealink-action-ok]\n". |
|
| 37 | + "Content-Type=>message/sipfrag\n". |
|
| 38 | + "Event=>ACTION-URI\n". |
|
| 39 | 39 | "Content=>key=SPEAKER\n". |
| 40 | 40 | "Content=>\n\n"; |
| 41 | 41 | |
| 42 | - Util::fileWriteContent($this->config->path('asterisk.astetcdir') . '/pjsip_notify.conf', $conf); |
|
| 42 | + Util::fileWriteContent($this->config->path('asterisk.astetcdir').'/pjsip_notify.conf', $conf); |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | \ No newline at end of file |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | /** |
| 22 | 22 | * Auto-loader configuration |
| 23 | 23 | */ |
| 24 | -require_once __DIR__ . '/../../src/Common/Config/ClassLoader.php'; |
|
| 24 | +require_once __DIR__.'/../../src/Common/Config/ClassLoader.php'; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Load application services |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | // register_shutdown_function([PhpError::class,'runtimeShutdown']); |
| 37 | 37 | // set_error_handler([PhpError::class,'errorHandler']); |
| 38 | 38 | |
| 39 | -if (class_exists(PrettyPageHandler::class)){ |
|
| 39 | +if (class_exists(PrettyPageHandler::class)) { |
|
| 40 | 40 | $whoops = new Run(); |
| 41 | 41 | $whoops->pushHandler(new PrettyPageHandler()); |
| 42 | 42 | $whoops->register(); |
@@ -44,9 +44,9 @@ |
||
| 44 | 44 | |
| 45 | 45 | try { |
| 46 | 46 | $application = new Application($di); |
| 47 | - echo $application->handle($_SERVER['REQUEST_URI'])->getContent(); |
|
| 47 | + echo $application->handle($_SERVER['REQUEST_URI'])->getContent(); |
|
| 48 | 48 | } catch (Throwable $e) { |
| 49 | - $errorLogger->captureException($e); |
|
| 50 | - PhpError::exceptionHandler($e); |
|
| 51 | - echo $e->getMessage(); |
|
| 49 | + $errorLogger->captureException($e); |
|
| 50 | + PhpError::exceptionHandler($e); |
|
| 51 | + echo $e->getMessage(); |
|
| 52 | 52 | } |
| 53 | 53 | \ No newline at end of file |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | $response = json_decode($response, true); |
| 66 | 66 | |
| 67 | 67 | $filename = $response['data']['filename'] ?? ''; |
| 68 | - if ( ! file_exists($filename)) { |
|
| 68 | + if (!file_exists($filename)) { |
|
| 69 | 69 | $response['messages'][] = 'Log file not found'; |
| 70 | 70 | } else { |
| 71 | 71 | $response['data']['filename'] = $filename; |
| 72 | - $response['data']['content'] = mb_convert_encoding('' . file_get_contents($filename), 'UTF-8', 'UTF-8'); |
|
| 72 | + $response['data']['content'] = mb_convert_encoding(''.file_get_contents($filename), 'UTF-8', 'UTF-8'); |
|
| 73 | 73 | unlink($filename); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | if (array_key_exists('filename', $response['data'])) { |
| 102 | 102 | $di = Di::getDefault(); |
| 103 | 103 | $downloadLink = $di->getShared('config')->path('www.downloadCacheDir'); |
| 104 | - $filename = $downloadLink . "/" . $response['data']['filename'] ?? ''; |
|
| 105 | - if ( ! file_exists($filename)) { |
|
| 104 | + $filename = $downloadLink."/".$response['data']['filename'] ?? ''; |
|
| 105 | + if (!file_exists($filename)) { |
|
| 106 | 106 | $response['messages'][] = 'File not found'; |
| 107 | 107 | } else { |
| 108 | 108 | $scheme = $this->request->getScheme(); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $di->setShared( |
| 32 | 32 | self::SERVICE_NAME, |
| 33 | - function () { |
|
| 33 | + function() { |
|
| 34 | 34 | $response = new Response(); |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -30,7 +30,8 @@ |
||
| 30 | 30 | { |
| 31 | 31 | $di->setShared( |
| 32 | 32 | self::SERVICE_NAME, |
| 33 | - function () { |
|
| 33 | + function () |
|
| 34 | + { |
|
| 34 | 35 | $response = new Response(); |
| 35 | 36 | |
| 36 | 37 | /** |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | { |
| 36 | 36 | $di->setShared( |
| 37 | 37 | self::SERVICE_NAME, |
| 38 | - function () { |
|
| 38 | + function() { |
|
| 39 | 39 | // Create a events manager |
| 40 | 40 | $eventsManager = new EventsManager(); |
| 41 | 41 | $dispatcher = new Dispatcher(); |
@@ -35,7 +35,8 @@ |
||
| 35 | 35 | { |
| 36 | 36 | $di->setShared( |
| 37 | 37 | self::SERVICE_NAME, |
| 38 | - function () { |
|
| 38 | + function () |
|
| 39 | + { |
|
| 39 | 40 | // Create a events manager |
| 40 | 41 | $eventsManager = new EventsManager(); |
| 41 | 42 | $dispatcher = new Dispatcher(); |
@@ -129,14 +129,14 @@ |
||
| 129 | 129 | |
| 130 | 130 | //Add modules firewall rules |
| 131 | 131 | $di = Di::getDefault(); |
| 132 | - if ($di!==null) { |
|
| 132 | + if ($di !== null) { |
|
| 133 | 133 | $pbxConfModules = $di->get('pbxConfModules'); |
| 134 | - foreach ($pbxConfModules as $pbxConfModule){ |
|
| 134 | + foreach ($pbxConfModules as $pbxConfModule) { |
|
| 135 | 135 | $additionalRules = $pbxConfModule->getDefaultFirewallRules(); |
| 136 | - if ($additionalRules!==[]){ |
|
| 136 | + if ($additionalRules !== []) { |
|
| 137 | 137 | $additionalRules = array_change_key_case($additionalRules, CASE_UPPER); |
| 138 | - foreach ($additionalRules as $key=>$rule){ |
|
| 139 | - $template[$key]=$rule; |
|
| 138 | + foreach ($additionalRules as $key=>$rule) { |
|
| 139 | + $template[$key] = $rule; |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $gnatsConfig = $di->getShared('config')->get('gnats'); |
| 35 | 35 | $di->setShared( |
| 36 | 36 | self::SERVICE_NAME, |
| 37 | - function () use ($gnatsConfig) { |
|
| 37 | + function() use ($gnatsConfig) { |
|
| 38 | 38 | $connectionOptions = new NatsConnectionOptions(); |
| 39 | 39 | $host = $gnatsConfig->host; |
| 40 | 40 | $port = $gnatsConfig->port; |
@@ -34,7 +34,8 @@ |
||
| 34 | 34 | $gnatsConfig = $di->getShared('config')->get('gnats'); |
| 35 | 35 | $di->setShared( |
| 36 | 36 | self::SERVICE_NAME, |
| 37 | - function () use ($gnatsConfig) { |
|
| 37 | + function () use ($gnatsConfig) |
|
| 38 | + { |
|
| 38 | 39 | $connectionOptions = new NatsConnectionOptions(); |
| 39 | 40 | $host = $gnatsConfig->host; |
| 40 | 41 | $port = $gnatsConfig->port; |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $baseUri = $di->getShared('config')->path('adminApplication.baseUri'); |
| 41 | 41 | $di->setShared( |
| 42 | 42 | self::SERVICE_NAME, |
| 43 | - function () use ($baseUri) { |
|
| 43 | + function() use ($baseUri) { |
|
| 44 | 44 | $url = new Url(); |
| 45 | 45 | $url->setBaseUri($baseUri); |
| 46 | 46 | |
@@ -40,7 +40,8 @@ |
||
| 40 | 40 | $baseUri = $di->getShared('config')->path('adminApplication.baseUri'); |
| 41 | 41 | $di->setShared( |
| 42 | 42 | self::SERVICE_NAME, |
| 43 | - function () use ($baseUri) { |
|
| 43 | + function () use ($baseUri) |
|
| 44 | + { |
|
| 44 | 45 | $url = new Url(); |
| 45 | 46 | $url->setBaseUri($baseUri); |
| 46 | 47 | |