Passed
Branch master (aecce8)
by Brice
05:03
created

WorkerWasStarted   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 27
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getWorker() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace JobQueue\Domain\Task;
4
5
use JobQueue\Domain\Worker\Worker;
6
use Symfony\Component\EventDispatcher\Event;
7
8
final class WorkerWasStarted extends Event
9
{
10
    const NAME = 'worker.started';
11
12
    /**
13
     *
14
     * @var Worker
15
     */
16
    private $worker;
17
18
    /**
19
     *
20
     * @param Task   $task
21
     * @param Worker $worker
22
     */
23 4
    public function __construct(Worker $worker)
24
    {
25 4
        $this->worker = $worker;
26 4
    }
27
28
    /**
29
     *
30
     * @return Worker
31
     */
32
    public function getWorker(): Worker
33
    {
34
        return $this->worker;
35
    }
36
}
37