PostAsyncInsertObjectsEvent   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 61
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getPager() 0 4 1
A getOptions() 0 4 1
A getObjectPersister() 0 4 1
A getErrorMessage() 0 4 1
A getObjectsCount() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the FOSElasticaBundle package.
5
 *
6
 * (c) FriendsOfSymfony <https://friendsofsymfony.github.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\ElasticaBundle\Persister\Event;
13
14
use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
15
use FOS\ElasticaBundle\Provider\PagerInterface;
16
use Symfony\Contracts\EventDispatcher\Event;
17
18
final class PostAsyncInsertObjectsEvent extends Event implements PersistEvent
19
{
20
    /**
21
     * @var PagerInterface
22
     */
23
    private $pager;
24
25
    /**
26
     * @var ObjectPersisterInterface
27
     */
28
    private $objectPersister;
29
30
    /**
31
     * @var int
32
     */
33
    private $objectsCount;
34
35
    /**
36
     * @var string|null
37
     */
38
    private $errorMessage;
39
40
    /**
41
     * @var array
42
     */
43
    private $options;
44
45 6
    public function __construct(PagerInterface $pager, ObjectPersisterInterface $objectPersister, int $objectsCount, ?string $errorMessage, array $options)
46
    {
47 6
        $this->pager = $pager;
48 6
        $this->objectPersister = $objectPersister;
49 6
        $this->objectsCount = $objectsCount;
50 6
        $this->errorMessage = $errorMessage;
51 6
        $this->options = $options;
52 6
    }
53
54 1
    public function getPager(): PagerInterface
55
    {
56 1
        return $this->pager;
57
    }
58
59 1
    public function getOptions(): array
60
    {
61 1
        return $this->options;
62
    }
63
64 1
    public function getObjectPersister(): ObjectPersisterInterface
65
    {
66 1
        return $this->objectPersister;
67
    }
68
69 1
    public function getErrorMessage(): ?string
70
    {
71 1
        return $this->errorMessage;
72
    }
73
74 1
    public function getObjectsCount(): int
75
    {
76 1
        return $this->objectsCount;
77
    }
78
}
79