DI\Definition\Definition::getName PHP Method

getName() public method

Returns the name of the entry in the container.
public getName ( ) : string
return string
    public function getName();

Usage Example

Example #1
0
 /**
  * Resolve a factory definition to a value.
  *
  * This will call the callable of the definition.
  *
  * @param FactoryDefinition $definition
  *
  * {@inheritdoc}
  */
 public function resolve(Definition $definition, array $parameters = [])
 {
     if (!$this->invoker) {
         $parameterResolver = new ResolverChain([new FactoryParameterResolver($this->container), new NumericArrayResolver()]);
         $this->invoker = new Invoker($parameterResolver, $this->container);
     }
     try {
         return $this->invoker->call($definition->getCallable(), [$this->container, $definition]);
     } catch (NotCallableException $e) {
         throw new DefinitionException(sprintf('Entry "%s" cannot be resolved: factory %s', $definition->getName(), $e->getMessage()));
     } catch (NotEnoughParametersException $e) {
         throw new DefinitionException(sprintf('Entry "%s" cannot be resolved: %s', $definition->getName(), $e->getMessage()));
     }
 }
All Usage Examples Of DI\Definition\Definition::getName