Passed
Pull Request — master (#50)
by Wilmer
12:46
created

Info::frameworkVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Yiisoft\Asset;
5
6
final class Info
7
{
8
    public static function frameworkVersion(): string
9
    {
10
        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
    public static function isRelative($url)
20
    {
21
        return strncmp($url, '//', 2) && strpos($url, '://') === false;
22
    }
23
}
24