Completed
Pull Request — master (#3)
by ARCANEDEV
03:48 queued 01:31
created

DashboardController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0
ccs 0
cts 12
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A index() 0 9 1
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