/**
  * @dataProvider testGetTypeDataProvider
  * @param \Reflector $reflector
  * @param string $classname
  */
 public function testGetType($reflector, $classname)
 {
     // arrange
     $annotationReader = new AnnotationTypeReader();
     // act
     $type = $annotationReader->getType($reflector);
     // assert
     $this->assertEquals($classname, $type);
 }
Beispiel #2
0
 /**
  * @param \ReflectionProperty|\ReflectionMethod $reflector
  * @throws \Exception
  * @throws \TokenReflection\Exception\BrokerException
  * @throws \TokenReflection\Exception\ParseException
  * @throws \TokenReflection\Exception\RuntimeException
  * @return null|\ReflectionClass
  */
 private function parseTypeFromAnnotation($reflector)
 {
     $type = $this->annotationTypeReader->getType($reflector);
     return $type ? new \ReflectionClass($type) : null;
 }