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

UriResolver::concat()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 2
dl 0
loc 7
rs 10
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