Passed
Pull Request — master (#9)
by Shinji
02:00
created

PhpSearcherContext::receivePidList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
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\Daemon\Searcher\Context;
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
use Amp\Promise;
0 ignored issues
show
Bug introduced by
The type Amp\Promise 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...
18
use PhpProfiler\Inspector\Settings\DaemonSettings;
19
use PhpProfiler\Inspector\Settings\GetTraceSettings;
20
use PhpProfiler\Inspector\Settings\TargetPhpSettings;
21
use PhpProfiler\Inspector\Settings\TraceLoopSettings;
22
23
final class PhpSearcherContext
24
{
25
    private Context\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...
26
27
    public function __construct(Context\Context $context)
28
    {
29
        $this->context = $context;
30
    }
31
32
    /**
33
     * @return Promise<null>
34
     */
35
    public function start(): Promise
36
    {
37
        return $this->context->start();
38
    }
39
40
    /**
41
     * @param string $regex
42
     * @return Promise<int>
43
     */
44
    public function sendTargetRegex(string $regex): Promise
45
    {
46
        /** @var Promise<int> */
47
        return $this->context->send($regex);
48
    }
49
50
    /**
51
     * @return Promise<int[]>
52
     */
53
    public function receivePidList(): Promise
54
    {
55
        /** @var Promise<int[]> */
56
        return $this->context->receive();
57
    }
58
}
59