Completed
Pull Request — v0.10 (#630)
by Tautrimas
93:19
created

Document   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A dump() 0 15 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 bool
26
     */
27
    public $create = true;
28
29
    /**
30
     * @var string
31
     */
32
    public $type;
33
34
    /**
35
     * @var string
36
     */
37
    public $parent;
38
39
    /**
40
     * @var array
41
     */
42
    public $ttl;
43
44
    /**
45
     * @var bool
46
     */
47
    public $enabled;
48
49
    /**
50
     * @var array
51
     */
52
    public $all;
53
54
    /**
55
     * @var string
56
     */
57
    public $dynamic;
58
59
    /**
60
     * @var array
61
     */
62
    public $dynamicTemplates;
63
    
64
    /**
65
     * @var array
66
     */
67
    public $transform;
68
69
    /**
70
     * @var array
71
     */
72
    public $dynamicDateFormats;
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function dump(array $exclude = [])
78
    {
79
        return array_diff_key(
80
            [
81
                '_ttl' => $this->ttl,
82
                '_all' => $this->all,
83
                'enabled' => $this->enabled,
84
                'dynamic' => $this->dynamic,
85
                'dynamic_templates' => $this->dynamicTemplates,
86
                'transform' => $this->transform,
87
                'dynamic_date_formats' => $this->dynamicDateFormats,
88
            ],
89
            $exclude
90
        );
91
    }
92
}
93