Failed Conditions
Pull Request — new-parser-ast-metadata (#3)
by
unknown
01:53
created

AnnotationEnumMetadata::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 15
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\Annotations\Fixtures\Metadata;
6
7
use Doctrine\Annotations\Metadata\AnnotationMetadata;
8
use Doctrine\Annotations\Metadata\AnnotationTarget;
9
use Doctrine\Annotations\Metadata\Constraint\CompositeConstraint;
10
use Doctrine\Annotations\Metadata\Constraint\EnumConstraint;
11
use Doctrine\Annotations\Metadata\Constraint\TypeConstraint;
12
use Doctrine\Annotations\Metadata\PropertyMetadata;
13
use Doctrine\Annotations\Metadata\Type\IntegerType;
14
use Doctrine\Annotations\Metadata\Type\MixedType;
15
use Doctrine\Annotations\Metadata\Type\NullType;
16
use Doctrine\Annotations\Metadata\Type\UnionType;
17
use Doctrine\Tests\Annotations\Fixtures\AnnotationEnum;
18
use Doctrine\Tests\Annotations\Fixtures\AnnotationTargetAll;
19
20
final class AnnotationEnumMetadata
21
{
22
    public static function get(): AnnotationMetadata
23
    {
24
        return new AnnotationMetadata(
25
            AnnotationEnum::class,
26
            new AnnotationTarget(AnnotationTarget::TARGET_ALL),
27
            false,
28
            [
29
                new PropertyMetadata(
30
                    'value',
31
                    new CompositeConstraint(
32
                        new TypeConstraint(new MixedType()),
33
                        new EnumConstraint([
34
                            AnnotationEnum::ONE,
35
                            AnnotationEnum::TWO,
36
                            AnnotationEnum::THREE,
37
                        ])
38
                    )
39
                )
40
            ]
41
        );
42
    }
43
}
44