Completed
Push — master ( 4e4cd8...063296 )
by Maksim
16s
created

OnExceptionEvent   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 90
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 86.96%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 0
loc 90
ccs 20
cts 23
cp 0.8696
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getPager() 0 4 1
A getOptions() 0 4 1
A getObjectPersister() 0 4 1
A getException() 0 4 1
A setException() 0 4 1
A isIgnored() 0 4 1
A setIgnore() 0 4 1
1
<?php
2
namespace FOS\ElasticaBundle\Persister\Event;
3
4
use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
5
use FOS\ElasticaBundle\Provider\PagerInterface;
6
use Symfony\Component\EventDispatcher\Event;
7
8
final class OnExceptionEvent extends Event
9
{
10
    /**
11
     * @var PagerInterface
12
     */
13
    private $pager;
14
15
    /**
16
     * @var ObjectPersisterInterface
17
     */
18
    private $objectPersister;
19
20
    /**
21
     * @var \Exception
22
     */
23
    private $exception;
24
25
    /**
26
     * @var array
27
     */
28
    private $options;
29
30
    private $ignore;
31
32 2
    public function __construct(PagerInterface $pager, ObjectPersisterInterface $objectPersister, \Exception $exception, array $options)
33
    {
34 2
        $this->pager = $pager;
35 2
        $this->objectPersister = $objectPersister;
36 2
        $this->exception = $exception;
37 2
        $this->options = $options;
38
39 2
        $this->ignore = false;
40 2
    }
41
42
    /**
43
     * @return PagerInterface
44
     */
45 1
    public function getPager()
46
    {
47 1
        return $this->pager;
48
    }
49
50
    /**
51
     * @return array
52
     */
53 1
    public function getOptions()
54
    {
55 1
        return $this->options;
56
    }
57
58
    /**
59
     * @return ObjectPersisterInterface
60
     */
61 1
    public function getObjectPersister()
62
    {
63 1
        return $this->objectPersister;
64
    }
65
66
    /**
67
     * @return \Exception
68
     */
69 1
    public function getException()
70
    {
71 1
        return $this->exception;
72
    }
73
74
    /**
75
     * @param \Exception $exception
76
     */
77
    public function setException(\Exception $exception)
78
    {
79
        $this->exception = $exception;
80
    }
81
82
    /**
83
     * @return bool
84
     */
85 2
    public function isIgnored()
86
    {
87 2
        return $this->ignore;
88
    }
89
90
    /**
91
     * @param bool $ignore
92
     */
93 1
    public function setIgnore($ignore)
94
    {
95 1
        $this->ignore = !!$ignore;
96
    }
97
}