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

Info::frameworkVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
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