Completed
Pull Request — master (#759)
by Mantas
02:31
created

Object::dump()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
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 to mark a class as an object during the parsing process.
16
 *
17
 * `Object` name as class name is forbidden in PHP 7 but we never create this
18
 *  class as object and only use it for annotation definition.
19
 *
20
 * @Annotation
21
 * @Target("CLASS")
22
 */
23
final class Object
24
{
25
    const NAME = 'object';
26
27
    /**
28
     * In this field you can define options.
29
     *
30
     * @var array
31
     */
32
    public $options = [];
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function dump(array $exclude = [])
38
    {
39
        return array_diff_key(
40
            $this->options,
41
            $exclude
42
        );
43
    }
44
}
45