UrlBuilderFactory   A
last analyzed

↳ Parent: Project

Coupling/Cohesion

Components 0
Dependencies 2

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 10 2
1
<?php
2
3
namespace League\Glide\Urls;
4
5
use League\Glide\Signatures\SignatureFactory;
6
7
class UrlBuilderFactory
8
{
9
    /**
10
     * Create UrlBuilder instance.
11
     * @param  string      $baseUrl URL prefixed to generated URL.
12
     * @param  string|null $signKey Secret key used to secure URLs.
13
     * @return UrlBuilder  The UrlBuilder instance.
14
     */
15 9
    public static function create($baseUrl, $signKey = null)
16
    {
17 9
        $httpSignature = null;
18
19 9
        if (!is_null($signKey)) {
20 6
            $httpSignature = SignatureFactory::create($signKey);
21 6
        }
22
23 9
        return new UrlBuilder($baseUrl, $httpSignature);
24
    }
25
}
26