Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
18 | public static function create(string $eventName, AbstractThreadPoolMediator $pool, ?AbstractThread $thread = null): PoolEvent |
||
19 | { |
||
20 | $event = new PoolEvent($eventName); |
||
21 | $event->setThreadNb(count($pool->getThreads())); |
||
|
|||
22 | $event->setThreadDoneNb(count($pool->getThreads()) - count($pool->getToRunThreads())); |
||
23 | $event->setMaxRunningThreadNb($pool->getMaxRunningThreadNb()); |
||
24 | $event->setThreadLeftNb(count($pool->getToRunThreads())); |
||
25 | $event->setRunningThreadNb(count($pool->getRunningThreads())); |
||
26 | $event->setThread($thread); |
||
27 | |||
28 | return $event; |
||
29 | } |
||
31 |