Exemplo n.º 1
0
 /**
  * Generates class name for given descriptor
  *
  * @param DescriptorInterface $descriptor Descriptor
  *
  * @return string
  */
 private function _createClassName(DescriptorInterface $descriptor)
 {
     $namespace = array();
     $containing = $descriptor->getContaining();
     while (!is_null($containing)) {
         $namespace[] = self::createTypeName($containing->getName());
         $containing = $containing->getContaining();
     }
     $package = $descriptor->getFile()->getPackage();
     if (!empty($package)) {
         $namespace[] = self::createPackageName($package);
     }
     $namespace = array_reverse($namespace);
     $prefix = implode(self::NAMESPACE_SEPARATOR, $namespace);
     $name = self::createTypeName($descriptor->getName());
     if (!empty($prefix)) {
         $name = $prefix . self::NAMESPACE_SEPARATOR . $name;
     }
     return $name;
 }
Exemplo n.º 2
0
 /**
  * Generates class name for given descriptor
  *
  * @param DescriptorInterface $descriptor Descriptor
  *
  * @return string
  */
 private function _createClassName(DescriptorInterface $descriptor)
 {
     $name = $descriptor->getName();
     return $name;
 }
Exemplo n.º 3
0
 /**
  * Generates class name for given descriptor
  *
  * @param DescriptorInterface $descriptor Descriptor
  *
  * @return string
  */
 private function _createClassName(DescriptorInterface $descriptor)
 {
     $name = self::createTypeName($descriptor->getName());
     $prefix = $this->_createNamespaceName($descriptor);
     if (!empty($prefix)) {
         $name = $prefix . $this->getNamespaceSeparator() . $name;
         if ($this->_useNativeNamespaces) {
             $name = self::NAMESPACE_SEPARATOR_NATIVE . $name;
         }
     }
     return $name;
 }