/**
  * 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;
 }
 /**
  * Generates use statements out of namespaces for all classes used by the mocked class
  *
  * To help out with generating mocks, we're gathering the namespaces
  * that are used in typehinting as well as the ones declared at the
  * top of the file.
  *
  * @param   MockData   $mockData   MockData object
  * @param   EntityData $entityData EntityData object
  * @return  string
  */
 protected function generateUseStatements(MockData $mockData, EntityData $entityData)
 {
     $classUse = $mockData->getUseStatements();
     $mockedClassUse = "use {$entityData->getClassNamespace()}\\{$entityData->getClassName()};";
     array_unshift($classUse, $mockedClassUse);
     $propUse = $this->getUseStatementsFromClassProperties($mockData->getProperties());
     $methodUse = $this->getUseStatementsFromClassMethods($mockData->getMethods());
     $statements = array_merge($classUse, $propUse, $methodUse);
     return join(PHP_EOL, array_unique($statements));
 }