1 | <?php |
||
17 | abstract class AbstractProcessor implements AnnotationProcessorInterface |
||
18 | { |
||
19 | /** |
||
20 | * Pattern of "resource" parameter of link annotation |
||
21 | */ |
||
22 | const RESOURCE_PATTERN = '~^(?<repository>[a-z_][a-z0-9_]*)\.(?<link>[a-z_][a-z0-9_]*)$~i'; |
||
23 | |||
24 | /** |
||
25 | * Annotation classes ha been registered. |
||
26 | * |
||
27 | * @var bool |
||
28 | */ |
||
29 | static private $annotationsRegistered = false; |
||
30 | |||
31 | /** |
||
32 | * Doctrine annotation reader |
||
33 | * |
||
34 | * @var Reader |
||
35 | */ |
||
36 | protected $reader; |
||
37 | |||
38 | /** |
||
39 | * AnnotationDefinitionProvider constructor. |
||
40 | * |
||
41 | * @param Reader $reader |
||
42 | */ |
||
43 | public function __construct(Reader $reader) |
||
49 | |||
50 | /** |
||
51 | * Register annotation classes. |
||
52 | * Supports a medieval-aged way of "autoloading" for the Doctrine Annotation library. |
||
53 | */ |
||
54 | static protected function registerAnnotations() |
||
65 | |||
66 | /** |
||
67 | * Create link by link's annotation |
||
68 | * |
||
69 | * @param LinkAnnotation $annotation |
||
70 | * @return Link |
||
71 | */ |
||
72 | protected function createLink(LinkAnnotation $annotation): Link |
||
89 | |||
90 | /** |
||
91 | * Resolve getter of related object |
||
92 | * |
||
93 | * @param \ReflectionProperty $property |
||
94 | * @return string |
||
95 | */ |
||
96 | protected function resolveGetter(\ReflectionProperty $property) |
||
116 | |||
117 | /** |
||
118 | * Resolve getter of related object |
||
119 | * |
||
120 | * @param \ReflectionProperty $property |
||
121 | * @return string | null |
||
122 | */ |
||
123 | protected function resolveSetter(\ReflectionProperty $property) |
||
134 | } |