vendor/rdlowrey/auryn/lib/Provider.php
/**
     * Delegates the creation of $class to $callable. Passes $class to $callable as the only argument
     *
     * @param string $className
     * @param callable $callable
     * @param array $args [optional]
     * @throws BadArgumentException
     * @return \Auryn\Provider Returns the current instance
     */
Delegates the creation of $class to $callable.
Delegates the creation of $class to $callable .
public function delegate($className, $callable, array $args = array()) {
        if ($this->canExecute($callable)) {
            $delegate = array($callable, $args);
        } else {
            throw new BadArgumentException(
                sprintf($this->errorMessages[self::E_DELEGATE_ARGUMENT], __CLASS__),
                self::E_DELEGATE_ARGUMENT
            );
        }
        $normalizedClass =$this->normalizeClassName($className);
        $this->delegatedClasses[$normalizedClass] = $delegate;
        return $this;
    }
public function delegate ( $ className , $ callable , array $ args = array ( ) ) { if ( $ this -> canExecute ( $ callable ) ) { $ delegate = array ( $ callable , $ args ) ; } else { throw new BadArgumentException ( sprintf ( $ this -> errorMessages [ self :: E_DELEGATE_ARGUMENT ] , __CLASS__ ) , self :: E_DELEGATE_ARGUMENT ) ; } $ normalizedClass = $ this -> normalizeClassName ( $ className ) ; $ this -> delegatedClasses [ $ normalizedClass ] = $ delegate ; return $ this ; }
Delegates the creation of $class to $callable.
Delegates the creation of $class to $callable .