@@ -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::getEnabledModulesArray(); |
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 | ); |
@@ -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,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){ |
@@ -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 | } else { |
42 | 42 | $language = PbxSettings::getValueByKey('SSHLanguage'); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $language = $di->get('language'); |
46 | 46 | $session = $di->get('session'); |
47 | 47 | if ($session !== null && $session->has('versionHash')) { |
48 | - $cacheKey = 'LocalisationArray' . $session->get('versionHash') . $language . '.php'; |
|
48 | + $cacheKey = 'LocalisationArray'.$session->get('versionHash').$language.'.php'; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | // Возьмем английский перевод расширений |
81 | 81 | $extensionsTranslates = [[]]; |
82 | - $results = glob($coreConfig->modulesDir . '/*/{Messages}/en.php', GLOB_BRACE); |
|
82 | + $results = glob($coreConfig->modulesDir.'/*/{Messages}/en.php', GLOB_BRACE); |
|
83 | 83 | foreach ($results as $path) { |
84 | 84 | $langArr = require $path; |
85 | 85 | if (is_array($langArr)) { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if ($language !== 'en') { |
93 | 93 | $additionalTranslates = [[]]; |
94 | 94 | $results = glob( |
95 | - $coreConfig->modulesDir . "/*/{Messages}/{$language}.php", |
|
95 | + $coreConfig->modulesDir."/*/{Messages}/{$language}.php", |
|
96 | 96 | GLOB_BRACE |
97 | 97 | ); |
98 | 98 | foreach ($results as $path) { |
@@ -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 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 | ); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $di->setShared( |
35 | 35 | self::SERVICE_NAME, |
36 | - function () { |
|
36 | + function() { |
|
37 | 37 | $viewsDir = appPath('src/AdminCabinet/Views'); |
38 | 38 | $view = new View(); |
39 | 39 | $view->setViewsDir($viewsDir); |
@@ -33,7 +33,8 @@ |
||
33 | 33 | { |
34 | 34 | $di->setShared( |
35 | 35 | self::SERVICE_NAME, |
36 | - function () { |
|
36 | + function () |
|
37 | + { |
|
37 | 38 | $viewsDir = appPath('src/AdminCabinet/Views'); |
38 | 39 | $view = new View(); |
39 | 40 | $view->setViewsDir($viewsDir); |