Exemplo n.º 1
0
 /**
  * @test
  */
 public function test_parse_var_duplicated()
 {
     $comment = '
         /**
          * foo, bar, baz
          *
          * @var Update[]
          * @var bool
          */
     ';
     $uses = ['Omelet\\Tests\\Target', 'Omelet\\Annotation', __NAMESPACE__];
     $factory = new AnnotationConverter($uses);
     try {
         $factory->parse($comment, '');
         $this->fail();
     } catch (\Exception $ex) {
         if ($ex instanceof PHPUnit_Framework_AssertionFailedError) {
             throw $ex;
         }
         $this->assertInstanceOf(AnnotationException::class, $ex);
     }
 }
Exemplo n.º 2
0
 /**
  * Collect property annotations.
  *
  * @param ReflectionProperty methodName
  *
  * @return EntityFieldAnnotation[]
  */
 public function getPropertyAnnotations(\ReflectionProperty $prop)
 {
     return array_merge($this->reader->getPropertyAnnotations($prop), $this->converter->getPropertyAnnotations($prop));
 }