@@ -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 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | $di->setShared( |
40 | 40 | self::SERVICE_NAME, |
41 | - function () { |
|
41 | + function() { |
|
42 | 42 | return new Registry(); |
43 | 43 | } |
44 | 44 | ); |
@@ -38,7 +38,8 @@ |
||
38 | 38 | { |
39 | 39 | $di->setShared( |
40 | 40 | self::SERVICE_NAME, |
41 | - function () { |
|
41 | + function () |
|
42 | + { |
|
42 | 43 | return new Registry(); |
43 | 44 | } |
44 | 45 | ); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | $di->setShared( |
49 | 49 | self::SERVICE_NAME, |
50 | - function () use ($tempDir){ |
|
50 | + function() use ($tempDir){ |
|
51 | 51 | $serializerFactory = new SerializerFactory(); |
52 | 52 | |
53 | 53 | $options = [ |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | 'storageDir' => $tempDir, |
57 | 57 | ]; |
58 | 58 | |
59 | - $adapter = new Stream ($serializerFactory, $options); |
|
59 | + $adapter = new Stream($serializerFactory, $options); |
|
60 | 60 | |
61 | 61 | return new Cache($adapter); |
62 | 62 | } |
@@ -47,7 +47,8 @@ |
||
47 | 47 | } |
48 | 48 | $di->setShared( |
49 | 49 | self::SERVICE_NAME, |
50 | - function () use ($tempDir){ |
|
50 | + function () use ($tempDir) |
|
51 | + { |
|
51 | 52 | $serializerFactory = new SerializerFactory(); |
52 | 53 | |
53 | 54 | $options = [ |