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