BuildUrl::buildURL()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 6
ccs 0
cts 4
cp 0
crap 6
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace ByTIC\Assets\Loader\Traits;
4
5
use Nip\Utility\Str;
6
7
/**
8
 * Trait BuildUrl
9
 * @package ByTIC\Assets\Loader\Traits
10
 */
11
trait BuildUrl
12
{
13
    /**
14
     * @param $source
15
     * @return string
16
     */
17
    public function buildURL($source)
18
    {
19
        if (Str::startsWith($source, ['http', 'https'])) {
20
            return $source;
21
        } else {
22
            return asset('/stylesheets/' . $source . '.css');
23
        }
24
    }
25
}
26