Completed
Push — master ( 17779d...c32e20 )
by Alejandro
13s
created

ShortUrlBuilderTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildShortUrl() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Shlinkio\Shlink\Core\Util;
5
6
use Zend\Diactoros\Uri;
7
8
trait ShortUrlBuilderTrait
9
{
10 6
    private function buildShortUrl(array $domainConfig, string $shortCode): string
11
    {
12 6
        return (string) (new Uri())->withPath($shortCode)
13 6
                                   ->withScheme($domainConfig['schema'] ?? 'http')
14 6
                                   ->withHost($domainConfig['hostname'] ?? '');
15
    }
16
}
17