UrlBuilderFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
ccs 0
cts 8
cp 0
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
    public static function create($baseUrl, $signKey = null)
16
    {
17
        $httpSignature = null;
18
19
        if (!is_null($signKey)) {
20
            $httpSignature = SignatureFactory::create($signKey);
21
        }
22
23
        return new UrlBuilder($baseUrl, $httpSignature);
24
    }
25
}
26