Completed
Push — master ( 2da503...38628d )
by Shinji
14s queued 11s
created

TemplatePathResolver::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
/**
4
 * This file is part of the sj-i/php-profiler package.
5
 *
6
 * (c) sji <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace PhpProfiler\Inspector\Output\TraceFormatter\Templated;
15
16
use Noodlehaus\Config;
0 ignored issues
show
Bug introduced by
The type Noodlehaus\Config was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
18
final class TemplatePathResolver implements TemplatePathResolverInterface
19
{
20
    private Config $config;
21
22
    public function __construct(
23
        Config $config
24
    ) {
25
        $this->config = $config;
26
    }
27
28
    public function resolve(string $template_name): string
29
    {
30
        $path = $this->config->get('paths.templates');
31
        assert(is_string($path));
32
        return "{$path}/{$template_name}.php";
33
    }
34
}
35