-
Notifications
You must be signed in to change notification settings - Fork 0
/
annotations.php
856 lines (770 loc) · 26.5 KB
/
annotations.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
<?php
/**
* Addendum PHP Reflection Annotations
* http://code.google.com/p/addendum/
*
* Copyright (C) 2006-2009 Jan "johno Suchal <[email protected]>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package AddendumPP
*/
namespace AddendumPP;
use \ReflectionClass,
\ReflectionMethod,
\ReflectionProperty,
\Exception;
require_once(dirname(__FILE__) . '/annotations/annotation_parser.php');
require_once(dirname(__FILE__) . '/annotation_exceptions.php');
/**
* Base class for all annotations
*
* Provides constraint checking, and checks for circular references.
*/
class Annotation {
/**
* @var mixed Stores the un-named argument to the annotation
*/
public $value;
/**
* The addendum object that this method belongs to
*
* @var AddendumPP\AddendumPP
*/
protected $addendum;
/**
* Constructs a new annotation
*
* @param AddendumPP\AddendumPP $addendum The instance of addendum for this annotation
* @param array $data Parameters as an associative array of keys to values
* @param mixed $target The target to which the annotation is applied
*/
public final function __construct($addendum, $data = array(), $target = false) {
$this->addendum = $addendum;
$reflection = new ReflectionClass($this);
$class = $reflection->getName();
if (isset($this->addendum->creationStack[$class])) {
throw new CircularAnnotationReferenceException($class);
}
$this->addendum->creationStack[$class] = true;
foreach ($data as $key => $value) {
if ($reflection->hasProperty($key)) {
$this->$key = $value;
} else {
throw new InvalidPropertyException($class, $key);
}
}
$this->checkTargetConstraints($target);
$this->checkConstraints($target);
unset($this->addendum->creationStack[$class]);
}
/**
* Checks the constraint of the annotation's allowed targets
*
* @param mixed $target The target that this annotation is applied to
*/
private function checkTargetConstraints($target) {
$reflection = new ReflectionAnnotatedClass($this->addendum, $this, 'AddendumPP\Annotation_Target');
if ($reflection->hasAnnotation('Target')) {
$value = $reflection->getAnnotation('Target')->value;
$values = is_array($value) ? $value : array($value);
foreach ($values as $value) {
if ($value == 'meta' && $target instanceof ReflectionClass && $target->isSubclassOf("AddendumPP\Annotation"))
return;
if ($value == 'class' && $target instanceof ReflectionClass)
return;
if ($value == 'method' && $target instanceof ReflectionMethod)
return;
if ($value == 'property' && $target instanceof ReflectionProperty)
return;
if ($value == 'nested' && $target === false)
return;
}
if ($target === false) {
throw new NoNestingAllowedException(get_class($this));
} else {
throw new NestingNotAllowedException(get_class($this), $this->createName($target));
}
}
}
/**
* Creates a fully qualified name for the target, for caching purposes
*
* @param mixed $target The target to be named
* @return string The fully qualified name of the target
*/
private function createName($target) {
if ($target instanceof ReflectionMethod) {
return $target->getUnannotatedDeclaringClass()->getName() . '::' . $target->getName();
} elseif ($target instanceof ReflectionProperty) {
return $target->getUnannotatedDeclaringClass()->getName() . '::$' . $target->getName();
} else {
return $target->getName();
}
}
/**
* Checks any constraints of an annotation
*
* Override this function to add additional constraints to an annotation
*
* @param mixed $target The target that this annotation is applied to
*/
protected function checkConstraints($target) {
}
}
/**
* A collection of utility methods, for dealing with annotations on a reflection
*/
class AnnotationsCollection {
/**
* The annotations in this collection
*
* @var AddendumPP\Annotation[]
*/
private $annotations;
/**
* The addendum object that this method belongs to
*
* @var AddendumPP\AddendumPP
*/
private $addendum;
public function __construct($addendum, $annotations) {
$this->addendum = $addendum;
$this->annotations = $annotations;
}
/**
* Checks whether this collection holds a given annotation
*
* @param type $class Tag name for the annotation
* @return bool
*/
public function hasAnnotation($class) {
$class = $this->addendum->resolveClassName($class);
return isset($this->annotations[$class]);
}
/**
* Returns one annotation, specified by the tag name
*
* @param type $class Tag name for the annotation
* @return AddendumPP\Annotation
*/
public function getAnnotation($class) {
$class = $this->addendum->resolveClassName($class);
return isset($this->annotations[$class]) ? end($this->annotations[$class]) : false;
}
/**
* Returns all annotations, with a max of one per type
*
* @return AddendumPP\Annotation[]
*/
public function getAnnotations() {
$result = array();
foreach ($this->annotations as $instances) {
$result[] = end($instances);
}
return $result;
}
/**
* Returns all annotations, including multiple of the same type
*
* @param string $restriction If specified, only annotations of this tag name will be returned
* @return AddendumPP\Annotation[]
*/
public function getAllAnnotations($restriction = false) {
if($restriction !== false)
$restriction = $this->addendum->resolveClassName($restriction);
$result = array();
foreach ($this->annotations as $class => $instances) {
if (!$restriction || $restriction == $class) {
$result = array_merge($result, $instances);
}
}
return $result;
}
}
/**
* A meta-annotation to restrict which targets it's subject can be applied to
*
* Possible values:
* "class"
* "method"
* "property"
* "meta"
* "nested"
*/
class Annotation_Target extends Annotation {
}
/**
* Parses and instantiates annotation data
*/
class AnnotationsBuilder {
private $cache = array();
private $addendum;
public function __construct($addendum) {
$this->addendum = $addendum;
}
/**
* Given a reflection of an object, collects and returns all the annotations that are applied to it
*
* @param Reflector $targetReflection Reflection of the object to scan for annotations
* @return AnnotationsCollection
*/
public function build($targetReflection, $restriction = NULL) {
$data = $this->parse($targetReflection);
$annotations = array();
foreach ($data as $class => $parameters) {
$className = $this->addendum->resolveClassName($class);
if($restriction != NULL && !(is_subclass_of($className, $restriction) || $restriction == $className))
continue;
foreach ($parameters as $params) {
$annotation = $this->instantiateAnnotation($class, $params, $targetReflection);
if ($annotation !== false) {
$annotations[get_class($annotation)][] = $annotation;
}
}
}
return new AnnotationsCollection($this->addendum, $annotations);
}
/**
* Instantiates an annotation
*
* @param string $class The name of the annotation to instantiate
* @param array $parameters Array of the parameters for the annotation's constructor
* @param Reflector $targetReflection The object that the annotation targets
* @return AddendumPP\Annotation
*/
public function instantiateAnnotation($class, $parameters, $targetReflection = false) {
$class = $this->addendum->resolveClassName($class);
if (is_subclass_of($class, 'AddendumPP\\Annotation') && !$this->addendum->ignores($class) || $class == 'AddendumPP\\Annotation') {
$annotationReflection = new ReflectionClass($class);
return $annotationReflection->newInstance($this->addendum, $parameters, $targetReflection);
}
return false;
}
private function parse($reflection) {
$key = $this->createName($reflection);
if (!isset($this->cache[$key])) {
$parser = new AnnotationsMatcher;
$parser->matches($this->addendum, $this->getDocComment($reflection), $data);
$this->cache[$key] = $data;
}
return $this->cache[$key];
}
private function createName($target) {
if ($target instanceof ReflectionMethod) {
return $target->getDeclaringClass()->getName() . '::' . $target->getName();
} elseif ($target instanceof ReflectionProperty) {
return $target->getDeclaringClass()->getName() . '::$' . $target->getName();
} else {
return $target->getName();
}
}
protected function getDocComment($reflection) {
return $this->addendum->getDocComment($reflection);
}
/**
* Clears the cache of annotations-per-reflection
*/
public function clearCache() {
$this->cache = array();
}
}
/**
* Reflection of a class, with associated annotations
*
* @see ReflectionClass
*/
class ReflectionAnnotatedClass extends ReflectionClass {
/**
* Stores the annotations which target this class
*
* @var AnnotationsCollection
*/
private $annotations;
/**
* The AddendumPP object
*
* @var AddendumPP\AddendumPP
*/
private $addendum;
/**
* @see ReflectionClass::__construct
*
* @param AddendumPP\AddendumPP $addendum
* @param mixed $class
*/
public function __construct($addendum, $class, $restriction = NULL) {
parent::__construct($class);
$this->addendum = $addendum;
$this->annotations = $this->createAnnotationBuilder()->build($this, $restriction);
}
/**
* Checks whether this class is targetted by a type of annotation
*
* @param string $class Tag name of the annotation
* @return bool
*/
public function hasAnnotation($class) {
return $this->annotations->hasAnnotation($class);
}
/**
* Returns one annotation, specified by the tag name
*
* @param string $annotation Tag name of the annotation
* @return AddendumPP\Annotation
*/
public function getAnnotation($annotation) {
return $this->annotations->getAnnotation($annotation);
}
/**
* Returns all annotations, with a max of one per type
*
* @return AddendumPP\Annotation[]
*/
public function getAnnotations() {
return $this->annotations->getAnnotations();
}
/**
* Returns all annotations, including multiple of the same type
*
* @param string $restriction If specified, only annotations of this tag name will be returned
* @return AddendumPP\Annotation[]
*/
public function getAllAnnotations($restriction = false) {
return $this->annotations->getAllAnnotations($restriction);
}
/**
* @see ReflectionClass::getConstructor
*
* @return AddendumPP\ReflectionAnnotatedMethod
*/
public function getConstructor() {
return $this->createReflectionAnnotatedMethod(parent::getConstructor());
}
/**
* @see ReflectionClass::getMethod
*
* @return AddendumPP\ReflectionAnnotatedMethod
*/
public function getMethod($name) {
return $this->createReflectionAnnotatedMethod(parent::getMethod($name));
}
/**
* @see ReflectionClass::getMethods
* @param string $filter Flags with which to filter
* @return AddendumPP\ReflectionAnnotatedMethod[]
*/
public function getMethods($filter = -1) {
$result = array();
foreach (parent::getMethods($filter) as $method) {
$result[] = $this->createReflectionAnnotatedMethod($method);
}
return $result;
}
/**
* @see ReflectionClass::getProperty
* @param string $name Property name
* @return AddendumPP\ReflectionAnnotatedProperty
*/
public function getProperty($name) {
return $this->createReflectionAnnotatedProperty(parent::getProperty($name));
}
/**
* @see ReflectionClass::getProperties
* @param string $filter Flags with which to filter
* @return AddendumPP\ReflectionAnnotatedProperty[]
*/
public function getProperties($filter = -1) {
$result = array();
foreach (parent::getProperties($filter) as $property) {
$result[] = $this->createReflectionAnnotatedProperty($property);
}
return $result;
}
/**
* @see ReflectionClass::getInterfaces
* @return ReflectionInterface
*/
public function getInterfaces() {
$result = array();
foreach (parent::getInterfaces() as $interface) {
$result[] = $this->createReflectionAnnotatedClass($interface);
}
return $result;
}
/**
* @see ReflectionClass::getParentClass
* @return AddendumPP\ReflectionAnnotatedClass
*/
public function getParentClass() {
$class = parent::getParentClass();
return $this->createReflectionAnnotatedClass($class);
}
protected function createAnnotationBuilder() {
return $this->addendum->getAnnotationBuilder();
}
private function createReflectionAnnotatedClass($class) {
return ($class !== false) ? new ReflectionAnnotatedClass($this->addendum, $class->getName()) : false;
}
private function createReflectionAnnotatedMethod($method) {
return ($method !== null) ? new ReflectionAnnotatedMethod($this->addendum, $this->getName(), $method->getName()) : null;
}
private function createReflectionAnnotatedProperty($property) {
return ($property !== null) ? new ReflectionAnnotatedProperty($this->addendum, $this->getName(), $property->getName()) : null;
}
}
/**
* Reflection of a method, with associated annotations
*
* @see ReflectionMethod
*/
class ReflectionAnnotatedMethod extends ReflectionMethod {
/**
* Stores the annotations which target this class
*
* @var AnnotationsCollection
*/
private $annotations;
/**
* The AddendumPP object
*
* @var AddendumPP\AddendumPP
*/
private $addendum;
/**
* @see ReflectionMethod::__construct
*
* @param AddendumPP\AddendumPP $addendum
* @param mixed $class
* @param string $name
*/
public function __construct($addendum, $class, $name) {
parent::__construct($class, $name);
$this->addendum = $addendum;
$this->annotations = $this->createAnnotationBuilder()->build($this);
}
/**
* Checks whether this method is targetted by a type of annotation
*
* @param string $class Tag name of the annotation
* @return bool
*/
public function hasAnnotation($class) {
return $this->annotations->hasAnnotation($class);
}
/**
* Returns all annotations, with a max of one per type
*
* @return AddendumPP\Annotation[]
*/
public function getAnnotation($annotation) {
return $this->annotations->getAnnotation($annotation);
}
/**
* Returns all annotations, with a max of one per type
*
* @return AddendumPP\Annotation[]
*/
public function getAnnotations() {
return $this->annotations->getAnnotations();
}
/**
* Returns all annotations, including multiple of the same type
*
* @param string $restriction If specified, only annotations of this tag name will be returned
* @return AddendumPP\Annotation[]
*/
public function getAllAnnotations($restriction = false) {
return $this->annotations->getAllAnnotations($restriction);
}
/**
* Returns a reflection of the declaring class
*
* @see ReflectionMethod::getDeclaringClass
*
* @return ReflectionClass
*/
public function getUnannotatedDeclaringClass() {
return parent::getDeclaringClass();
}
/**
* Returns a reflection of the declaring class, with annotations
*
* @see ReflectionMethod::getDeclaringClass
*
* @return AddendumPP\ReflectionAnnotatedClass
*/
public function getDeclaringClass() {
$class = parent::getDeclaringClass();
return new ReflectionAnnotatedClass($this->addendum, $class->getName());
}
protected function createAnnotationBuilder() {
return $this->addendum->getAnnotationBuilder();
}
}
/**
* Reflection of a property, with associated annotations
*
* @see ReflectionProperty
*/
class ReflectionAnnotatedProperty extends ReflectionProperty {
/**
* Stores the annotations which target this class
*
* @var AnnotationsCollection
*/
private $annotations;
/**
* The AddendumPP object
*
* @var AddendumPP\AddendumPP
*/
private $addendum;
/**
* @see ReflectionProperty::__construct
*
* @param AddendumPP\AddendumPP $addendum
* @param mixed $class
* @param string $name
*/
public function __construct($addendum, $class, $name) {
parent::__construct($class, $name);
$this->addendum = $addendum;
$this->annotations = $this->createAnnotationBuilder()->build($this);
}
/**
* Checks whether this property is targetted by a type of annotation
*
* @param string $class Tag name of the annotation
* @return bool
*/
public function hasAnnotation($class) {
return $this->annotations->hasAnnotation($class);
}
/**
* Returns all annotations, with a max of one per type
*
* @return AddendumPP\Annotation[]
*/
public function getAnnotation($annotation) {
return $this->annotations->getAnnotation($annotation);
}
/**
* Returns all annotations, with a max of one per type
*
* @return AddendumPP\Annotation[]
*/
public function getAnnotations() {
return $this->annotations->getAnnotations();
}
/**
* Returns all annotations, including multiple of the same type
*
* @param string $restriction If specified, only annotations of this tag name will be returned
* @return AddendumPP\Annotation[]
*/
public function getAllAnnotations($restriction = false) {
return $this->annotations->getAllAnnotations($restriction);
}
/**
* Returns a reflection of the declaring class
*
* @see ReflectionMethod::getDeclaringClass
*
* @return ReflectionClass
*/
public function getUnannotatedDeclaringClass() {
return parent::getDeclaringClass();
}
/**
* Returns a reflection of the declaring class, with annotations
*
* @see ReflectionMethod::getDeclaringClass
*
* @return AddendumPP\ReflectionAnnotatedClass
*/
public function getDeclaringClass() {
$class = parent::getDeclaringClass();
return new ReflectionAnnotatedClass($this->addendum, $class->getName());
}
protected function createAnnotationBuilder() {
return $this->addendum->getAnnotationBuilder();
}
}
/**
* Central class for AddendumPP
*
* Provides the entry point for reflecting annotated objects, as well as
* caching for various related objects
*/
class AddendumPP {
/**
* @var bool Denotes whether the parser will use manual doc-comment parsing
*/
protected $rawMode;
/**
* @var AddendumPP\AnnotationsBuilder The builder which will be used by default
*/
protected $builder;
/**
* @var array List of class names that this addendum instance ignores
*/
protected $ignore;
/**
* @var array List of cached declared annotations
*/
protected $annotations = false;
/**
* @var array List of cached mappings from annotation name to class
*/
protected $cachedMappings = array();
/**
* Stores a list of classes currently being instantiated, to
* be used to detect and error upon circular references
*
* @var string[] Stack of class names being created
*/
public $creationStack = array();
public function __construct() {
$this->checkRawDocCommentParsingNeeded();
$this->builder = new AnnotationsBuilder($this);
}
// <editor-fold desc="Raw mode detection">
/**
* Retrieves the doc comment associated with a given reflection.
* Works regardless of whether PHP supports it or not.
*
* @param Reflector $reflection The reflection on which to operate
* @return string The doc comment if it exists, otherwise FALSE
*/
public function getDocComment($reflection) {
if ($this->checkRawDocCommentParsingNeeded()) {
$docComment = new DocComment();
return $docComment->get($reflection);
} else {
return $reflection->getDocComment();
}
}
/** Raw mode test */
private function checkRawDocCommentParsingNeeded() {
if ($this->rawMode === null) {
$reflection = new ReflectionClass(__CLASS__);
$method = $reflection->getMethod('checkRawDocCommentParsingNeeded');
$this->setRawMode($method->getDocComment() === false);
}
return $this->rawMode;
}
/**
* Enables or disables raw mode parsing of doc comments
*
* @param bool $enabled
*/
public function setRawMode($enabled = true) {
if ($enabled) {
require_once(dirname(__FILE__) . '/annotations/doc_comment.php');
}
$this->rawMode = $enabled;
}
// </editor-fold>
/**
* Forces AddendumPP to ignore annotations of a given class.
* Accepts a variable amount of parameters, one per class
*/
public function ignore() {
foreach (func_get_args() as $class) {
$this->ignore[$class] = true;
}
}
/**
* Checks whether AddendumPP ignores annotations of a given class
*
* @return bool
*/
public function ignores($class) {
return isset($this->ignore[$class]);
}
/**
* Empties the list of classes for AddendumPP to ignore
*/
public function resetIgnoredAnnotations() {
$this->ignore = array();
}
/**
* Returns a list of annotations known to this instance of AddendumPP
* Note: This list is cached on it's first retrieval
*
* @return array
*/
public function getDeclaredAnnotations() {
if (!$this->annotations) {
$this->annotations = array();
foreach (get_declared_classes() as $class) {
if (is_subclass_of($class, 'AddendumPP\\Annotation') || $class == 'AddendumPP\\Annotation') {
$this->annotations[] = $class;
}
}
}
return $this->annotations;
}
/**
* Returns the annotation builder used by this instance of AddendumPP
*
* @return AddendumPP\AnnotationsBuilder
*/
public function getAnnotationBuilder() {
return $this->builder;
}
/**
* Resolves a tag name to a class.
* Override this function to provide your own annotation naming logic
*
* @return string The class name of the annotation
*/
public function resolveClassName($className) {
if (isset($this->cachedMappings[$className]))
return $this->cachedMappings[$className];
$matching = array();
foreach ($this->getDeclaredAnnotations() as $declared) {
if ($declared == $className) {
$matching[] = $declared;
} else {
$pos = strrpos($declared, "_$className");
if ($pos !== false && ($pos + strlen($className) == strlen($declared) - 1)) {
$matching[] = $declared;
}
}
}
$result = null;
switch (count($matching)) {
case 0:
$result = $className;
break;
case 1:
$result = $matching[0];
break;
default:
throw new UnresolvedAnnotationException($className);
}
$this->cachedMappings[$className] = $result;
return $result;
}
/**
* Reflects a class, including annotations
*
* @param string $class Class to reflect
* @return ReflectionAnnotatedClass Annotated reflection of the class
*/
public function reflect($class) {
return new ReflectionAnnotatedClass($this, $class);
}
}
?>