Ejemplo n.º 1
0
 /**
  * Gathers up all the fiddly details we need for the ClassData object
  *
  * @param   MockData   $obj
  * @param   EntityData $entity
  * @return  MockData
  */
 private function generateMockDataDetails(MockData $obj, EntityData $entity)
 {
     $methodWorker = new MethodDataWorker();
     $propertyWorker = new PropertyDataWorker();
     $targetClass = $entity->getClassNamespace() . '\\' . $entity->getClassName();
     $obj->setHasConstructor($entity->getHasConstructor())->addUseStatements($entity->getUseStatements())->setExtends($entity->getExtends())->addImplements($entity->getImplements())->addMethods($methodWorker->generateMethodObjects($entity->getMethods()))->addProperties($propertyWorker->generatePropertyObjects($targetClass, $entity->getProperties(), $obj->getMethods()));
     return $obj;
 }
Ejemplo n.º 2
0
 /**
  * Gathers the target class details
  *
  * @param   EntityData $obj
  * @return  EntityData
  */
 private function getClassDetails(EntityData $obj)
 {
     $obj->setHasConstructor($this->hasConstructor($obj->getReflectionClass()))->addUseStatements($this->getClassUseStatements($obj->getFileData()->getFullFilePath()))->setExtends($this->getExtendsClass($obj->getReflectionClass()))->addImplements($this->getImplementsClasses($obj->getReflectionClass()))->addMethods($this->methodWorker->getClassMethods($obj->getReflectionClass()))->addProperties($this->propertyWorker->getClassProperties($obj->getReflectionClass()));
     return $obj;
 }