mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Run PHP-CS-FIXER to make sure
code is consisted with PSR-1 + PSR-2
This commit is contained in:
+17
-13
@@ -7,60 +7,64 @@ use Exception;
|
||||
class Storage
|
||||
{
|
||||
/**
|
||||
* Devices
|
||||
* Devices.
|
||||
*
|
||||
* List of all available storage devices
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
static $devices = array();
|
||||
public static $devices = array();
|
||||
|
||||
/**
|
||||
* Add Device
|
||||
* Add Device.
|
||||
*
|
||||
* Add device by name
|
||||
*
|
||||
* @param string $name
|
||||
* @param Device $device
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
static public function addDevice($name, Device $device)
|
||||
public static function addDevice($name, Device $device)
|
||||
{
|
||||
if(array_key_exists($name, self::$devices)) {
|
||||
throw new Exception('The device "' . $name . '" is already listed');
|
||||
if (array_key_exists($name, self::$devices)) {
|
||||
throw new Exception('The device "'.$name.'" is already listed');
|
||||
}
|
||||
|
||||
self::$devices[$name] = $device;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Device
|
||||
* Get Device.
|
||||
*
|
||||
* Get device by name
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return Device
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
static public function getDevice($name)
|
||||
public static function getDevice($name)
|
||||
{
|
||||
if(!array_key_exists($name, self::$devices)) {
|
||||
throw new Exception('The device "' . $name . '" is not listed');
|
||||
if (!array_key_exists($name, self::$devices)) {
|
||||
throw new Exception('The device "'.$name.'" is not listed');
|
||||
}
|
||||
|
||||
return self::$devices[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Exists
|
||||
* Exists.
|
||||
*
|
||||
* Checks if given storage name is registered or not
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static public function exists($name)
|
||||
public static function exists($name)
|
||||
{
|
||||
return (bool)array_key_exists($name, self::$devices);
|
||||
return (bool) array_key_exists($name, self::$devices);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user