Passed
Push — master ( d8b5d7...ef6cbf )
by Korotkov
01:59 queued 11s
created

ShipController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A eventRegistration() 0 3 1
A generalPreCall() 0 6 2
1
<?php
2
3
namespace App\Ship;
4
5
use App\Containers\Web\Listeners\MessageListener;
6
use App\Ship\Utils\HelperTrait;
7
use Rudra\Controller\Controller;
8
use Rudra\Container\Facades\Rudra;
9
use Rudra\EventDispatcher\EventDispatcherFacade as Dispatcher;
10
11
class ShipController extends Controller
12
{
13
    use HelperTrait;
14
15
    public function generalPreCall()
16
    {
17
        if (Rudra::config()->get("environment") === "development") {
18
            Rudra::get("debugbar")['time']->stopMeasure('routing');
19
            data([
20
                "debugbar" => Rudra::get("debugbar")->getJavascriptRenderer(),
21
            ]);
22
        }
23
    }
24
25
    public function eventRegistration()
26
    {
27
        Dispatcher::addListener('message', [MessageListener::class, 'info']);
28
    }
29
}
30