예제 #1
0
 public function testAndSetAbstract()
 {
     $this->class->setAbstract(true);
     $this->assertTrue($this->class->isAbstract());
     $this->class->setAbstract(false);
     $this->assertFalse($this->class->isAbstract());
 }
예제 #2
0
 /**
  * @param \ReflectionClass $class
  * @return MetaClass
  */
 public function metaClass(\ReflectionClass $class)
 {
     $phpyClass = new MetaClass($class->getName());
     $phpyClass->setAbstract($class->isAbstract());
     if ($parent = $class->getParentClass()) {
         $phpyClass->setParent($this->metaClass($parent));
     }
     $phpyClass->setInterfaces($class->getInterfaceNames());
     foreach ($class->getProperties() as $refProperty) {
         $phpyClass->addProperty($this->property($refProperty));
     }
     foreach ($class->getMethods() as $refMethod) {
         $phpyClass->addMethod($this->method($refMethod));
     }
     return $phpyClass;
 }