@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | $di->setShared( |
44 | 44 | self::SERVICE_NAME, |
45 | - function (){ |
|
45 | + function() { |
|
46 | 46 | return array_merge( |
47 | 47 | self::getCoreConfModules(), |
48 | 48 | self::getExtensionsConfModules() |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | $configsDir = appPath('src/Core/Asterisk/Configs'); |
62 | 62 | $modulesFiles = glob("{$configsDir}/*.php", GLOB_NOSORT); |
63 | 63 | foreach ($modulesFiles as $file) { |
64 | - $className = pathinfo($file)['filename']; |
|
64 | + $className = pathinfo($file)['filename']; |
|
65 | 65 | $full_class_name = "\\MikoPBX\\Core\\Asterisk\\Configs\\{$className}"; |
66 | 66 | if (class_exists($full_class_name)) { |
67 | 67 | $object = new $full_class_name(); |
68 | - if ($object instanceof ConfigClass){ |
|
68 | + if ($object instanceof ConfigClass) { |
|
69 | 69 | $arrObjects[] = $object; |
70 | 70 | } |
71 | 71 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $full_class_name = "\\Modules\\{$value['uniqid']}\\Lib\\{$class_name}Conf"; |
87 | 87 | if (class_exists($full_class_name)) { |
88 | 88 | $object = new $full_class_name(); |
89 | - if ($object instanceof ConfigClass){ |
|
89 | + if ($object instanceof ConfigClass) { |
|
90 | 90 | $arrObjects[] = $object; |
91 | 91 | } |
92 | 92 | } |
@@ -42,7 +42,8 @@ |
||
42 | 42 | { |
43 | 43 | $di->setShared( |
44 | 44 | self::SERVICE_NAME, |
45 | - function (){ |
|
45 | + function () |
|
46 | + { |
|
46 | 47 | return array_merge( |
47 | 48 | self::getCoreConfModules(), |
48 | 49 | self::getExtensionsConfModules() |
@@ -83,7 +83,7 @@ |
||
83 | 83 | $modules = PbxExtensionModules::find('disabled="0"')->toArray(); |
84 | 84 | foreach ($modules as $value) { |
85 | 85 | $class_name = str_replace('Module', '', $value['uniqid']); |
86 | - $full_class_name = "\\Modules\\{$value['uniqid']}\\Lib\\{$class_name}Conf"; |
|
86 | + $full_class_name = "\\Modules\\{$value['uniqid']}\\Lib\\{$class_name}conf"; |
|
87 | 87 | if (class_exists($full_class_name)) { |
88 | 88 | $object = new $full_class_name(); |
89 | 89 | if ($object instanceof ConfigClass){ |
@@ -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 | ); |