public function getDigitalOcean($file = self::DEFAULT_CREDENTIALS_FILE)
    {
        if (!file_exists($file)) {
            throw new \RuntimeException(sprintf('Impossible to get credentials informations in %s', $file));
        }

        $credentials = Yaml::parse($file);

        return new DigitalOcean(new Credentials($credentials['CLIENT_ID'], $credentials['API_KEY']));
    }
public function getDigitalOcean($file = self::DEFAULT_CREDENTIALS_FILE)
    {
        if (!file_exists($file)) {
            throw new \RuntimeException(sprintf('Impossible to get credentials informations in %s', $file));
        }

        $credentials = Yaml::parse($file);

        return new DigitalOcean(new Credentials($credentials['CLIENT_ID'], $credentials['API_KEY']));
    }
public function getDigitalOcean ( $ file = self :: DEFAULT_CREDENTIALS_FILE ) { if ( ! file_exists ( $ file ) ) { throw new \ RuntimeException ( sprintf ( 'Impossible to get credentials informations in %s' , $ file ) ) ; } $ credentials = Yaml :: parse ( $ file ) ; return new DigitalOcean ( new Credentials ( $ credentials [ 'CLIENT_ID' ] , $ credentials [ 'API_KEY' ] ) ) ; }
Returns an instance of DigitalOcean

@param string $file The file with credentials.

@return DigitalOcean An instance of DigitalOcean

@throws \RuntimeException
Returns an instance of DigitalOcean