public function add($provider)
    {
        if(is_object($provider) && $provider instanceof Provider)
            return $this->register($provider);

        if($this->lateRegistry == true)
        {
            $this->providers[$provider] = false;

            return $this;
        }

        if(method_exists($provider, 'provides') && is_array($dependencies = $provider::provides()) && count($dependencies) > 0)
            return $this->addDeferred($provider, $dependencies);

        $this->providers[$provider] = true;

        $this->register(new $provider);

        return $this;
    }
public function add($provider)
    {
        if(is_object($provider) && $provider instanceof Provider)
            return $this->register($provider);

        if($this->lateRegistry == true)
        {
            $this->providers[$provider] = false;

            return $this;
        }

        if(method_exists($provider, 'provides') && is_array($dependencies = $provider::provides()) && count($dependencies) > 0)
            return $this->addDeferred($provider, $dependencies);

        $this->providers[$provider] = true;

        $this->register(new $provider);

        return $this;
    }
public function add ( $ provider ) { if ( is_object ( $ provider ) && $ provider instanceof Provider ) return $ this -> register ( $ provider ) ; if ( $ this -> lateRegistry == true ) { $ this -> providers [ $ provider ] = false ; return $ this ; } if ( method_exists ( $ provider , 'provides' ) && is_array ( $ dependencies = $ provider :: provides ( ) ) && count ( $ dependencies ) > 0 ) return $ this -> addDeferred ( $ provider , $ dependencies ) ; $ this -> providers [ $ provider ] = true ; $ this -> register ( new $ provider ) ; return $ this ; }
A flexible prover registrar
Register the provider given the class name
Or if the Provider itself, register
@param string $provider fully qualified class name
@return null
A flexible prover registrar Register the provider given the class name Or if the Provider itself register