@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $di->setShared( |
35 | 35 | self::SERVICE_NAME, |
36 | - function () { |
|
36 | + function() { |
|
37 | 37 | return new BeanstalkClient(WorkerApiCommands::class); |
38 | 38 | } |
39 | 39 | ); |
@@ -33,7 +33,8 @@ |
||
33 | 33 | { |
34 | 34 | $di->setShared( |
35 | 35 | self::SERVICE_NAME, |
36 | - function () { |
|
36 | + function () |
|
37 | + { |
|
37 | 38 | return new BeanstalkClient(WorkerApiCommands::class); |
38 | 39 | } |
39 | 40 | ); |
@@ -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 = [ |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | use Phalcon\Di\DiInterface; |
14 | 14 | use Phalcon\Di\ServiceProviderInterface; |
15 | 15 | |
16 | -class AmiConnectionCommand implements ServiceProviderInterface{ |
|
16 | +class AmiConnectionCommand implements ServiceProviderInterface { |
|
17 | 17 | |
18 | 18 | public const SERVICE_NAME = 'amiCommander'; |
19 | 19 | /** |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | $di->setShared( |
27 | 27 | self::SERVICE_NAME, |
28 | - function () { |
|
28 | + function() { |
|
29 | 29 | $port = PbxSettings::getValueByKey('AMIPort'); |
30 | 30 | $am = new AsteriskManager(); |
31 | 31 | $am->connect("127.0.0.1:{$port}", null, null, 'off'); |
@@ -13,7 +13,8 @@ discard block |
||
13 | 13 | use Phalcon\Di\DiInterface; |
14 | 14 | use Phalcon\Di\ServiceProviderInterface; |
15 | 15 | |
16 | -class AmiConnectionCommand implements ServiceProviderInterface{ |
|
16 | +class AmiConnectionCommand implements ServiceProviderInterface |
|
17 | +{ |
|
17 | 18 | |
18 | 19 | public const SERVICE_NAME = 'amiCommander'; |
19 | 20 | /** |
@@ -25,7 +26,8 @@ discard block |
||
25 | 26 | { |
26 | 27 | $di->setShared( |
27 | 28 | self::SERVICE_NAME, |
28 | - function () { |
|
29 | + function () |
|
30 | + { |
|
29 | 31 | $port = PbxSettings::getValueByKey('AMIPort'); |
30 | 32 | $am = new AsteriskManager(); |
31 | 33 | $am->connect("127.0.0.1:{$port}", null, null, 'off'); |
@@ -32,13 +32,13 @@ |
||
32 | 32 | $phpSessionDir = $di->getShared('config')->path('www.phpSessionDir'); |
33 | 33 | $di->setShared( |
34 | 34 | self::SERVICE_NAME, |
35 | - function () use ($phpSessionDir) { |
|
36 | - if ( ! is_array($_COOKIE) || ! array_key_exists(session_name(), $_COOKIE)) { |
|
35 | + function() use ($phpSessionDir) { |
|
36 | + if (!is_array($_COOKIE) || !array_key_exists(session_name(), $_COOKIE)) { |
|
37 | 37 | return null; |
38 | 38 | } |
39 | 39 | $session_name = preg_replace('/[^\da-z]/i', '', $_COOKIE[session_name()]); |
40 | - $session_file = $phpSessionDir . '/sess_' . $session_name; |
|
41 | - if ( ! file_exists($session_file)) { |
|
40 | + $session_file = $phpSessionDir.'/sess_'.$session_name; |
|
41 | + if (!file_exists($session_file)) { |
|
42 | 42 | return null; |
43 | 43 | } |
44 | 44 |
@@ -32,7 +32,8 @@ |
||
32 | 32 | $phpSessionDir = $di->getShared('config')->path('www.phpSessionDir'); |
33 | 33 | $di->setShared( |
34 | 34 | self::SERVICE_NAME, |
35 | - function () use ($phpSessionDir) { |
|
35 | + function () use ($phpSessionDir) |
|
36 | + { |
|
36 | 37 | if ( ! is_array($_COOKIE) || ! array_key_exists(session_name(), $_COOKIE)) { |
37 | 38 | return null; |
38 | 39 | } |