Completed
Pull Request — master (#9)
by Shinji
23:22 queued 01:43
created

PhpReaderContext::sendSettings()   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 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\Daemon\Reader\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 PhpReaderContext
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
    public function start(): Promise
33
    {
34
        return $this->context->start();
35
    }
36
37
    /**
38
     * @param array{
39
     *     0: int,
40
     *     1: TargetPhpSettings,
41
     *     2: TraceLoopSettings,
42
     *     3: GetTraceSettings
43
     * } $array
44
     * @return Promise<int>
45
     */
46
    public function sendSettings(array $array): Promise
47
    {
48
        /** @var Promise<int> */
49
        return $this->context->send($array);
50
    }
51
52
    public function isRunning(): bool
53
    {
54
        return $this->context->isRunning();
55
    }
56
57
    /**
58
    /* @return Promise<string>
59
     */
60
    public function receiveTrace(): Promise
61
    {
62
        /** @psalm-yield Promise<string> */
63
        return $this->context->receive();
64
    }
65
}
66