Issues (1519)

tests/init.php (1 issue)

Labels
Severity
1
<?php
2
3
setlocale(LC_ALL, 'ru_RU.UTF-8', 'rus_RUS.UTF-8', 'Russian_Russia.65001');
4
setlocale(LC_NUMERIC, 'C');
5
//default timezone
6
date_default_timezone_set('Asia/Krasnoyarsk');
7
// time start
8
define('INJI_TIME_START', microtime(true));
9
// system files dir
10
define('INJI_SYSTEM_DIR', __DIR__ . '/../system');
11
// apps files dir
12
define('INJI_PROGRAM_DIR', __DIR__ . '/../program');
13
session_start();
14
15
include_once INJI_SYSTEM_DIR . '/Inji/Inji.php';
16
include_once INJI_SYSTEM_DIR . '/Inji/Router.php';
17
include_once INJI_SYSTEM_DIR . '/Inji/Router/Folder.php';
18
include_once INJI_SYSTEM_DIR . '/Inji/Router/Path.php';
19
20
spl_autoload_register('Inji\Router::findClass');
21
22
Inji\Router::addPath(INJI_SYSTEM_DIR . '/Inji/', 'Inji\\');
23
Inji\Router::addPath(INJI_SYSTEM_DIR . '/modules/', 'Inji\\', 10);
24
Inji\Router::addPath(INJI_SYSTEM_DIR . '/modules/', 'Inji\\', 20, 1, ['models', 'objects', 'controllers']);
25
26
define('INJI_DOMAIN_NAME', 'injitest.localhost');
27
28
//load core
29
Inji::$inst = new Inji();
30
Inji::$config = Inji\Config::system();
31
Inji::$inst->listen('Config-change-system', 'systemConfig', function ($event) {
0 ignored issues
show
function(...) { /* ... */ } of type callable is incompatible with the type string|array|closure expected by parameter $callback of Inji::listen(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
Inji::$inst->listen('Config-change-system', 'systemConfig', /** @scrutinizer ignore-type */ function ($event) {
Loading history...
32
    Inji::$config = $event['eventObject'];
33
    return $event['eventObject'];
34
});
35
36
//Make default app params
37
$appConfig = [
38
    'name' => INJI_DOMAIN_NAME,
39
    'dir' => INJI_DOMAIN_NAME,
40
    'installed' => true,
41
    'default' => true,
42
    'route' => INJI_DOMAIN_NAME,
43
    'namespace' => 'InjiTest'
44
];
45
Inji\App::$cur = new Inji\App($appConfig);
46
47
Inji\App::$cur->type = 'app';
48
Inji\App::$cur->path = INJI_PROGRAM_DIR . '/apps/' . Inji\App::$cur->dir;
49
Inji\App::$cur->params = [];
50
Inji\App::$cur->config = Inji\Config::app(Inji\App::$cur);
51
Inji\App::$primary = Inji\App::$cur;