Lines
100.00%
2 / 2
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| writeLine | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 10 | final readonly class StderrFallback | |
| 11 | { | |
| 12 | public function __construct( | |
| 13 | private WorkerId $workerId, | |
| 14 | private string $fallbackStream = 'php://stderr', | |
| 15 | ) {} | |
| 16 | ||
| 17 | public function writeLine(ResourceScope $scope, string $text): void | |
| 18 | { | |
| 19 | file_put_contents($this->fallbackStream, \sprintf("[worker %d][%s] %s\n", $this->workerId->value, $scope, $text), \FILE_APPEND); | |
| 20 | } | |
| 21 | } |