public function buildProvider(string $key, array $options = []) {
    $provider = $this->get($key);

    switch($provider['Type']) {
      case "Database":
          if (!isset($options['storageHandler']) 
              || !$options['storageHandler'] instanceof \Nuki\Skeletons\Handlers\StorageHandler) {
              throw new \Nuki\Exceptions\Base('No storage handler provided');
          }

          return new $provider['Location']($options['storageHandler']);
      default:
        throw new \Nuki\Exceptions\Base('Unknown provider type given for provider ' . $provider['Location']);
    }   
  }
public function buildProvider(string $key, array $options = []) {
    $provider = $this->get($key);

    switch($provider['Type']) {
      case "Database":
          if (!isset($options['storageHandler']) 
              || !$options['storageHandler'] instanceof \Nuki\Skeletons\Handlers\StorageHandler) {
              throw new \Nuki\Exceptions\Base('No storage handler provided');
          }

          return new $provider['Location']($options['storageHandler']);
      default:
        throw new \Nuki\Exceptions\Base('Unknown provider type given for provider ' . $provider['Location']);
    }   
  }
public function buildProvider ( string $ key , array $ options = [ ] ) { $ provider = $ this -> get ( $ key ) ; switch ( $ provider [ 'Type' ] ) { case "Database" : if ( ! isset ( $ options [ 'storageHandler' ] ) || ! $ options [ 'storageHandler' ] instanceof \ Nuki \ Skeletons \ Handlers \ StorageHandler ) { throw new \ Nuki \ Exceptions \ Base ( 'No storage handler provided' ) ; } return new $ provider [ 'Location' ] ( $ options [ 'storageHandler' ] ) ; default : throw new \ Nuki \ Exceptions \ Base ( 'Unknown provider type given for provider ' . $ provider [ 'Location' ] ) ; } }
Build a provider by its key and additional options

@param string $key
@param array $options
@return \Nuki\Skeletons\Providers\Storage

@throws \Nuki\Exceptions\Base
Build a provider by its key and additional options