PreWorkerEvent::getObject()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of Transfer.
5
 *
6
 * For the full copyright and license information, please view the LICENSE file located
7
 * in the root directory.
8
 */
9
10
namespace Transfer\Event;
11
12
use Symfony\Component\EventDispatcher\Event;
13
use Transfer\Worker\WorkerInterface;
14
15
/**
16
 * Event triggered before an object is passed through a worker.
17
 */
18
class PreWorkerEvent extends Event
19
{
20
    /**
21
     * @var WorkerInterface Worker
22
     */
23
    protected $worker;
24
25
    /**
26
     * @var mixed Object sent to worker
27
     */
28
    protected $object;
29
30
    /**
31
     * @param WorkerInterface $worker Worker
32
     * @param mixed           $object Object sent to worker
33
     */
34 7
    public function __construct(WorkerInterface $worker, $object)
35
    {
36 7
        $this->worker = $worker;
37 7
        $this->object = $object;
38 7
    }
39
40
    /**
41
     * Returns worker.
42
     *
43
     * @return WorkerInterface Worker
44
     */
45 1
    public function getWorker()
46
    {
47 1
        return $this->worker;
48
    }
49
50
    /**
51
     * Returns object which is going to be passed through a worker.
52
     *
53
     * @return mixed Object sent to worker
54
     */
55 3
    public function getObject()
56
    {
57 3
        return $this->object;
58
    }
59
}
60