Completed
Pull Request — master (#853)
by Maksim
224:46 queued 157:41
created

ObjectType::dump()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
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
 * @deprecated Object is reserved word in PHP 7.2, it will be changed to ObjectType class
24
 */
25
final class ObjectType
26
{
27
    const NAME = 'object';
28
29
    /**
30
     * In this field you can define options.
31
     *
32
     * @var array
33
     */
34
    public $options = [];
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function dump(array $exclude = [])
40
    {
41
        return array_diff_key(
42
            $this->options,
43
            $exclude
44
        );
45
    }
46
}
47