PreWorkerEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 42
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getWorker() 0 4 1
A getObject() 0 4 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