|
|
@@ -47,9 +47,9 @@ class Helper
|
|
|
*
|
|
|
* @var array
|
|
|
*/
|
|
|
- private static $pasteV2 = array(
|
|
|
- 'adata' => array(
|
|
|
- array(
|
|
|
+ private static $pasteV2 = [
|
|
|
+ 'adata' => [
|
|
|
+ [
|
|
|
'gMSNoLOk4z0RnmsYwXZ8mw==',
|
|
|
'TZO+JWuIuxs=',
|
|
|
100000,
|
|
|
@@ -58,17 +58,17 @@ class Helper
|
|
|
'aes',
|
|
|
'gcm',
|
|
|
'zlib',
|
|
|
- ),
|
|
|
+ ],
|
|
|
'plaintext',
|
|
|
1,
|
|
|
0,
|
|
|
- ),
|
|
|
- 'meta' => array(
|
|
|
+ ],
|
|
|
+ 'meta' => [
|
|
|
'expire' => '5min',
|
|
|
- ),
|
|
|
+ ],
|
|
|
'v' => 2,
|
|
|
'ct' => 'ME5JF/YBEijp2uYMzLZozbKtWc5wfy6R59NBb7SmRig=',
|
|
|
- );
|
|
|
+ ];
|
|
|
|
|
|
/**
|
|
|
* example ID of a comment
|
|
|
@@ -82,17 +82,17 @@ class Helper
|
|
|
*
|
|
|
* @var array
|
|
|
*/
|
|
|
- private static $commentV2 = array(
|
|
|
+ private static $commentV2 = [
|
|
|
'icon' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABGUlEQVQokWOsl5/94983CNKQMjnxaOePf98MeKwPfNjkLZ3AgARab6b9+PeNEVnDj3/ff/z7ZiHnzsDA8Pv7H2TVPJw8EAYLAwb48OaVgIgYKycLsrYv378wMDB8//qdCVMDRA9EKSsnCwRBxNsepaLboMFlyMDAICAi9uHNK24GITQ/MDAwoNhgIGMLtwGrzegaLjw5jMz9+vUdnN17uwDCQDhJgk0O07yvX9+teDX1x79v6DYIsIjgcgMaYGFgYOBg4kJx2JejkAiBxAw+PzAwMNz4dp6wDXDw4MdNNOl0rWYsNkD89OLXI/xmo9sgzatJjAYmBgYGDiauD3/ePP18nVgb4MF89+M5ZX6js293wUMpnr8KTQMAxsCJnJ30apMAAAAASUVORK5CYII=',
|
|
|
'created' => 1344803528,
|
|
|
- );
|
|
|
+ ];
|
|
|
|
|
|
/**
|
|
|
* JS files and their SRI hashes
|
|
|
*
|
|
|
* @var array
|
|
|
*/
|
|
|
- private static $hashes = array();
|
|
|
+ private static $hashes = [];
|
|
|
|
|
|
/**
|
|
|
* get example paste ID
|
|
|
@@ -110,7 +110,7 @@ class Helper
|
|
|
* @param array $meta
|
|
|
* @return array
|
|
|
*/
|
|
|
- public static function getPaste(array $meta = array()): array
|
|
|
+ public static function getPaste(array $meta = []): array
|
|
|
{
|
|
|
$example = self::$pasteV2;
|
|
|
$example['meta']['salt'] = ServerSalt::generate();
|
|
|
@@ -124,10 +124,10 @@ class Helper
|
|
|
* @param array $meta
|
|
|
* @return array
|
|
|
*/
|
|
|
- public static function getPastePost(array $meta = array()): array
|
|
|
+ public static function getPastePost(array $meta = []): array
|
|
|
{
|
|
|
$example = self::getPaste($meta);
|
|
|
- $example['meta'] = array('expire' => $example['meta']['expire']);
|
|
|
+ $example['meta'] = ['expire' => $example['meta']['expire']];
|
|
|
return $example;
|
|
|
}
|
|
|
|
|
|
@@ -137,7 +137,7 @@ class Helper
|
|
|
* @param array $meta
|
|
|
* @return string
|
|
|
*/
|
|
|
- public static function getPasteJson(array $meta = array()): string
|
|
|
+ public static function getPasteJson(array $meta = []): string
|
|
|
{
|
|
|
return json_encode(self::getPastePost($meta));
|
|
|
}
|
|
|
@@ -158,7 +158,7 @@ class Helper
|
|
|
* @param array $meta
|
|
|
* @return array
|
|
|
*/
|
|
|
- public static function getComment(array $meta = array()): array
|
|
|
+ public static function getComment(array $meta = []): array
|
|
|
{
|
|
|
$example = self::$pasteV2;
|
|
|
$example['adata'] = $example['adata'][0];
|
|
|
@@ -319,7 +319,7 @@ class Helper
|
|
|
public static function varExportMin($var, $return = false): string
|
|
|
{
|
|
|
if (is_array($var)) {
|
|
|
- $toImplode = array();
|
|
|
+ $toImplode = [];
|
|
|
foreach ($var as $key => $value) {
|
|
|
$toImplode[] = var_export($key, true) . ' => ' . self::varExportMin($value, true);
|
|
|
}
|
|
|
@@ -383,12 +383,12 @@ class BucketStub extends Bucket
|
|
|
private $_connection;
|
|
|
private $_client;
|
|
|
|
|
|
- public function __construct(ConnectionInterface $connection, $name, array $info = array(), $client = null)
|
|
|
+ public function __construct(ConnectionInterface $connection, $name, array $info = [], $client = null)
|
|
|
{
|
|
|
$this->_name = $name;
|
|
|
$this->_info = $info;
|
|
|
$this->_connection = $connection;
|
|
|
- $this->_objects = array();
|
|
|
+ $this->_objects = [];
|
|
|
$this->_client = $client;
|
|
|
}
|
|
|
|
|
|
@@ -402,12 +402,12 @@ class BucketStub extends Bucket
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function exists(array $options = array())
|
|
|
+ public function exists(array $options = [])
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- public function upload($data, array $options = array())
|
|
|
+ public function upload($data, array $options = [])
|
|
|
{
|
|
|
if (!is_string($data) || !array_key_exists('name', $options)) {
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
@@ -420,27 +420,27 @@ class BucketStub extends Bucket
|
|
|
$o->setData($data);
|
|
|
}
|
|
|
|
|
|
- public function uploadAsync($data, array $options = array())
|
|
|
+ public function uploadAsync($data, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function getResumableUploader($data, array $options = array())
|
|
|
+ public function getResumableUploader($data, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function getStreamableUploader($data, array $options = array())
|
|
|
+ public function getStreamableUploader($data, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function object($name, array $options = array())
|
|
|
+ public function object($name, array $options = [])
|
|
|
{
|
|
|
return $this->_objects[$name] ?? new StorageObjectStub($this->_connection, $name, $this, null, $options);
|
|
|
}
|
|
|
|
|
|
- public function objects(array $options = array())
|
|
|
+ public function objects(array $options = [])
|
|
|
{
|
|
|
$prefix = $options['prefix'] ?? '';
|
|
|
|
|
|
@@ -452,7 +452,7 @@ class BucketStub extends Bucket
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- public function createNotification($topic, array $options = array())
|
|
|
+ public function createNotification($topic, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -462,32 +462,32 @@ class BucketStub extends Bucket
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function notifications(array $options = array())
|
|
|
+ public function notifications(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function delete(array $options = array())
|
|
|
+ public function delete(array $options = [])
|
|
|
{
|
|
|
$this->_client->deleteBucket($this->_name);
|
|
|
}
|
|
|
|
|
|
- public function update(array $options = array())
|
|
|
+ public function update(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function compose(array $sourceObjects, $name, array $options = array())
|
|
|
+ public function compose(array $sourceObjects, $name, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function info(array $options = array())
|
|
|
+ public function info(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function reload(array $options = array())
|
|
|
+ public function reload(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -497,12 +497,12 @@ class BucketStub extends Bucket
|
|
|
return $this->_name;
|
|
|
}
|
|
|
|
|
|
- public static function lifecycle(array $lifecycle = array())
|
|
|
+ public static function lifecycle(array $lifecycle = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function currentLifecycle(array $options = array())
|
|
|
+ public function currentLifecycle(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -517,17 +517,17 @@ class BucketStub extends Bucket
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function lockRetentionPolicy(array $options = array())
|
|
|
+ public function lockRetentionPolicy(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function signedUrl($expires, array $options = array())
|
|
|
+ public function signedUrl($expires, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function generateSignedPostPolicyV4($objectName, $expires, array $options = array())
|
|
|
+ public function generateSignedPostPolicyV4($objectName, $expires, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -546,7 +546,7 @@ class StorageObjectStub extends StorageObject
|
|
|
private $_exists = false;
|
|
|
private $_connection;
|
|
|
|
|
|
- public function __construct(ConnectionInterface $connection, $name, $bucket, $generation = null, array $info = array(), $encryptionKey = null, $encryptionKeySHA256 = null)
|
|
|
+ public function __construct(ConnectionInterface $connection, $name, $bucket, $generation = null, array $info = [], $encryptionKey = null, $encryptionKeySHA256 = null)
|
|
|
{
|
|
|
$this->_name = $name;
|
|
|
$this->_bucket = $bucket;
|
|
|
@@ -562,7 +562,7 @@ class StorageObjectStub extends StorageObject
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function exists(array $options = array())
|
|
|
+ public function exists(array $options = [])
|
|
|
{
|
|
|
return array_key_exists($this->_name, $this->_bucket->_objects);
|
|
|
}
|
|
|
@@ -570,7 +570,7 @@ class StorageObjectStub extends StorageObject
|
|
|
/**
|
|
|
* @throws NotFoundException
|
|
|
*/
|
|
|
- public function delete(array $options = array())
|
|
|
+ public function delete(array $options = [])
|
|
|
{
|
|
|
if (array_key_exists($this->_name, $this->_bucket->_objects)) {
|
|
|
unset($this->_bucket->_objects[$this->_name]);
|
|
|
@@ -582,7 +582,7 @@ class StorageObjectStub extends StorageObject
|
|
|
/**
|
|
|
* @throws NotFoundException
|
|
|
*/
|
|
|
- public function update(array $metadata, array $options = array())
|
|
|
+ public function update(array $metadata, array $options = [])
|
|
|
{
|
|
|
if (!$this->_exists) {
|
|
|
throw new NotFoundException('key ' . $this->_name . ' not found.');
|
|
|
@@ -590,17 +590,17 @@ class StorageObjectStub extends StorageObject
|
|
|
$this->_info = $metadata;
|
|
|
}
|
|
|
|
|
|
- public function copy($destination, array $options = array())
|
|
|
+ public function copy($destination, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function rewrite($destination, array $options = array())
|
|
|
+ public function rewrite($destination, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function rename($name, array $options = array())
|
|
|
+ public function rename($name, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -608,7 +608,7 @@ class StorageObjectStub extends StorageObject
|
|
|
/**
|
|
|
* @throws NotFoundException
|
|
|
*/
|
|
|
- public function downloadAsString(array $options = array())
|
|
|
+ public function downloadAsString(array $options = [])
|
|
|
{
|
|
|
if (!$this->_exists) {
|
|
|
throw new NotFoundException('key ' . $this->_name . ' not found.');
|
|
|
@@ -616,42 +616,42 @@ class StorageObjectStub extends StorageObject
|
|
|
return $this->_data;
|
|
|
}
|
|
|
|
|
|
- public function downloadToFile($path, array $options = array())
|
|
|
+ public function downloadToFile($path, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function downloadAsStream(array $options = array())
|
|
|
+ public function downloadAsStream(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function downloadAsStreamAsync(array $options = array())
|
|
|
+ public function downloadAsStreamAsync(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function signedUrl($expires, array $options = array())
|
|
|
+ public function signedUrl($expires, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function signedUploadUrl($expires, array $options = array())
|
|
|
+ public function signedUploadUrl($expires, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function beginSignedUploadSession(array $options = array())
|
|
|
+ public function beginSignedUploadSession(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function info(array $options = array())
|
|
|
+ public function info(array $options = [])
|
|
|
{
|
|
|
- return $this->_info['metadata'] ?? array();
|
|
|
+ return $this->_info['metadata'] ?? [];
|
|
|
}
|
|
|
|
|
|
- public function reload(array $options = array())
|
|
|
+ public function reload(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -687,52 +687,52 @@ class StorageObjectStub extends StorageObject
|
|
|
*/
|
|
|
class ConnectionInterfaceStub implements ConnectionInterface
|
|
|
{
|
|
|
- public function deleteAcl(array $args = array())
|
|
|
+ public function deleteAcl(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function getAcl(array $args = array())
|
|
|
+ public function getAcl(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function listAcl(array $args = array())
|
|
|
+ public function listAcl(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function insertAcl(array $args = array())
|
|
|
+ public function insertAcl(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function patchAcl(array $args = array())
|
|
|
+ public function patchAcl(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function deleteBucket(array $args = array())
|
|
|
+ public function deleteBucket(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function restoreBucket(array $args = array())
|
|
|
+ public function restoreBucket(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function getBucket(array $args = array())
|
|
|
+ public function getBucket(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function listBuckets(array $args = array())
|
|
|
+ public function listBuckets(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function insertBucket(array $args = array())
|
|
|
+ public function insertBucket(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -752,122 +752,122 @@ class ConnectionInterfaceStub implements ConnectionInterface
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function patchBucket(array $args = array())
|
|
|
+ public function patchBucket(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function deleteObject(array $args = array())
|
|
|
+ public function deleteObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function restoreObject(array $args = array())
|
|
|
+ public function restoreObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function copyObject(array $args = array())
|
|
|
+ public function copyObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function rewriteObject(array $args = array())
|
|
|
+ public function rewriteObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function moveObject(array $args = array())
|
|
|
+ public function moveObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function composeObject(array $args = array())
|
|
|
+ public function composeObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function getObject(array $args = array())
|
|
|
+ public function getObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function headObject(array $args = array()): array
|
|
|
+ public function headObject(array $args = []): array
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function listObjects(array $args = array())
|
|
|
+ public function listObjects(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function patchObject(array $args = array())
|
|
|
+ public function patchObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function downloadObject(array $args = array())
|
|
|
+ public function downloadObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function insertObject(array $args = array())
|
|
|
+ public function insertObject(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function getNotification(array $args = array())
|
|
|
+ public function getNotification(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function deleteNotification(array $args = array())
|
|
|
+ public function deleteNotification(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function insertNotification(array $args = array())
|
|
|
+ public function insertNotification(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function listNotifications(array $args = array())
|
|
|
+ public function listNotifications(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function getServiceAccount(array $args = array())
|
|
|
+ public function getServiceAccount(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function lockRetentionPolicy(array $args = array())
|
|
|
+ public function lockRetentionPolicy(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function createHmacKey(array $args = array())
|
|
|
+ public function createHmacKey(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function deleteHmacKey(array $args = array())
|
|
|
+ public function deleteHmacKey(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function getHmacKey(array $args = array())
|
|
|
+ public function getHmacKey(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function updateHmacKey(array $args = array())
|
|
|
+ public function updateHmacKey(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function listHmacKeys(array $args = array())
|
|
|
+ public function listHmacKeys(array $args = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -880,18 +880,18 @@ class StorageClientStub extends StorageClient
|
|
|
{
|
|
|
private $_config = null;
|
|
|
private $_connection = null;
|
|
|
- private static $_buckets = array();
|
|
|
+ private static $_buckets = [];
|
|
|
|
|
|
- public function __construct(array $config = array())
|
|
|
+ public function __construct(array $config = [])
|
|
|
{
|
|
|
$this->_config = $config;
|
|
|
$this->_connection = new ConnectionInterfaceStub();
|
|
|
}
|
|
|
|
|
|
- public function bucket($name, $userProject = false, array $config = array())
|
|
|
+ public function bucket($name, $userProject = false, array $config = [])
|
|
|
{
|
|
|
if (!array_key_exists($name, self::$_buckets)) {
|
|
|
- self::$_buckets[$name] = new BucketStub($this->_connection, $name, array(), $this);
|
|
|
+ self::$_buckets[$name] = new BucketStub($this->_connection, $name, [], $this);
|
|
|
}
|
|
|
return self::$_buckets[$name];
|
|
|
}
|
|
|
@@ -908,7 +908,7 @@ class StorageClientStub extends StorageClient
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function buckets(array $options = array())
|
|
|
+ public function buckets(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -923,7 +923,7 @@ class StorageClientStub extends StorageClient
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function signedUrlUploader($uri, $data, array $options = array())
|
|
|
+ public function signedUrlUploader($uri, $data, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
@@ -933,32 +933,32 @@ class StorageClientStub extends StorageClient
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function getServiceAccount(array $options = array())
|
|
|
+ public function getServiceAccount(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function hmacKeys(array $options = array())
|
|
|
+ public function hmacKeys(array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function hmacKey($accessId, $projectId = null, array $metadata = array())
|
|
|
+ public function hmacKey($accessId, $projectId = null, array $metadata = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function createHmacKey($serviceAccountEmail, array $options = array())
|
|
|
+ public function createHmacKey($serviceAccountEmail, array $options = [])
|
|
|
{
|
|
|
throw new BadMethodCallException('not supported by this stub');
|
|
|
}
|
|
|
|
|
|
- public function createBucket($name, array $options = array())
|
|
|
+ public function createBucket($name, array $options = [])
|
|
|
{
|
|
|
if (array_key_exists($name, self::$_buckets)) {
|
|
|
throw new BadRequestException('already exists');
|
|
|
}
|
|
|
- $b = new BucketStub($this->_connection, $name, array(), $this);
|
|
|
+ $b = new BucketStub($this->_connection, $name, [], $this);
|
|
|
self::$_buckets[$name] = $b;
|
|
|
return $b;
|
|
|
}
|