Completed
Push — master ( 97e386...fa5639 )
by Simonas
04:55 queued 02:06
created

HashMap::dump()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 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 Doctrine\Common\Annotations\Annotation\Enum;
15
16
/**
17
 * Annotation for property which points to inner object.
18
 *
19
 * @Annotation
20
 * @Target("PROPERTY")
21
 */
22
final class HashMap
23
{
24
    const NAME = 'hash_map';
25
26
    /**
27
     * Name of the type field. Defaults to normalized property name.
28
     *
29
     * @var string
30
     */
31
    public $name;
32
33
    /**
34
     * Property type for nested structure values.
35
     *
36
     * @var mixed
37
     * @Enum({
38
     *     "text", "keyword",
39
     *     "long", "integer", "short", "byte", "double", "float",
40
     *     "date",
41
     *     "boolean",
42
     *     "binary",
43
     *     "geo_point", "geo_shape",
44
     *     "ip", "completion", "token_count", "murmur3", "attachments", "percolator"
45
     * })
46
     */
47
    public $type;
48
49
    /**
50
     * In this field you can define options.
51
     *
52
     * @var array
53
     */
54
    public $options = [];
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function dump(array $exclude = [])
60
    {
61
        return array_diff_key(
62
            array_merge(
63
                [
64
                    'type' => $this->type
65
                ],
66
                $this->options
67
            ),
68
            $exclude
69
        );
70
    }
71
}
72