Passed
Branch master (3ea22d)
by Fariz
03:08
created

Admin   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 17
rs 10
c 1
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A displayAdminPage() 0 3 1
A __construct() 0 4 2
A redirectToAdminHome() 0 3 1
1
<?php
2
/**
3
 * StupidlySimple - A PHP Framework For Lazy Developers.
4
 *
5
 * @author		Fariz Luqman <[email protected]>
6
 * @copyright	2017 Fariz Luqman
7
 * @license		MIT
8
 *
9
 * @link		https://stupidlysimple.github.io/
10
 */
11
12
namespace Controller;
13
14
use Response;
15
use Sentry;
0 ignored issues
show
Bug introduced by
The type Sentry was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
use Viewer;
0 ignored issues
show
Bug introduced by
The type Viewer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
18
class Admin
19
{
20
    public function __construct()
21
    {
22
        if (Sentry::check() !== true) {
23
            Response::redirect('login');
24
        }
25
    }
26
27
    public static function redirectToAdminHome()
28
    {
29
        Response::redirect('admin');
30
    }
31
32
    public function displayAdminPage()
33
    {
34
        Viewer::file('resources/views/admin/home');
35
    }
36
}
37