Run PHP-CS-FIXER to make sure

code is consisted with PSR-1 + PSR-2
This commit is contained in:
eldadfux
2019-09-06 20:04:26 +03:00
parent c9d3448571
commit 35680bbae9
37 changed files with 928 additions and 753 deletions
+17 -13
View File
@@ -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);
}
}