Lines
0.00%
0 / 8
Methods
0.00%
0 / 7
Classes
0.00%
0 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| getPid | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| transport | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| stdout | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| stderr | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| join | 0.00% | 0 / 2 | 0.00% | 0 / 1 | 6 | ||
| close | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| 13 | final class ProcessContextWorker implements WorkerProcess | |
| 14 | { | |
| 15 | private readonly Transport $transport; | |
| 16 | ||
| 17 | /** @param ProcessContext<string, string, string> $context */ | |
| 18 | public function __construct(private readonly ProcessContext $context, IpcCodec $ipcCodec) | |
| 19 | { | |
| 20 | $this->transport = new ChannelTransport($context, $ipcCodec); | |
| 21 | } | |
| 22 | ||
| 23 | public function getPid(): int | |
| 24 | { | |
| 25 | return $this->context->getPid(); | |
| 26 | } | |
| 27 | ||
| 28 | public function transport(): Transport | |
| 29 | { | |
| 30 | return $this->transport; | |
| 31 | } | |
| 32 | ||
| 33 | public function stdout(): ReadableStream | |
| 34 | { | |
| 35 | return $this->context->getStdout(); | |
| 36 | } | |
| 37 | ||
| 38 | public function stderr(): ReadableStream | |
| 39 | { | |
| 40 | return $this->context->getStderr(); | |
| 41 | } | |
| 42 | ||
| 43 | public function join(): string | |
| 44 | { | |
| 45 | $summary = $this->context->join(); | |
| 46 | ||
| 47 | return \is_string($summary) ? $summary : ''; | |
| 48 | } | |
| 49 | ||
| 50 | public function close(): void | |
| 51 | { | |
| 52 | $this->context->close(); | |
| 53 | } | |
| 54 | } |