Completed
Pull Request — master (#5)
by
unknown
03:37
created

UrlNormalizer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
c 1
b 1
f 0
lcom 0
cbo 0
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testUrlProtocol() 0 8 2
1
<?php namespace Lbc\Helper;
2
3
class UrlNormalizer
4
{
5
    /**
6
     * Test if the url contains a protocol (add http if not)
7
     *
8
     * @param string $url
9
     *
10
     * @return string
11
     */
12
    public static function testUrlProtocol($url)
13
    {
14
        if (substr($url, 0, 4) != "http") {
15
            $url = "http:" . $url;
16
        }
17
18
        return $url;
19
    }
20
}
21