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 | View Code Duplication | final class PreFetchObjectsEvent extends Event |
|
0 ignored issues
–
show
|
|||
9 | { |
||
10 | /** |
||
11 | * @var PagerInterface |
||
12 | */ |
||
13 | private $pager; |
||
14 | |||
15 | /** |
||
16 | * @var ObjectPersisterInterface |
||
17 | */ |
||
18 | private $objectPersister; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $options; |
||
24 | |||
25 | public function __construct(PagerInterface $pager, ObjectPersisterInterface $objectPersister, array $options) |
||
26 | { |
||
27 | $this->pager = $pager; |
||
28 | $this->objectPersister = $objectPersister; |
||
29 | $this->options = $options; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @return PagerInterface |
||
34 | */ |
||
35 | public function getPager() |
||
36 | { |
||
37 | return $this->pager; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param PagerInterface $pager |
||
42 | */ |
||
43 | public function setPager($pager) |
||
44 | { |
||
45 | $this->pager = $pager; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return array |
||
50 | */ |
||
51 | public function getOptions() |
||
52 | { |
||
53 | return $this->options; |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @param array $options |
||
58 | */ |
||
59 | public function setOptions(array $options) |
||
60 | { |
||
61 | $this->options = $options; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return ObjectPersisterInterface |
||
66 | */ |
||
67 | public function getObjectPersister() |
||
68 | { |
||
69 | return $this->objectPersister; |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @param ObjectPersisterInterface $objectPersister |
||
74 | */ |
||
75 | public function setObjectPersister(ObjectPersisterInterface $objectPersister) |
||
76 | { |
||
77 | $this->objectPersister = $objectPersister; |
||
78 | } |
||
79 | } |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.