DemoController::containerInit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 13
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\Demo;
4
5
use App\Ship\ShipController;
6
use Rudra\Container\Facades\Rudra;
7
use Rudra\View\ViewFacade as View;
8
use App\Containers\Demo\Tools\HelperTrait;
9
use Rudra\Controller\ContainerControllerInterface;
10
11
class DemoController extends ShipController implements ContainerControllerInterface
12
{
13
    use HelperTrait;
14
    
15
    public function containerInit(): void
16
    {
17
        $config = require_once "config.php";
18
        $cache_time = config('cache.time');
19
        $this->cache_time = $cache_time;
0 ignored issues
show
Bug Best Practice introduced by
The property cache_time does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
20
        
21
        Rudra::binding()->set($config['contracts']);
22
        Rudra::waiting()->set($config['services']);
23
24
        View::setup(dirname(__DIR__) . "/Demo/UI/tmpl", "Demo_");
25
26
        data([
27
            "title" => "Rudra Framework:: Demo Container",
28
        ]);
29
    }
30
}
31