updated plugin WP Mail SMTP
version 2.0.0
This commit is contained in:
@ -23,7 +23,11 @@ use Psr\Cache\CacheItemPoolInterface;
|
||||
* A class to implement caching for any object implementing
|
||||
* FetchAuthTokenInterface
|
||||
*/
|
||||
class FetchAuthTokenCache implements FetchAuthTokenInterface, SignBlobInterface
|
||||
class FetchAuthTokenCache implements
|
||||
FetchAuthTokenInterface,
|
||||
GetQuotaProjectInterface,
|
||||
SignBlobInterface,
|
||||
ProjectIdProviderInterface
|
||||
{
|
||||
use CacheTrait;
|
||||
|
||||
@ -139,4 +143,37 @@ class FetchAuthTokenCache implements FetchAuthTokenInterface, SignBlobInterface
|
||||
|
||||
return $this->fetcher->signBlob($stringToSign, $forceOpenSsl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the quota project used for this API request from the credentials
|
||||
* fetcher.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getQuotaProject()
|
||||
{
|
||||
if ($this->fetcher instanceof GetQuotaProjectInterface) {
|
||||
return $this->fetcher->getQuotaProject();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the Project ID from the fetcher.
|
||||
*
|
||||
* @param callable $httpHandler Callback which delivers psr7 request
|
||||
* @return string|null
|
||||
* @throws \RuntimeException If the fetcher does not implement
|
||||
* `Google\Auth\ProvidesProjectIdInterface`.
|
||||
*/
|
||||
public function getProjectId(callable $httpHandler = null)
|
||||
{
|
||||
if (!$this->fetcher instanceof ProjectIdProviderInterface) {
|
||||
throw new \RuntimeException(
|
||||
'Credentials fetcher does not implement ' .
|
||||
'Google\Auth\ProvidesProjectIdInterface'
|
||||
);
|
||||
}
|
||||
|
||||
return $this->fetcher->getProjectId($httpHandler);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user