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', 'Install'); |
||||
10 | define('env_type', 'html'); |
||||
11 | |||||
12 | require_once(root . '/Loader/Autoload.php'); |
||||
13 | |||||
14 | // make fast-access alias \App::$Object |
||||
0 ignored issues
–
show
|
|||||
15 | // class_alias('Ffcms\Core\App', 'App'); |
||||
16 | class App extends Ffcms\Core\App |
||||
17 | { |
||||
18 | } |
||||
19 | /** |
||||
20 | * Alias for translate function for fast usage. Example: __('Welcome my friend') |
||||
21 | * @param string $text |
||||
22 | * @param array $params |
||||
23 | * @return string |
||||
24 | */ |
||||
25 | function __($text, array $params = []) |
||||
26 | { |
||||
27 | return \App::$Translate->translate($text, $params); |
||||
28 | } |
||||
29 | |||||
30 | try { |
||||
31 | // prepare to run |
||||
32 | $app = \App::factory([ |
||||
33 | 'Database' => true, |
||||
34 | 'Session' => true |
||||
35 | ], $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
Loading history...
|
|||||
36 | // display output |
||||
37 | $app->run(); |
||||
38 | } catch (Exception $e) { |
||||
39 | echo (new \Ffcms\Core\Exception\NativeException($e->getMessage()))->display(); |
||||
40 | } |
||||
41 |
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.