DI\Definition\ObjectDefinition::getClassName PHP Метод

getClassName() публичный Метод

public getClassName ( ) : string
Результат string Class name
    public function getClassName()
    {
        if ($this->className !== null) {
            return $this->className;
        }
        return $this->name;
    }

Usage Example

Пример #1
0
 /**
  * Returns the definition as string representation.
  *
  * @return string
  */
 public function dump(ObjectDefinition $definition)
 {
     $className = $definition->getClassName();
     $classExist = class_exists($className) || interface_exists($className);
     // Class
     if (!$classExist) {
         $warning = '#UNKNOWN# ';
     } else {
         $class = new \ReflectionClass($className);
         $warning = $class->isInstantiable() ? '' : '#NOT INSTANTIABLE# ';
     }
     $str = sprintf('    class = %s%s', $warning, $className);
     // Scope
     $str .= PHP_EOL . '    scope = ' . $definition->getScope();
     // Lazy
     $str .= PHP_EOL . '    lazy = ' . var_export($definition->isLazy(), true);
     if ($classExist) {
         // Constructor
         $str .= $this->dumpConstructor($className, $definition);
         // Properties
         $str .= $this->dumpProperties($definition);
         // Methods
         $str .= $this->dumpMethods($className, $definition);
     }
     return sprintf('Object (' . PHP_EOL . '%s' . PHP_EOL . ')', $str);
 }
All Usage Examples Of DI\Definition\ObjectDefinition::getClassName