public function register()
    {

        $app = $this->app;

        foreach ($app->getProviders() as $provider) {

            $provider = new $provider($app);

            if (!$provider instanceof ServiceProvider) {
                throw new ProviderException(sprintf('Your %s proiver must be a instance of ServiceProvider', get_class($provider)));
            }


            $provider->register();

            $app = $provider->app();
        }
    }
public function register()
    {

        $app = $this->app;

        foreach ($app->getProviders() as $provider) {

            $provider = new $provider($app);

            if (!$provider instanceof ServiceProvider) {
                throw new ProviderException(sprintf('Your %s proiver must be a instance of ServiceProvider', get_class($provider)));
            }


            $provider->register();

            $app = $provider->app();
        }
    }
public function register ( ) { $ app = $ this -> app ; foreach ( $ app -> getProviders ( ) as $ provider ) { $ provider = new $ provider ( $ app ) ; if ( ! $ provider instanceof ServiceProvider ) { throw new ProviderException ( sprintf ( 'Your %s proiver must be a instance of ServiceProvider' , get_class ( $ provider ) ) ) ; } $ provider -> register ( ) ; $ app = $ provider -> app ( ) ; } }
register the providers

@throws ProviderException
register the providers