Completed
Push — master ( 7fae80...8ffdf8 )
by Matthew
07:25
created

StubEventSubscriber   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 2
cbo 0
dl 0
loc 33
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A preJob() 0 4 1
A postJob() 0 4 1
A getPreJobCalled() 0 4 1
A getPostJobCalled() 0 4 1
A getSubscribedEvents() 0 7 1
1
<?php
2
3
namespace Dtc\QueueBundle\Tests\EventDispatcher;
4
5
use Dtc\QueueBundle\EventDispatcher\Event;
6
use Dtc\QueueBundle\EventDispatcher\EventSubscriberInterface;
7
8
class StubEventSubscriber implements EventSubscriberInterface
9
{
10
    protected $preJobCalled;
11
    protected $postJobCalled;
12
13
    public function preJob(Event $event)
14
    {
15
        $this->preJobCalled[] = $event;
16
    }
17
18
    public function postJob(Event $event)
19
    {
20
        $this->postJobCalled[] = $event;
21
    }
22
23
    public function getPreJobCalled()
24
    {
25
        return $this->preJobCalled;
26
    }
27
28
    public function getPostJobCalled()
29
    {
30
        return $this->postJobCalled;
31
    }
32
33
    public static function getSubscribedEvents()
34
    {
35
        return [
36
            Event::PRE_JOB => 'preJob',
37
            Event::POST_JOB => 'postJob',
38
        ];
39
    }
40
}
41