Factory::normalizeName()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
rs 9.9332
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Schnoop\RemoteTemplate\View;
4
5
use Illuminate\Support\Str;
6
7
/**
8
 * Class Factory.
9
 */
10
class Factory extends \Illuminate\View\Factory
11
{
12
    /**
13
     * Normalize a view name.
14
     *
15
     * @param string $name
16
     *
17
     * @return string
18
     */
19
    protected function normalizeName($name): string
20
    {
21
        $delimiter = $this->container->get('config')->get('remote-view.remote-delimiter');
22
23
        if (Str::startsWith($name, $delimiter) === false) {
24
            return parent::normalizeName($name);
25
        }
26
27
        return $name;
28
    }
29
}
30