ThemeViewFinder::setBasePath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Yajra\CMS\Themes;
4
5
use Illuminate\View\FileViewFinder;
6
7
class ThemeViewFinder extends FileViewFinder
8
{
9
    /**
10
     * Base path to look for blade files.
11
     *
12
     * @var string
13
     */
14
    protected $basePath;
15
16
    /**
17
     * Set file view finder base path.
18
     *
19
     * @param $path
20
     */
21
    public function setBasePath($path)
22
    {
23
        $this->basePath = $path;
24
25
        array_unshift($this->paths, $this->basePath);
26
    }
27
28
    /**
29
     * Remove base path.
30
     */
31
    public function removeBasePath()
32
    {
33
        unset($this->paths[0]);
34
    }
35
}
36
37
38
39
40