1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Doctrine\Annotations\Metadata; |
6
|
|
|
|
7
|
|
|
use Doctrine\Annotations\Annotation\Annotation; |
8
|
|
|
use Doctrine\Annotations\Annotation\Enum; |
9
|
|
|
use Doctrine\Annotations\Annotation\IgnoreAnnotation; |
10
|
|
|
use Doctrine\Annotations\Annotation\Required; |
11
|
|
|
use Doctrine\Annotations\Annotation\Target; |
12
|
|
|
use Doctrine\Annotations\Metadata\Type\IntegerType; |
13
|
|
|
use Doctrine\Annotations\Metadata\Type\ListType; |
14
|
|
|
use Doctrine\Annotations\Metadata\Type\NullType; |
15
|
|
|
use Doctrine\Annotations\Metadata\Type\StringType; |
16
|
|
|
use Doctrine\Annotations\Metadata\Type\UnionType; |
17
|
|
|
use Doctrine\Annotations\Parser\Imports; |
18
|
|
|
|
19
|
|
|
final class InternalAnnotations |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @return string[] iterable<string> |
23
|
|
|
*/ |
24
|
12 |
|
public static function getNames() : iterable |
25
|
|
|
{ |
26
|
12 |
|
yield Annotation::class; |
|
|
|
|
27
|
11 |
|
yield Enum::class; |
28
|
10 |
|
yield IgnoreAnnotation::class; |
29
|
9 |
|
yield Required::class; |
30
|
8 |
|
yield Target::class; |
31
|
1 |
|
} |
32
|
|
|
|
33
|
6 |
|
public static function createMetadata() : MetadataCollection |
34
|
|
|
{ |
35
|
6 |
|
return new MetadataCollection( |
36
|
6 |
|
new AnnotationMetadata( |
37
|
6 |
|
Annotation::class, |
38
|
6 |
|
new AnnotationTarget(AnnotationTarget::TARGET_ALL), |
39
|
6 |
|
false |
40
|
|
|
), |
41
|
6 |
|
new AnnotationMetadata( |
42
|
6 |
|
Enum::class, |
43
|
6 |
|
new AnnotationTarget(AnnotationTarget::TARGET_ALL), |
44
|
6 |
|
true, |
45
|
|
|
[ |
46
|
6 |
|
new PropertyMetadata( |
47
|
6 |
|
'value', |
48
|
6 |
|
new ListType(new StringType()), |
49
|
6 |
|
true |
50
|
|
|
), |
51
|
6 |
|
new PropertyMetadata( |
52
|
6 |
|
'literal', |
53
|
6 |
|
new UnionType(new ListType(new StringType()), new NullType()) |
54
|
|
|
), |
55
|
|
|
] |
56
|
|
|
), |
57
|
6 |
|
new AnnotationMetadata( |
58
|
6 |
|
IgnoreAnnotation::class, |
59
|
6 |
|
new AnnotationTarget(AnnotationTarget::TARGET_ALL), |
60
|
6 |
|
true, |
61
|
|
|
[ |
62
|
6 |
|
new PropertyMetadata( |
63
|
6 |
|
'names', |
64
|
6 |
|
new ListType(new StringType()), |
65
|
6 |
|
true |
66
|
|
|
), |
67
|
|
|
] |
68
|
|
|
), |
69
|
6 |
|
new AnnotationMetadata( |
70
|
6 |
|
Required::class, |
71
|
6 |
|
new AnnotationTarget(AnnotationTarget::TARGET_PROPERTY), |
72
|
6 |
|
false |
73
|
|
|
), |
74
|
6 |
|
new AnnotationMetadata( |
75
|
6 |
|
Target::class, |
76
|
6 |
|
new AnnotationTarget(AnnotationTarget::TARGET_ALL), |
77
|
6 |
|
true, |
78
|
|
|
[ |
79
|
6 |
|
new PropertyMetadata( |
80
|
6 |
|
'value', |
81
|
6 |
|
new UnionType(new ListType(new StringType()), new NullType()), |
82
|
6 |
|
true |
83
|
|
|
), |
84
|
6 |
|
new PropertyMetadata( |
85
|
6 |
|
'targets', |
86
|
6 |
|
new UnionType(new IntegerType(), new NullType()) |
87
|
|
|
), |
88
|
6 |
|
new PropertyMetadata( |
89
|
6 |
|
'literal', |
90
|
6 |
|
new UnionType(new IntegerType(), new NullType()) |
91
|
|
|
), |
92
|
|
|
] |
93
|
|
|
) |
94
|
|
|
); |
95
|
|
|
} |
96
|
|
|
|
97
|
6 |
|
public static function createImports() : Imports |
98
|
|
|
{ |
99
|
6 |
|
return new Imports([ |
100
|
6 |
|
'annotation' => Annotation::class, |
101
|
|
|
'enum' => Enum::class, |
102
|
|
|
'ignoreannotation' => IgnoreAnnotation::class, |
103
|
|
|
'required' => Required::class, |
104
|
|
|
'target' => Target::class, |
105
|
|
|
]); |
106
|
|
|
} |
107
|
|
|
} |
108
|
|
|
|