Completed
Pull Request — master (#1741)
by
unknown
03:22 queued 40s
created

TransformEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 44
ccs 7
cts 14
cp 0.5
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getDocument() 0 4 1
A getFields() 0 4 1
A getObject() 0 4 1
A setDocument() 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\Event;
13
14
use Elastica\Document;
15
use Symfony\Contracts\EventDispatcher\Event;
16
17
abstract class TransformEvent extends Event
18
{
19
    /**
20
     * @var Document
21
     */
22
    private $document;
23
24
    /**
25
     * @var array
26
     */
27
    private $fields;
28
29
    /**
30
     * @var object
31
     */
32
    private $object;
33
34 3
    public function __construct(Document $document, array $fields, object $object)
35
    {
36 3
        $this->document = $document;
37 3
        $this->fields = $fields;
38 3
        $this->object = $object;
39 3
    }
40
41 3
    public function getDocument(): Document
42
    {
43 3
        return $this->document;
44
    }
45
46
    public function getFields(): array
47
    {
48
        return $this->fields;
49
    }
50
51
    public function getObject(): object
52
    {
53
        return $this->object;
54
    }
55
56
    public function setDocument(Document $document)
57
    {
58
        $this->document = $document;
59
    }
60
}
61