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

ShortUrlBuilderTrait::buildShortUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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