Total Complexity | 3 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class AnnotationParser |
||
12 | { |
||
13 | /** |
||
14 | * @var DocParser |
||
15 | */ |
||
16 | private $docParser; |
||
17 | |||
18 | /** |
||
19 | * AnnotationParser constructor. |
||
20 | * @param string[] $annotations An array mapping the annotation name to the fully qualified class name |
||
21 | */ |
||
22 | public function __construct(array $annotations) |
||
23 | { |
||
24 | $this->docParser = new DocParser(); |
||
25 | $this->docParser->setImports(array_change_key_case($annotations, \CASE_LOWER)); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param array<string,string> $additionalAnnotations An array associating the name of the annotation in DB comments to the name of a fully qualified Doctrine annotation class |
||
30 | */ |
||
31 | public static function buildWithDefaultAnnotations(array $additionalAnnotations): self |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Parses the doc comment and initializes all the values of interest. |
||
43 | * |
||
44 | */ |
||
45 | public function parse(string $comment, string $context): Annotations |
||
54 | } |
||
55 | } |
||
56 |