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

WorkerWasStarted::getWorker()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 2
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