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

StubEventSubscriber::postJob()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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