1 | <?php |
||
36 | class AnnotationDefinition { |
||
37 | |||
38 | /** @var integer */ |
||
39 | private $target; |
||
40 | |||
41 | /** @var string */ |
||
42 | private $annotationName; |
||
43 | |||
44 | /** @var boolean */ |
||
45 | private $required; |
||
46 | |||
47 | /** @var AnnotationParameterDefinition[] */ |
||
48 | private $requiredParameters; |
||
49 | |||
50 | /** @var array */ |
||
51 | private $optionalParameters; |
||
52 | |||
53 | /** |
||
54 | * Class constructor. |
||
55 | * @param string $annotationName |
||
56 | * @param integer $target |
||
57 | * @param boolean $required |
||
58 | * @throws \InvalidArgumentException |
||
59 | */ |
||
60 | 3 | public function __construct($annotationName, $target = Annotation::TARGET_CLASS, $required = true) { |
|
70 | |||
71 | /** |
||
72 | * Returns the target. |
||
73 | * @return integer the annotation target |
||
74 | */ |
||
75 | 1 | public function getTarget() { |
|
78 | |||
79 | /** |
||
80 | * Checks if the annotation matches a target. |
||
81 | * @param integer $target |
||
82 | * @return boolean check result |
||
83 | */ |
||
84 | 1 | public function isTarget($target) { |
|
88 | |||
89 | /** |
||
90 | * Returns the annotation name. |
||
91 | * @return string the annotation name |
||
92 | */ |
||
93 | 1 | public function getName() { |
|
96 | |||
97 | /** |
||
98 | * Checks if the annotation is required. |
||
99 | * @return boolean check result |
||
100 | */ |
||
101 | 1 | public function isRequired() { |
|
104 | |||
105 | /** |
||
106 | * Adds a parameter to annotation. |
||
107 | * @param \Brickoo\Component\Annotation\Definition\AnnotationParameterDefinition $parameter |
||
108 | * @return \Brickoo\Component\Annotation\Definition\AnnotationDefinition |
||
109 | */ |
||
110 | 3 | public function addParameter(AnnotationParameterDefinition $parameter) { |
|
119 | |||
120 | /** |
||
121 | * Returns the required parameters. |
||
122 | * @return AnnotationParameterDefinition[] the required parameters |
||
123 | */ |
||
124 | 1 | public function getRequiredParameters() { |
|
127 | |||
128 | /** |
||
129 | * Checks if the annotation has required parameters. |
||
130 | * @return boolean check result |
||
131 | */ |
||
132 | 1 | public function hasRequiredParameters() { |
|
135 | |||
136 | /** |
||
137 | * Returns the optional parameters. |
||
138 | * @return AnnotationParameterDefinition[] the optional parameters |
||
139 | */ |
||
140 | 1 | public function getOptionalParameters() { |
|
143 | |||
144 | } |
||
145 |