Ejemplo n.º 1
0
 /**
  * Gets parent class.
  *
  * @return ReflectionClass A `ReflectionClass` object or null if the class has no parent.
  */
 public function getParentClass()
 {
     $parent = parent::getParentClass();
     if (!$parent) {
         return null;
     }
     return new ReflectionClass($parent->getName());
 }
Ejemplo n.º 2
0
 /**
  * Test if the `getParentClass` method returns null if the class has no parent.
  */
 public function testGetParentClassReturnNull()
 {
     $className = self::FIXTURE_NS . '\\ClassWithoutParent';
     $object = new ReflectionObject(new $className());
     $this->assertNull($object->getParentClass());
 }