コード例 #1
0
 /**
  * Gets parent class
  *
  * @return AnnotatedClass
  */
 public function getParentClass()
 {
     if (false === $this->parent) {
         $this->parent = parent::getParentClass();
         if ($this->parent) {
             $this->parent = new self($this->parent->getName());
         }
     }
     return $this->parent;
 }
コード例 #2
0
 /**
  * Constructor
  *
  * @param AnnotatedClass $declaring   The declaring class
  * @param string         $name        The name of the property
  * @param array          $annotations The property annotations if they are parsed already
  */
 public function __construct(AnnotatedClass $declaring, $name, array $annotations = [])
 {
     parent::__construct($declaring->getName(), $name);
     $this->declaring = $declaring;
     if ($annotations) {
         $this->annotations = $annotations;
     } else {
         $this->findAnnotations();
     }
 }
コード例 #3
0
 /**
  * @covers ::getMethodsWithAnnotation
  */
 public function testGetMethodsWithAnnotation()
 {
     $methods = $this->fixture->getMethodsWithAnnotation(Headzoo\Method::class);
     $this->assertCount(3, $methods);
     $this->assertInstanceOf(AnnotatedMethod::class, $methods["getCounter"]);
     $annotations = $this->fixture->getMethodsWithAnnotation(Headzoo\Method::class, true);
     $this->assertCount(3, $annotations);
     $this->assertInstanceOf(Method::class, $annotations["getCounter"]);
 }
コード例 #4
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 public function setUp()
 {
     $class = new AnnotatedClass(ChildPerson::class);
     $this->fixture = $class->getMethod("getCounter");
 }
コード例 #5
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 public function setUp()
 {
     $class = new AnnotatedClass(ChildPerson::class);
     $this->fixture = $class->getProperty("counter");
 }