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

Apps/Controller/Front/Main.php (1 issue)

Checks if properties have been declared.

Best Practice Bug Major
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';
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