Lines 40.00% 2 / 5
Methods 0.00% 0 / 2
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 http 66.66% 2 / 3 0.00% 0 / 1 2.15
 initialize 0.00% 0 / 2 0.00% 0 / 1 2
36class Application extends \BO\Slim\Application
37{
38    /**
39     * Name of the application
40     *
41     */
42    const string IDENTIFIER = 'zms';
43
44    const string MODULE_NAME = 'zmsstatistic';
45
46    public static ?CacheInterface $cache = null;
47
48    const bool DEBUG = false;
49
50    const mixed TWIG_CACHE = ZMS_STATISTIC_TWIG_CACHE;
51
52    const int SESSION_DURATION = ZMS_STATISTIC_SESSION_DURATION;
53
54    /** @var string */
55    public static ?string $includeUrl = '/terminvereinbarung/statistic';
56    /**
57     * language preferences
58     */
59    public static string $locale = 'de';
60    /** @var array */
61    public static array $supportedLanguages = array(
62        // Default language
63        'de' => array(
64            'name'    => 'Deutsch',
65            'locale'  => 'de_DE',
66            'default' => true,
67        ),
68        // Other languages
69        'en' => array(
70            'name'    => 'English',
71            'locale'  => 'en_GB',
72        )
73    );
74
75    /**
76     * image preferences
77     */
78
79    /** @var bool */
80    public static bool $isImageAllowed = false;
81
82    /*
83     * -----------------------------------------------------------------------
84     * ZMS API access
85     */
86    public static ?Http $http = null;
87
88    public static function http(): Http
89    {
90        if (self::$http instanceof Http) {
91            return self::$http;
92        }
93        throw new \RuntimeException('HTTP client is not initialized');
94    }
95
96    public static array $http_curl_config = array();
97
98    const int JSON_COMPRESS_LEVEL = 1;
99
100    /**
101    * config preferences
102    */
103    const string CONFIG_SECURE_TOKEN = ZMS_CONFIG_SECURE_TOKEN;
104
105    /**
106     * HTTP url for api
107     */
108    const string HTTP_BASE_URL = 'http://user:pass@host.tdl';
109
110    public static function initialize(): void
111    {
112        ModuleLoggerInitializer::configure('ZMS_STATISTIC');
113        self::$cache = ModuleLoggerInitializer::tryInitializeCache();
114    }
115}