Mise à jour des librairies vendor
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
use Firebase\JWT\ExpiredException as ExpiredExceptionV3;
|
||||
use Firebase\JWT\SignatureInvalidException;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\ClientInterface;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
@@ -120,6 +121,8 @@ class Google_AccessToken_Verify
|
||||
return false;
|
||||
} catch (ExpiredExceptionV3 $e) {
|
||||
return false;
|
||||
} catch (SignatureInvalidException $e) {
|
||||
// continue
|
||||
} catch (DomainException $e) {
|
||||
// continue
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ use Monolog\Handler\SyslogHandler as MonologSyslogHandler;
|
||||
*/
|
||||
class Google_Client
|
||||
{
|
||||
const LIBVER = "2.1.2";
|
||||
const LIBVER = "2.2.1";
|
||||
const USER_AGENT_SUFFIX = "google-api-php-client/";
|
||||
const OAUTH2_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke';
|
||||
const OAUTH2_TOKEN_URI = 'https://www.googleapis.com/oauth2/v4/token';
|
||||
@@ -72,7 +72,7 @@ class Google_Client
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* @var Google_Logger_Abstract $logger
|
||||
* @var Psr\Log\LoggerInterface $logger
|
||||
*/
|
||||
private $logger;
|
||||
|
||||
|
||||
@@ -15,31 +15,31 @@ class Google_Collection extends Google_Model implements Iterator, Countable
|
||||
|
||||
public function rewind()
|
||||
{
|
||||
if (isset($this->modelData[$this->collection_key])
|
||||
&& is_array($this->modelData[$this->collection_key])) {
|
||||
reset($this->modelData[$this->collection_key]);
|
||||
if (isset($this->{$this->collection_key})
|
||||
&& is_array($this->{$this->collection_key})) {
|
||||
reset($this->{$this->collection_key});
|
||||
}
|
||||
}
|
||||
|
||||
public function current()
|
||||
{
|
||||
$this->coerceType($this->key());
|
||||
if (is_array($this->modelData[$this->collection_key])) {
|
||||
return current($this->modelData[$this->collection_key]);
|
||||
if (is_array($this->{$this->collection_key})) {
|
||||
return current($this->{$this->collection_key});
|
||||
}
|
||||
}
|
||||
|
||||
public function key()
|
||||
{
|
||||
if (isset($this->modelData[$this->collection_key])
|
||||
&& is_array($this->modelData[$this->collection_key])) {
|
||||
return key($this->modelData[$this->collection_key]);
|
||||
if (isset($this->{$this->collection_key})
|
||||
&& is_array($this->{$this->collection_key})) {
|
||||
return key($this->{$this->collection_key});
|
||||
}
|
||||
}
|
||||
|
||||
public function next()
|
||||
{
|
||||
return next($this->modelData[$this->collection_key]);
|
||||
return next($this->{$this->collection_key});
|
||||
}
|
||||
|
||||
public function valid()
|
||||
@@ -50,10 +50,10 @@ class Google_Collection extends Google_Model implements Iterator, Countable
|
||||
|
||||
public function count()
|
||||
{
|
||||
if (!isset($this->modelData[$this->collection_key])) {
|
||||
if (!isset($this->{$this->collection_key})) {
|
||||
return 0;
|
||||
}
|
||||
return count($this->modelData[$this->collection_key]);
|
||||
return count($this->{$this->collection_key});
|
||||
}
|
||||
|
||||
public function offsetExists($offset)
|
||||
@@ -61,7 +61,7 @@ class Google_Collection extends Google_Model implements Iterator, Countable
|
||||
if (!is_numeric($offset)) {
|
||||
return parent::offsetExists($offset);
|
||||
}
|
||||
return isset($this->modelData[$this->collection_key][$offset]);
|
||||
return isset($this->{$this->collection_key}[$offset]);
|
||||
}
|
||||
|
||||
public function offsetGet($offset)
|
||||
@@ -70,7 +70,7 @@ class Google_Collection extends Google_Model implements Iterator, Countable
|
||||
return parent::offsetGet($offset);
|
||||
}
|
||||
$this->coerceType($offset);
|
||||
return $this->modelData[$this->collection_key][$offset];
|
||||
return $this->{$this->collection_key}[$offset];
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value)
|
||||
@@ -78,7 +78,7 @@ class Google_Collection extends Google_Model implements Iterator, Countable
|
||||
if (!is_numeric($offset)) {
|
||||
return parent::offsetSet($offset, $value);
|
||||
}
|
||||
$this->modelData[$this->collection_key][$offset] = $value;
|
||||
$this->{$this->collection_key}[$offset] = $value;
|
||||
}
|
||||
|
||||
public function offsetUnset($offset)
|
||||
@@ -86,16 +86,15 @@ class Google_Collection extends Google_Model implements Iterator, Countable
|
||||
if (!is_numeric($offset)) {
|
||||
return parent::offsetUnset($offset);
|
||||
}
|
||||
unset($this->modelData[$this->collection_key][$offset]);
|
||||
unset($this->{$this->collection_key}[$offset]);
|
||||
}
|
||||
|
||||
private function coerceType($offset)
|
||||
{
|
||||
$typeKey = $this->keyType($this->collection_key);
|
||||
if (isset($this->$typeKey) && !is_object($this->modelData[$this->collection_key][$offset])) {
|
||||
$type = $this->$typeKey;
|
||||
$this->modelData[$this->collection_key][$offset] =
|
||||
new $type($this->modelData[$this->collection_key][$offset]);
|
||||
$keyType = $this->keyType($this->collection_key);
|
||||
if ($keyType && !is_object($this->{$this->collection_key}[$offset])) {
|
||||
$this->{$this->collection_key}[$offset] =
|
||||
new $keyType($this->{$this->collection_key}[$offset]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,8 +165,11 @@ class Google_Http_MediaFileUpload
|
||||
|
||||
if (308 == $this->httpResultCode) {
|
||||
// Track the amount uploaded.
|
||||
$range = explode('-', $response->getHeaderLine('range'));
|
||||
$this->progress = $range[1] + 1;
|
||||
$range = $response->getHeaderLine('range');
|
||||
if ($range) {
|
||||
$range_array = explode('-', $range);
|
||||
$this->progress = $range_array[1] + 1;
|
||||
}
|
||||
|
||||
// Allow for changing upload URLs.
|
||||
$location = $response->getHeaderLine('location');
|
||||
|
||||
62
vendor/google/apiclient/src/Google/Model.php
vendored
62
vendor/google/apiclient/src/Google/Model.php
vendored
@@ -53,32 +53,30 @@ class Google_Model implements ArrayAccess
|
||||
*/
|
||||
public function __get($key)
|
||||
{
|
||||
$keyTypeName = $this->keyType($key);
|
||||
$keyType = $this->keyType($key);
|
||||
$keyDataType = $this->dataType($key);
|
||||
if (isset($this->$keyTypeName) && !isset($this->processed[$key])) {
|
||||
if ($keyType && !isset($this->processed[$key])) {
|
||||
if (isset($this->modelData[$key])) {
|
||||
$val = $this->modelData[$key];
|
||||
} else if (isset($this->$keyDataType) &&
|
||||
($this->$keyDataType == 'array' || $this->$keyDataType == 'map')) {
|
||||
} elseif ($keyDataType == 'array' || $keyDataType == 'map') {
|
||||
$val = array();
|
||||
} else {
|
||||
$val = null;
|
||||
}
|
||||
|
||||
if ($this->isAssociativeArray($val)) {
|
||||
if (isset($this->$keyDataType) && 'map' == $this->$keyDataType) {
|
||||
if ($keyDataType && 'map' == $keyDataType) {
|
||||
foreach ($val as $arrayKey => $arrayItem) {
|
||||
$this->modelData[$key][$arrayKey] =
|
||||
$this->createObjectFromName($keyTypeName, $arrayItem);
|
||||
new $keyType($arrayItem);
|
||||
}
|
||||
} else {
|
||||
$this->modelData[$key] = $this->createObjectFromName($keyTypeName, $val);
|
||||
$this->modelData[$key] = new $keyType($val);
|
||||
}
|
||||
} else if (is_array($val)) {
|
||||
$arrayObject = array();
|
||||
foreach ($val as $arrayIndex => $arrayItem) {
|
||||
$arrayObject[$arrayIndex] =
|
||||
$this->createObjectFromName($keyTypeName, $arrayItem);
|
||||
$arrayObject[$arrayIndex] = new $keyType($arrayItem);
|
||||
}
|
||||
$this->modelData[$key] = $arrayObject;
|
||||
}
|
||||
@@ -98,8 +96,24 @@ class Google_Model implements ArrayAccess
|
||||
{
|
||||
// Hard initialise simple types, lazy load more complex ones.
|
||||
foreach ($array as $key => $val) {
|
||||
if ( !property_exists($this, $this->keyType($key)) &&
|
||||
property_exists($this, $key)) {
|
||||
if ($keyType = $this->keyType($key)) {
|
||||
$dataType = $this->dataType($key);
|
||||
if ($dataType == 'array' || $dataType == 'map') {
|
||||
$this->$key = array();
|
||||
foreach ($val as $itemKey => $itemVal) {
|
||||
if ($itemVal instanceof $keyType) {
|
||||
$this->{$key}[$itemKey] = $itemVal;
|
||||
} else {
|
||||
$this->{$key}[$itemKey] = new $keyType($itemVal);
|
||||
}
|
||||
}
|
||||
} elseif ($val instanceof $keyType) {
|
||||
$this->$key = $val;
|
||||
} else {
|
||||
$this->$key = new $keyType($val);
|
||||
}
|
||||
unset($array[$key]);
|
||||
} elseif (property_exists($this, $key)) {
|
||||
$this->$key = $val;
|
||||
unset($array[$key]);
|
||||
} elseif (property_exists($this, $camelKey = $this->camelCase($key))) {
|
||||
@@ -217,19 +231,6 @@ class Google_Model implements ArrayAccess
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a variable name, discover its type.
|
||||
*
|
||||
* @param $name
|
||||
* @param $item
|
||||
* @return object The object from the item.
|
||||
*/
|
||||
private function createObjectFromName($name, $item)
|
||||
{
|
||||
$type = $this->$name;
|
||||
return new $type($item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if $obj is an array.
|
||||
* @throws Google_Exception Thrown if $obj isn't an array.
|
||||
@@ -274,12 +275,21 @@ class Google_Model implements ArrayAccess
|
||||
|
||||
protected function keyType($key)
|
||||
{
|
||||
return $key . "Type";
|
||||
$keyType = $key . "Type";
|
||||
|
||||
// ensure keyType is a valid class
|
||||
if (property_exists($this, $keyType) && class_exists($this->$keyType)) {
|
||||
return $this->$keyType;
|
||||
}
|
||||
}
|
||||
|
||||
protected function dataType($key)
|
||||
{
|
||||
return $key . "DataType";
|
||||
$dataType = $key . "DataType";
|
||||
|
||||
if (property_exists($this, $dataType)) {
|
||||
return $this->$dataType;
|
||||
}
|
||||
}
|
||||
|
||||
public function __isset($key)
|
||||
|
||||
@@ -272,7 +272,7 @@ class Google_Service_Resource
|
||||
if ($paramSpec['location'] == 'path') {
|
||||
$uriTemplateVars[$paramName] = $paramSpec['value'];
|
||||
} else if ($paramSpec['location'] == 'query') {
|
||||
if (isset($paramSpec['repeated']) && is_array($paramSpec['value'])) {
|
||||
if (is_array($paramSpec['value'])) {
|
||||
foreach ($paramSpec['value'] as $value) {
|
||||
$queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($value));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user