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

Main   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 28
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A actionRead() 0 3 1
A before() 0 2 1
A actionIndex() 0 5 1
1
<?php
2
3
namespace Apps\Controller\Front;
4
5
use Extend\Core\Arch\Controller;
6
7
/**
8
 * Class Main. Default website entry point
9
 * @package Apps\Controller\Front
10
 */
11
class Main extends Controller
12
{
13
    /**
14
     * Before action method call injection
15
     */
16
    public function before()
17
    {
18
        //self::$layout = 'other.php';
0 ignored issues
show
Unused Code Comprehensibility introduced by Mihail
63% 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...
19
    }
20
21
    /**
22
     * Default index action
23
     * @return null|string
24
     */
25
    public function actionIndex()
26
    {
27
        $this->wtf = 'Test global variable';
0 ignored issues
show
Bug Best Practice introduced by zenn
The property wtf does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
28
29
        return $this->view->render('main/index', ['t1' => 'test1', 't2' => 'test2']);
30
    }
31
32
    /**
33
     * Pass id inside example
34
     * @param int $id
35
     */
36
    public function actionRead($id)
37
    {
38
        echo "Action read called" . $id;
39
    }
40
}
41