Passed
Pull Request — master (#451)
by Kirill
05:22
created

UriResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A concat() 0 7 2
1
<?php
2
3
/**
4
 * This file is part of Spiral Framework package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Distribution\Resolver;
13
14
use Spiral\Distribution\UriResolverInterface;
15
16
abstract class UriResolver implements UriResolverInterface
17
{
18
    /**
19
     * @param string $file
20
     * @param string|null $prefix
21
     * @return string
22
     */
23
    protected function concat(string $file, ?string $prefix): string
24
    {
25
        if ($prefix === null) {
26
            return $file;
27
        }
28
29
        return \trim($prefix, '/') . '/' . \trim($file, '/');
30
    }
31
}
32