Completed
Push — master ( ca8ded...dc27cf )
by Karel
22s queued 11s
created

src/Persister/Event/OnExceptionEvent.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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 implements PersistEvent
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated with message: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
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
    /**
31
     * @var array
32
     */
33
    private $objects;
34
35
    /**
36
     * @var bool
37
     */
38
    private $ignore;
39
40 11 View Code Duplication
    public function __construct(
41
        PagerInterface $pager, 
42
        ObjectPersisterInterface $objectPersister, 
43
        \Exception $exception, 
44
        array $objects, 
45
        array $options
46
    ) {
47 11
        $this->pager = $pager;
48 11
        $this->objectPersister = $objectPersister;
49 11
        $this->exception = $exception;
50 11
        $this->options = $options;
51
52 11
        $this->ignore = false;
53 11
        $this->objects = $objects;
54 11
    }
55
56
    /**
57
     * @return PagerInterface
58
     */
59 2
    public function getPager()
60
    {
61 2
        return $this->pager;
62
    }
63
64
    /**
65
     * @return array
66
     */
67 2
    public function getOptions()
68
    {
69 2
        return $this->options;
70
    }
71
72
    /**
73
     * @return ObjectPersisterInterface
74
     */
75 2
    public function getObjectPersister()
76
    {
77 2
        return $this->objectPersister;
78
    }
79
80
    /**
81
     * @return \Exception
82
     */
83 3
    public function getException()
84
    {
85 3
        return $this->exception;
86
    }
87
88
    /**
89
     * @param \Exception $exception
90
     */
91 1
    public function setException(\Exception $exception)
92
    {
93 1
        $this->exception = $exception;
94 1
    }
95
96
    /**
97
     * @return bool
98
     */
99 4
    public function isIgnored()
100
    {
101 4
        return $this->ignore;
102
    }
103
104
    /**
105
     * @param bool $ignore
106
     */
107 2
    public function setIgnore($ignore)
108
    {
109 2
        $this->ignore = !!$ignore;
110 2
    }
111
112
    /**
113
     * @return array
114
     */
115 1
    public function getObjects()
116
    {
117 1
        return $this->objects;
118
    }
119
}