PHP Trait Google\Cloud\ClientTrait

Datei anzeigen Open project: GoogleCloudPlatform/gcloud-php

Protected Methods

Method Description
getGrpcDependencyStatus ( ) : array Abstract the checking of extensions/classes for unit testing.
getMetaData ( ) : Metadata Abstract the Metadata instantiation for unit testing
onGce ( $httpHandler ) : boolean Abstract the GCECredentials call so we can mock it in the unit tests!

Private Methods

Method Description
configureAuthentication ( array $config ) : array Fetch and validate the keyfile and set the project ID.
detectProjectId ( array $config ) : string Detect and return a project ID.
getConnectionType ( array $config ) : string Get either a gRPC or REST connection based on the provided config and system settings.
getKeyFile ( array $config = [] ) : array Get a keyfile.

Method Details

getGrpcDependencyStatus() protected method

Abstract the checking of extensions/classes for unit testing.
protected getGrpcDependencyStatus ( ) : array
return array

getMetaData() protected method

Abstract the Metadata instantiation for unit testing
protected getMetaData ( ) : Metadata
return Google\Cloud\Compute\Metadata

onGce() protected method

Abstract the GCECredentials call so we can mock it in the unit tests!
protected onGce ( $httpHandler ) : boolean
return boolean