Test Failed
Push — master ( e3c39f...fe570d )
by Mihail
07:20
created

Loader/Admin/index.php (2 issues)

1
<?php
2
/** @var object $loader */
3
// check if loader is initialized
4
if (!defined('root')) {
5
    die('Hack attempt');
6
}
7
8
// global environment
9
define('env_name', 'Admin');
10
define('env_no_uri', false);
11
define('env_type', 'html');
12
13
require_once(root . '/Loader/Autoload.php');
14
15
// make fast-access alias \App::$Object
0 ignored issues
show
Unused Code Comprehensibility introduced by zenn
40% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
16
// class_alias('Ffcms\Core\App', 'App');
17
class App extends Ffcms\Core\App
18
{
19
}
20
/**
21
 * Alias for translate function for fast usage. Example: __('Welcome my friend')
22
 * @param string $text
23
 * @param array $params
24
 * @return string
25
 */
26
function __($text, array $params = [])
27
{
28
    return \App::$Translate->translate($text, $params);
29
}
30
31
try {
32
    // build app factory instance
33
    $app = \App::factory([
34
        'Database' => true,
35
        'Session' => true,
36
        'Debug' => true,
37
        'User' => true,
38
        'Mailer' => true,
39
        'Captcha' => true,
40
        'Cache' => true
41
    ], $loader);
0 ignored issues
show
$loader of type object is incompatible with the type boolean expected by parameter $loader of Ffcms\Core\App::factory(). ( Ignorable by Annotation )

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

41
    ], /** @scrutinizer ignore-type */ $loader);
Loading history...
42
    // display output
43
    $app->run();
44
} catch (Exception $e) {
45
    echo (new \Ffcms\Core\Exception\NativeException($e->getMessage()))->display();
46
}
47