Completed
Pull Request — 1.0 (#637)
by
unknown
02:32
created

Document   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 55
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A dump() 0 14 1
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
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 ONGR\ElasticsearchBundle\Annotation;
13
14
use ONGR\ElasticsearchBundle\Mapping\DumperInterface;
15
16
/**
17
 * Annotation to mark a class as an Elasticsearch document.
18
 *
19
 * @Annotation
20
 * @Target("CLASS")
21
 */
22
final class Document implements DumperInterface
23
{
24
    /**
25
     * @var string
26
     */
27
    public $type;
28
29
    /**
30
     * @var bool
31
     */
32
    public $enabled;
33
34
    /**
35
     * @var array
36
     */
37
    public $all;
38
39
    /**
40
     * @var string
41
     */
42
    public $dynamic;
43
44
    /**
45
     * @var array
46
     */
47
    public $dynamicTemplates;
48
    
49
    /**
50
     * @var array
51
     */
52
    public $transform;
53
54
    /**
55
     * @var array
56
     */
57
    public $dynamicDateFormats;
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function dump(array $exclude = [])
63
    {
64
        return array_diff_key(
65
            [
66
                'enabled' => $this->enabled,
67
                '_all' => $this->all,
68
                'dynamic' => $this->dynamic,
69
                'dynamic_templates' => $this->dynamicTemplates,
70
                'transform' => $this->transform,
71
                'dynamic_date_formats' => $this->dynamicDateFormats,
72
            ],
73
            $exclude
74
        );
75
    }
76
}
77