/** * @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); } }
/** * Collect property annotations. * * @param ReflectionProperty methodName * * @return EntityFieldAnnotation[] */ public function getPropertyAnnotations(\ReflectionProperty $prop) { return array_merge($this->reader->getPropertyAnnotations($prop), $this->converter->getPropertyAnnotations($prop)); }