示例#1
0
 /**
  * @param $annotation
  * @return AnnotationBag
  */
 public function create($annotation)
 {
     $annotationBag = new AnnotationBag();
     foreach ($this->getAnnotationParts($annotation) as $annotationPart) {
         $annotationBag->add($this->createByPart($annotationPart));
     }
     return $annotationBag;
 }
示例#2
0
 /**
  * @test
  */
 public function testCreateAnnotationArray()
 {
     $array = ['index' => 'value', 1 => true, 'matrix' => ['a' => 'b']];
     $annotation1 = $this->createAnnotation('myAnnotationArray1', $array);
     $annotation2 = $this->createAnnotation('myAnnotationArray2', $array);
     $bag = new AnnotationBag();
     $bag->add($annotation1);
     $bag->add($annotation2);
     $result = $this->factory->create($this->getAnnotationArray());
     $this->assertEquals($bag, $result);
 }