Passed
Push — master ( 8bc21d...dfc3d9 )
by Gabriel
04:06
created

bootHasHelloViewPathsTrait()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ByTIC\Hello\Modules\AbstractModule\Controllers\Traits;
4
5
use ByTIC\Hello\Utility\ViewHelper;
6
7
/**
8
 * Trait HasHelloViewPathsTraitHasHelloViewPathsTrait
9
 * @package ByTIC\Hello\Modules\AbstractModule\Controllers\Traits
10
 */
11
trait HasHelloViewPathsTrait
12
{
13
    protected function bootHasHelloViewPathsTrait()
14
    {
15
        $this->after(
0 ignored issues
show
Bug introduced by
It seems like after() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        $this->/** @scrutinizer ignore-call */ 
16
               after(
Loading history...
16
            function () {
17
                $this->registerHelloViewPaths();
18
            }
19
        );
20
    }
21
22
    protected function registerHelloViewPaths()
23
    {
24
        $view = $this->getView();
0 ignored issues
show
Bug introduced by
It seems like getView() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        /** @scrutinizer ignore-call */ 
25
        $view = $this->getView();
Loading history...
25
        $module = request()->getModuleName();
26
        if ($module == 'admin') {
27
            ViewHelper::registerAdminPaths($view);
28
        }
29
        ViewHelper::registerFrontendPaths($view);
30
    }
31
}