AbstractGearmanClientTaskEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 52
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getGearmanTask() 0 4 1
A setContext() 0 4 1
A getContext() 0 4 1
1
<?php
2
3
/**
4
 * Gearman Bundle for Symfony2 / Symfony3
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * Feel free to edit as you please, and have fun.
10
 *
11
 * @author Marc Morera <[email protected]>
12
 */
13
14
namespace Mkk\GearmanBundle\Event\Abstracts;
15
16
use GearmanTask;
17
use Symfony\Component\EventDispatcher\Event;
18
19
/**
20
 * AbstractGearmanClientTaskEvent
21
 */
22
abstract class AbstractGearmanClientTaskEvent extends Event
23
{
24
    /**
25
     * @var GearmanTask
26
     *
27
     * Gearman task object
28
     */
29
    protected $gearmanTask;
30
31
    /**
32
     * @var mixed
33
     *
34
     * Context that can be set in the addTask method
35
     */
36
    protected $context;
37
38
    /**
39
     * Construct method
40
     *
41
     * @param GearmanTask $gearmanTask Gearman Task
42
     */
43
    public function __construct(GearmanTask $gearmanTask)
44
    {
45
        $this->gearmanTask = $gearmanTask;
46
    }
47
48
    /**
49
     * Get Gearman Task
50
     *
51
     * @return GearmanTask Gearman Task
52
     */
53
    public function getGearmanTask()
54
    {
55
        return $this->gearmanTask;
56
    }
57
58
    /**
59
     * @param mixed $context Context that can be set in the addTask method
60
     */
61
    public function setContext($context)
62
    {
63
        $this->context = &$context['context'];
64
    }
65
66
    /**
67
     * @return mixed Context that can be set in the addTask method
68
     */
69
    public function &getContext()
70
    {
71
        return $this->context;
72
    }
73
}
74