protected function addArgumentDefinition($callable, $alias, $args)
    {
        list($argument, $interface) = $args;

        $value = is_callable($callable)
            ? $this->getArgumentProxy($alias, $interface, $callable)
            : $callable;

        $argumentDefinition = array_key_exists($alias, $this->argumentDefinitions)
            ? $this->argumentDefinitions[$alias]
            : [];

        if ($value instanceof Injection) {
            $argumentDefinition[$argument] = $value->getAlias();
        } else {
            $argumentDefinition[":${argument}"] = $value;
        }

        $this->argumentDefinitions[$alias]  = $argumentDefinition;

        $this->define($alias, $this->argumentDefinitions[$alias]);
    }
protected function addArgumentDefinition($callable, $alias, $args)
    {
        list($argument, $interface) = $args;

        $value = is_callable($callable)
            ? $this->getArgumentProxy($alias, $interface, $callable)
            : $callable;

        $argumentDefinition = array_key_exists($alias, $this->argumentDefinitions)
            ? $this->argumentDefinitions[$alias]
            : [];

        if ($value instanceof Injection) {
            $argumentDefinition[$argument] = $value->getAlias();
        } else {
            $argumentDefinition[":${argument}"] = $value;
        }

        $this->argumentDefinitions[$alias]  = $argumentDefinition;

        $this->define($alias, $this->argumentDefinitions[$alias]);
    }
protected function addArgumentDefinition ( $ callable , $ alias , $ args ) { list ( $ argument , $ interface ) = $ args ; $ value = is_callable ( $ callable ) ? $ this -> getArgumentProxy ( $ alias , $ interface , $ callable ) : $ callable ; $ argumentDefinition = array_key_exists ( $ alias , $ this -> argumentDefinitions ) ? $ this -> argumentDefinitions [ $ alias ] : [ ] ; if ( $ value instanceof Injection ) { $ argumentDefinition [ $ argument ] = $ value -> getAlias ( ) ; } else { $ argumentDefinition [ ":${argument}" ] = $ value ; } $ this -> argumentDefinitions [ $ alias ] = $ argumentDefinition ; $ this -> define ( $ alias , $ this -> argumentDefinitions [ $ alias ] ) ; }
Add a single argument definition.

@since 0.2.0

@param callable $callable Callable to execute when the argument is needed.
@param string   $alias    Alias to add the argument definition to.
@param string   $args     Additional arguments used for definition. Array containing $argument & $interface.

@throws InvalidMappingsException If $callable is not a callable.
Add a single argument definition .