IgnoreAnnotation   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 3
1
<?php
2
3
namespace Doctrine\Common\Annotations\Annotation;
4
5
/**
6
 * Annotation that can be used to signal to the parser to ignore specific
7
 * annotations during the parsing process.
8
 *
9
 * @Annotation
10
 * @author Johannes M. Schmitt <[email protected]>
11
 */
12
final class IgnoreAnnotation
13
{
14
    /**
15
     * @var array
16
     */
17
    public $names;
18
19
    /**
20
     * Constructor.
21
     *
22
     * @param array $values
23
     *
24
     * @throws \RuntimeException
25
     */
26
    public function __construct(array $values)
27
    {
28
        if (is_string($values['value'])) {
29
            $values['value'] = [$values['value']];
30
        }
31
        if (!is_array($values['value'])) {
32
            throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value'])));
33
        }
34
35
        $this->names = $values['value'];
36
    }
37
}
38