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\Controller; |
15
|
|
|
|
16
|
|
|
use Amp\Promise; |
|
|
|
|
17
|
|
|
use PhpProfiler\Inspector\Daemon\Reader\Protocol\Message\DetachWorkerMessage; |
18
|
|
|
use PhpProfiler\Inspector\Daemon\Reader\Protocol\Message\TraceMessage; |
19
|
|
|
use PhpProfiler\Inspector\Daemon\Reader\Protocol\Message\AttachMessage; |
20
|
|
|
use PhpProfiler\Inspector\Daemon\Reader\Protocol\Message\SetSettingsMessage; |
21
|
|
|
use PhpProfiler\Inspector\Daemon\Reader\Protocol\PhpReaderControllerProtocolInterface; |
22
|
|
|
use PhpProfiler\Inspector\Settings\GetTraceSettings\GetTraceSettings; |
23
|
|
|
use PhpProfiler\Inspector\Settings\TargetPhpSettings\TargetPhpSettings; |
24
|
|
|
use PhpProfiler\Inspector\Settings\TraceLoopSettings\TraceLoopSettings; |
25
|
|
|
use PhpProfiler\Lib\Amphp\ContextInterface; |
26
|
|
|
|
27
|
|
|
final class PhpReaderController implements PhpReaderControllerInterface |
28
|
|
|
{ |
29
|
|
|
/** @var ContextInterface<PhpReaderControllerProtocolInterface> */ |
30
|
|
|
private ContextInterface $context; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* PhpReaderContext constructor. |
34
|
|
|
* @param ContextInterface<PhpReaderControllerProtocolInterface> $context |
35
|
|
|
*/ |
36
|
|
|
public function __construct(ContextInterface $context) |
37
|
|
|
{ |
38
|
|
|
$this->context = $context; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function start(): Promise |
42
|
|
|
{ |
43
|
|
|
return $this->context->start(); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function isRunning(): bool |
47
|
|
|
{ |
48
|
|
|
return $this->context->isRunning(); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @param TargetPhpSettings $target_php_settings |
53
|
|
|
* @param TraceLoopSettings $loop_settings |
54
|
|
|
* @param GetTraceSettings $get_trace_settings |
55
|
|
|
* @return Promise<int> |
56
|
|
|
*/ |
57
|
|
|
public function sendSettings( |
58
|
|
|
TargetPhpSettings $target_php_settings, |
59
|
|
|
TraceLoopSettings $loop_settings, |
60
|
|
|
GetTraceSettings $get_trace_settings |
61
|
|
|
): Promise { |
62
|
|
|
/** @var Promise<int> */ |
63
|
|
|
return $this->context->getProtocol()->sendSettings( |
64
|
|
|
new SetSettingsMessage( |
65
|
|
|
$target_php_settings, |
66
|
|
|
$loop_settings, |
67
|
|
|
$get_trace_settings |
68
|
|
|
) |
69
|
|
|
); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @param int $pid |
74
|
|
|
* @return Promise<int> |
75
|
|
|
*/ |
76
|
|
|
public function sendAttach(int $pid): Promise |
77
|
|
|
{ |
78
|
|
|
/** @var Promise<int> */ |
79
|
|
|
return $this->context->getProtocol()->sendAttach( |
80
|
|
|
new AttachMessage($pid) |
81
|
|
|
); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @return Promise<TraceMessage|DetachWorkerMessage> |
86
|
|
|
*/ |
87
|
|
|
public function receiveTraceOrDetachWorker(): Promise |
88
|
|
|
{ |
89
|
|
|
/** @var Promise<TraceMessage|DetachWorkerMessage> */ |
90
|
|
|
return $this->context->getProtocol()->receiveTraceOrDetachWorker(); |
91
|
|
|
} |
92
|
|
|
} |
93
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths