Completed
Push — master ( 21a839...20b252 )
by ARCANEDEV
7s
created

DashboardController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 5
cp 0
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php namespace Arcanesoft\Blog\Http\Controllers\Admin;
2
3
/**
4
 * Class     DashboardController
5
 *
6
 * @package  Arcanesoft\Blog\Http\Controllers\Foundation
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class DashboardController extends Controller
10
{
11
    /* ------------------------------------------------------------------------------------------------
12
     |  Constructor
13
     | ------------------------------------------------------------------------------------------------
14
     */
15
    /**
16
     * Instantiate the controller.
17
     */
18
    public function __construct()
19
    {
20
        parent::__construct();
21
22
        $this->setCurrentPage('blog-dashboard');
23
    }
24
25
    /* ------------------------------------------------------------------------------------------------
26
     |  Main Functions
27
     | ------------------------------------------------------------------------------------------------
28
     */
29
    public function index()
30
    {
31
        $this->authorize('blog.dashboard.stats');
0 ignored issues
show
Documentation Bug introduced by
The method authorize does not exist on object<Arcanesoft\Blog\H...in\DashboardController>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
32
33
        $this->setTitle($title = 'Blog - Dashboard');
34
        $this->addBreadcrumb('Statistics');
35
36
        return $this->view('admin.dashboard');
37
    }
38
}
39