Core/src/ClientTrait.php
private function getConnectionType(array $config)
    {
        $isGrpcExtensionLoaded = $this->isGrpcLoaded();
        $defaultTransport = $isGrpcExtensionLoaded ? 'grpc' : 'rest';
        $transport = isset($config['transport'])
            ? strtolower($config['transport'])
            : $defaultTransport;

        if ($transport === 'grpc') {
            if (!$isGrpcExtensionLoaded) {
                throw new GoogleException(
                    'gRPC support has been requested but required dependencies ' .
                    'have not been found. ' . $this->getGrpcInstallationMessage()
                );
            }
        }

        return $transport;
    }
private function getConnectionType(array $config)
    {
        $isGrpcExtensionLoaded = $this->isGrpcLoaded();
        $defaultTransport = $isGrpcExtensionLoaded ? 'grpc' : 'rest';
        $transport = isset($config['transport'])
            ? strtolower($config['transport'])
            : $defaultTransport;

        if ($transport === 'grpc') {
            if (!$isGrpcExtensionLoaded) {
                throw new GoogleException(
                    'gRPC support has been requested but required dependencies ' .
                    'have not been found. ' . $this->getGrpcInstallationMessage()
                );
            }
        }

        return $transport;
    }
private function getConnectionType ( array $ config ) { $ isGrpcExtensionLoaded = $ this -> isGrpcLoaded ( ) ; $ defaultTransport = $ isGrpcExtensionLoaded ? 'grpc' : 'rest' ; $ transport = isset ( $ config [ 'transport' ] ) ? strtolower ( $ config [ 'transport' ] ) : $ defaultTransport ; if ( $ transport === 'grpc' ) { if ( ! $ isGrpcExtensionLoaded ) { throw new GoogleException ( 'gRPC support has been requested but required dependencies ' . 'have not been found. ' . $ this -> getGrpcInstallationMessage ( ) ) ; } } return $ transport ; }
Get either a gRPC or REST connection based on the provided config
and the system dependencies available.

@param array $config
@return string
@throws GoogleException
Get either a gRPC or REST connection based on the provided config and the system dependencies available .