Passed
Push — master ( 39a14a...98f505 )
by Scrutinizer
01:35
created

ConfigStaticMethods::isUrlProtocolHttp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * Define static methods/properties.
5
 */
6
7
declare(strict_types=1);
8
9
namespace KEINOS\MSTDN_TOOLS;
10
11
class ConfigStaticMethods extends ConfigConstants
12
{
13
    /**
14
     * Checks if the URL protocol is "http:".
15
     *
16
     * @param  string $url
17
     * @return bool
18
     */
19
    public static function isUrlProtocolHttp(string $url): bool
20
    {
21
        $target = 'http:';
22
23
        return ($target === substr($url, 0, strlen($target)));
24
    }
25
}
26