Passed
Pull Request — master (#9)
by Shinji
01:56
created

ContextCreator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 18
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 6 1
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\Lib\Amphp;
15
16
use Amp\Parallel\Context;
0 ignored issues
show
Bug introduced by
The type Amp\Parallel\Context 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 ContextCreator implements ContextCreatorInterface
19
{
20
    private string $di_config_file;
21
22
    public function __construct(string $di_config_file)
23
    {
24
        $this->di_config_file = $di_config_file;
25
    }
26
27
    /**
28
     * @param class-string<ContextEntryPointInterface> $entry_point_name
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string<ContextEntryPointInterface> at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string<ContextEntryPointInterface>.
Loading history...
29
     */
30
    public function create(string $entry_point_name): Context\Context
0 ignored issues
show
Bug introduced by
The type Amp\Parallel\Context\Context 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...
31
    {
32
        return Context\create([
0 ignored issues
show
Bug introduced by
The function create was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

32
        return /** @scrutinizer ignore-call */ Context\create([
Loading history...
33
            ContextEntryPointInterface::ENTRY_SCRIPT,
34
            $entry_point_name,
35
            $this->di_config_file,
36
        ]);
37
    }
38
}
39