/** * Create annotations from the tokenized input string. * * @return AnnotationList A list of annotation instances or an empty list if no annotation was found. */ private function getAnnotations() { $annotations = new AnnotationList(array()); while (($annotation = $this->getAnnotation()) !== null) { $annotations->addAnnotation($annotation); } return $annotations; }
/** * Test if the method `hasAnnotations` returns true on existing annotation. */ public function testIfHasAnnotationsReturnsTrue() { $list = new AnnotationList(); $list->addAnnotation(new ArrayValue(array())); $result = $list->hasAnnotations(ArrayValue::NAME); $this->assertTrue($result); }