@@ -41,7 +41,7 @@ |
||
41 | 41 | { |
42 | 42 | $di->setShared( |
43 | 43 | self::SERVICE_NAME, |
44 | - function () use ($di) { |
|
44 | + function() use ($di) { |
|
45 | 45 | $interpolator = new InterpolatorFactory(); |
46 | 46 | $factory = new TranslateFactory($interpolator); |
47 | 47 |
@@ -41,7 +41,8 @@ |
||
41 | 41 | { |
42 | 42 | $di->setShared( |
43 | 43 | self::SERVICE_NAME, |
44 | - function () use ($di) { |
|
44 | + function () use ($di) |
|
45 | + { |
|
45 | 46 | $interpolator = new InterpolatorFactory(); |
46 | 47 | $factory = new TranslateFactory($interpolator); |
47 | 48 |
@@ -35,15 +35,15 @@ |
||
35 | 35 | { |
36 | 36 | $configPath = '/etc/inc/mikopbx-settings.json'; |
37 | 37 | |
38 | - if ( ! file_exists($configPath) |
|
39 | - || ! is_readable($configPath) |
|
38 | + if (!file_exists($configPath) |
|
39 | + || !is_readable($configPath) |
|
40 | 40 | ) { |
41 | - throw new Exception('Config file does not exist: ' . $configPath); |
|
41 | + throw new Exception('Config file does not exist: '.$configPath); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $di->setShared( |
45 | 45 | self::SERVICE_NAME, |
46 | - function () use ($configPath) { |
|
46 | + function() use ($configPath) { |
|
47 | 47 | return new Json($configPath); |
48 | 48 | } |
49 | 49 | ); |
@@ -43,7 +43,8 @@ |
||
43 | 43 | |
44 | 44 | $di->setShared( |
45 | 45 | self::SERVICE_NAME, |
46 | - function () use ($configPath) { |
|
46 | + function () use ($configPath) |
|
47 | + { |
|
47 | 48 | return new Json($configPath); |
48 | 49 | } |
49 | 50 | ); |
@@ -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 | $options = [ |
53 | 53 | 'defaultSerializer' => 'php', |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'storageDir' => $tempDir |
56 | 56 | ]; |
57 | 57 | |
58 | - $adapter = new Stream ($serializerFactory, $options); |
|
58 | + $adapter = new Stream($serializerFactory, $options); |
|
59 | 59 | return new Cache($adapter); |
60 | 60 | } |
61 | 61 | ); |
@@ -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 | $options = [ |
53 | 54 | 'defaultSerializer' => 'php', |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | $di->setShared( |
42 | 42 | self::SERVICE_NAME, |
43 | - function () { |
|
43 | + function() { |
|
44 | 44 | $metaData = new Memory( |
45 | 45 | [ |
46 | 46 | 'lifetime' => 600, |
@@ -40,7 +40,8 @@ |
||
40 | 40 | { |
41 | 41 | $di->setShared( |
42 | 42 | self::SERVICE_NAME, |
43 | - function () { |
|
43 | + function () |
|
44 | + { |
|
44 | 45 | $metaData = new Memory( |
45 | 46 | [ |
46 | 47 | 'lifetime' => 600, |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | $coreConfig = $di->getShared('config')->path('core'); |
34 | 34 | $di->setShared( |
35 | 35 | self::SERVICE_NAME, |
36 | - function () use ($di, $coreConfig) { |
|
36 | + function() use ($di, $coreConfig) { |
|
37 | 37 | $cacheKey = false; |
38 | - if (php_sapi_name() === 'cli'){ |
|
39 | - if (cli_get_process_title()=== WorkerApiCommands::class){ |
|
38 | + if (php_sapi_name() === 'cli') { |
|
39 | + if (cli_get_process_title() === WorkerApiCommands::class) { |
|
40 | 40 | $language = PbxSettings::getValueByKey('WebAdminLanguage'); |
41 | 41 | } elseif (!empty($_ENV['SSH_CLIENT'])) { |
42 | 42 | $language = 'en'; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $language = $di->get('language'); |
48 | 48 | $session = $di->get('session'); |
49 | 49 | if ($session !== null && $session->has('versionHash')) { |
50 | - $cacheKey = 'LocalisationArray' . $session->get('versionHash') . $language . '.php'; |
|
50 | + $cacheKey = 'LocalisationArray'.$session->get('versionHash').$language.'.php'; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | // Возьмем английский перевод расширений |
84 | 84 | $extensionsTranslates = [[]]; |
85 | - $results = glob($coreConfig->modulesDir . '/*/{Messages}/en.php', GLOB_BRACE); |
|
85 | + $results = glob($coreConfig->modulesDir.'/*/{Messages}/en.php', GLOB_BRACE); |
|
86 | 86 | foreach ($results as $path) { |
87 | 87 | $langArr = require $path; |
88 | 88 | if (is_array($langArr)) { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if ($language !== 'en') { |
96 | 96 | $additionalTranslates = [[]]; |
97 | 97 | $results = glob( |
98 | - $coreConfig->modulesDir . "/*/{Messages}/{$language}.php", |
|
98 | + $coreConfig->modulesDir."/*/{Messages}/{$language}.php", |
|
99 | 99 | GLOB_BRACE |
100 | 100 | ); |
101 | 101 | foreach ($results as $path) { |
@@ -33,7 +33,8 @@ |
||
33 | 33 | $coreConfig = $di->getShared('config')->path('core'); |
34 | 34 | $di->setShared( |
35 | 35 | self::SERVICE_NAME, |
36 | - function () use ($di, $coreConfig) { |
|
36 | + function () use ($di, $coreConfig) |
|
37 | + { |
|
37 | 38 | $cacheKey = false; |
38 | 39 | if (php_sapi_name() === 'cli'){ |
39 | 40 | if (cli_get_process_title()=== WorkerApiCommands::class){ |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | $di->set( |
41 | 41 | self::SERVICE_NAME, |
42 | - function () { |
|
42 | + function() { |
|
43 | 43 | $router = new Router(); |
44 | 44 | |
45 | 45 | $router->addGet( |
@@ -39,7 +39,8 @@ |
||
39 | 39 | { |
40 | 40 | $di->set( |
41 | 41 | self::SERVICE_NAME, |
42 | - function () { |
|
42 | + function () |
|
43 | + { |
|
43 | 44 | $router = new Router(); |
44 | 45 | |
45 | 46 | $router->addGet( |
@@ -32,7 +32,7 @@ |
||
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', |
@@ -32,7 +32,8 @@ |
||
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', |
@@ -32,7 +32,7 @@ |
||
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 | ); |
@@ -32,7 +32,8 @@ |
||
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 | ); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | $di->setShared( |
34 | 34 | self::SERVICE_NAME, |
35 | - function () { |
|
35 | + function() { |
|
36 | 36 | return new Elements(); |
37 | 37 | } |
38 | 38 | ); |
@@ -32,7 +32,8 @@ |
||
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 | ); |