Provides shared functionality for REST service implementations.

Trait
Methods
public requestWrapper()
 

Get the RequestWrapper.

  • return RequestWrapper|null
public send( $resource, $method, array $options = [], $whitelisted = false)
 

Delivers a request built from the service definition.

  • return array
public setRequestBuilder(Google\Cloud\Core\RequestBuilder $requestBuilder)
 

Sets the request builder.

    public setRequestWrapper(Google\Cloud\Core\RequestWrapper $requestWrapper)
     

    Sets the request wrapper.

      Properties
      private $requestBuilder
       
      private $requestWrapper
       
      Methods
      private arrayFilterRemoveNull(array $arr)
       

      Just like array_filter(), but preserves falsey values except null.

      • return array
      private arrayMergeRecursive(array $array1, array $array2)
       

      A method, similar to PHP's array_merge_recursive, with two differences.

      1. Keys in $array2 take precedence over keys in $array1.
      2. Non-array keys found in both inputs are not transformed into an array
        and appended. Rather, the value in $array2 is used.
      • return array
      private getApiEndpoint( $default, array $config)
       

      Return a custom API endpoint in the proper format, or default if none provided.

      • return string
      private isAssoc(array $arr)
       

      Determine whether given array is associative.

      • return bool
      private static jsonDecode( $json, $assoc = false, $depth = 512, $options = 0)
       
      • return mixed
      • throws InvalidArgumentException
      private static jsonEncode( $value, $options = 0, $depth = 512)
       
      • return string
      • throws InvalidArgumentException
      private modifyWhitelistedError(Google\Cloud\Core\Exception\NotFoundException $e)
       

      Modify the error message of a whitelisted exception.

      • return NotFoundException
      private pluck( $key, array $arr, $isRequired = true)
       

      Pluck a value out of an array.

      • return mixed
      • throws InvalidArgumentException
      private pluckArray(array $keys, $arr)
       

      Pluck a subset of an array.

      • return array
      Methods
      private static jsonDecode( $json, $assoc = false, $depth = 512, $options = 0)
       
      • return mixed
      • throws InvalidArgumentException
      private static jsonEncode( $value, $options = 0, $depth = 512)
       
      • return string
      • throws InvalidArgumentException
      © 2020 Bruce Wells
      Search Namespaces \ Classes
      ConfigurationNumbers (0-9.) only