Lines
0.00%
0 / 2
Methods
0.00%
0 / 2
Classes
0.00%
0 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| createPlacementForHost | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | ||
| 7 | final readonly class AppPlacementFactory | |
| 8 | { | |
| 9 | private const int MAX_AUTO_WORKERS = 4; | |
| 10 | ||
| 11 | public function __construct(private CpuCountDetector $cpus) {} | |
| 12 | ||
| 13 | public function createPlacementForHost(): AppPlacement | |
| 14 | { | |
| 15 | return new AppPlacement(min(self::MAX_AUTO_WORKERS, $this->cpus->detectCpuCount())); | |
| 16 | } | |
| 17 | } |