Completed
Pull Request — master (#50)
by Wilmer
01:44
created

Info   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 3
c 1
b 0
f 0
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A frameworkVersion() 0 3 1
A isRelative() 0 3 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Yiisoft\Asset;
5
6
final class Info
7
{
8 1
    public static function frameworkVersion(): string
9
    {
10 1
        return '3.0.0';
11
    }
12
13
    /**
14
     * Returns a value indicating whether a URL is relative.
15
     * A relative URL does not have host info part.
16
     * @param string $url the URL to be checked
17
     * @return bool whether the URL is relative
18
     */
19 13
    public static function isRelative($url)
20
    {
21 13
        return strncmp($url, '//', 2) && strpos($url, '://') === false;
22
    }
23
}
24