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

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

public isLazy ( ) : boolean
Результат boolean
    public function isLazy()
    {
        if ($this->lazy !== null) {
            return $this->lazy;
        } else {
            // Default value
            return false;
        }
    }

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);
 }