AbstractSubscriablePanel::setLaravel()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
ccs 5
cts 5
cp 1
crap 2
1
<?php
2
3
namespace Recca0120\LaravelTracy\Panels;
4
5
use Illuminate\Contracts\Foundation\Application;
6
7
abstract class AbstractSubscriablePanel extends AbstractPanel
8
{
9
    /**
10
     * setLaravel.
11
     *
12
     * @param \Illuminate\Contracts\Foundation\Application $laravel
13
     * @return $this
14
     */
15 7
    public function setLaravel(Application $laravel = null)
16
    {
17 7
        parent::setLaravel($laravel);
18 7
        if ($this->hasLaravel() === true) {
19 7
            $this->subscribe();
20
        }
21
22 7
        return $this;
23
    }
24
25
    /**
26
     * subscribe.
27
     */
28
    abstract protected function subscribe();
29
}
30