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