@@ -26,9 +26,9 @@ |
||
| 26 | 26 | * @since 8.2.0 |
| 27 | 27 | */ |
| 28 | 28 | interface ILiteral { |
| 29 | - /** |
|
| 30 | - * @return string |
|
| 31 | - * @since 8.2.0 |
|
| 32 | - */ |
|
| 33 | - public function __toString(); |
|
| 29 | + /** |
|
| 30 | + * @return string |
|
| 31 | + * @since 8.2.0 |
|
| 32 | + */ |
|
| 33 | + public function __toString(); |
|
| 34 | 34 | } |
@@ -26,9 +26,9 @@ |
||
| 26 | 26 | * @since 8.2.0 |
| 27 | 27 | */ |
| 28 | 28 | interface IParameter { |
| 29 | - /** |
|
| 30 | - * @return string |
|
| 31 | - * @since 8.2.0 |
|
| 32 | - */ |
|
| 33 | - public function __toString(); |
|
| 29 | + /** |
|
| 30 | + * @return string |
|
| 31 | + * @since 8.2.0 |
|
| 32 | + */ |
|
| 33 | + public function __toString(); |
|
| 34 | 34 | } |
@@ -25,14 +25,14 @@ |
||
| 25 | 25 | namespace OC; |
| 26 | 26 | |
| 27 | 27 | class NaturalSort_DefaultCollator { |
| 28 | - public function compare($a, $b) { |
|
| 29 | - $result = strcasecmp($a, $b); |
|
| 30 | - if ($result === 0) { |
|
| 31 | - if ($a === $b) { |
|
| 32 | - return 0; |
|
| 33 | - } |
|
| 34 | - return ($a > $b) ? -1 : 1; |
|
| 35 | - } |
|
| 36 | - return ($result < 0) ? -1 : 1; |
|
| 37 | - } |
|
| 28 | + public function compare($a, $b) { |
|
| 29 | + $result = strcasecmp($a, $b); |
|
| 30 | + if ($result === 0) { |
|
| 31 | + if ($a === $b) { |
|
| 32 | + return 0; |
|
| 33 | + } |
|
| 34 | + return ($a > $b) ? -1 : 1; |
|
| 35 | + } |
|
| 36 | + return ($result < 0) ? -1 : 1; |
|
| 37 | + } |
|
| 38 | 38 | } |
@@ -23,35 +23,35 @@ |
||
| 23 | 23 | namespace OC\Memcache; |
| 24 | 24 | |
| 25 | 25 | trait CASTrait { |
| 26 | - abstract public function get($key); |
|
| 26 | + abstract public function get($key); |
|
| 27 | 27 | |
| 28 | - abstract public function set($key, $value, $ttl = 0); |
|
| 28 | + abstract public function set($key, $value, $ttl = 0); |
|
| 29 | 29 | |
| 30 | - abstract public function remove($key); |
|
| 30 | + abstract public function remove($key); |
|
| 31 | 31 | |
| 32 | - abstract public function add($key, $value, $ttl = 0); |
|
| 32 | + abstract public function add($key, $value, $ttl = 0); |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Compare and set |
|
| 36 | - * |
|
| 37 | - * @param string $key |
|
| 38 | - * @param mixed $old |
|
| 39 | - * @param mixed $new |
|
| 40 | - * @return bool |
|
| 41 | - */ |
|
| 42 | - public function cas($key, $old, $new) { |
|
| 43 | - //no native cas, emulate with locking |
|
| 44 | - if ($this->add($key . '_lock', true)) { |
|
| 45 | - if ($this->get($key) === $old) { |
|
| 46 | - $this->set($key, $new); |
|
| 47 | - $this->remove($key . '_lock'); |
|
| 48 | - return true; |
|
| 49 | - } else { |
|
| 50 | - $this->remove($key . '_lock'); |
|
| 51 | - return false; |
|
| 52 | - } |
|
| 53 | - } else { |
|
| 54 | - return false; |
|
| 55 | - } |
|
| 56 | - } |
|
| 34 | + /** |
|
| 35 | + * Compare and set |
|
| 36 | + * |
|
| 37 | + * @param string $key |
|
| 38 | + * @param mixed $old |
|
| 39 | + * @param mixed $new |
|
| 40 | + * @return bool |
|
| 41 | + */ |
|
| 42 | + public function cas($key, $old, $new) { |
|
| 43 | + //no native cas, emulate with locking |
|
| 44 | + if ($this->add($key . '_lock', true)) { |
|
| 45 | + if ($this->get($key) === $old) { |
|
| 46 | + $this->set($key, $new); |
|
| 47 | + $this->remove($key . '_lock'); |
|
| 48 | + return true; |
|
| 49 | + } else { |
|
| 50 | + $this->remove($key . '_lock'); |
|
| 51 | + return false; |
|
| 52 | + } |
|
| 53 | + } else { |
|
| 54 | + return false; |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | 57 | } |
@@ -29,21 +29,21 @@ |
||
| 29 | 29 | * Listen to hooks and update the mount cache as needed |
| 30 | 30 | */ |
| 31 | 31 | class UserMountCacheListener { |
| 32 | - /** |
|
| 33 | - * @var IUserMountCache |
|
| 34 | - */ |
|
| 35 | - private $userMountCache; |
|
| 32 | + /** |
|
| 33 | + * @var IUserMountCache |
|
| 34 | + */ |
|
| 35 | + private $userMountCache; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * UserMountCacheListener constructor. |
|
| 39 | - * |
|
| 40 | - * @param IUserMountCache $userMountCache |
|
| 41 | - */ |
|
| 42 | - public function __construct(IUserMountCache $userMountCache) { |
|
| 43 | - $this->userMountCache = $userMountCache; |
|
| 44 | - } |
|
| 37 | + /** |
|
| 38 | + * UserMountCacheListener constructor. |
|
| 39 | + * |
|
| 40 | + * @param IUserMountCache $userMountCache |
|
| 41 | + */ |
|
| 42 | + public function __construct(IUserMountCache $userMountCache) { |
|
| 43 | + $this->userMountCache = $userMountCache; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - public function listen(Manager $manager) { |
|
| 47 | - $manager->listen('\OC\User', 'postDelete', [$this->userMountCache, 'removeUserMounts']); |
|
| 48 | - } |
|
| 46 | + public function listen(Manager $manager) { |
|
| 47 | + $manager->listen('\OC\User', 'postDelete', [$this->userMountCache, 'removeUserMounts']); |
|
| 48 | + } |
|
| 49 | 49 | } |
@@ -26,27 +26,27 @@ |
||
| 26 | 26 | use OCP\Files\Notify\IRenameChange; |
| 27 | 27 | |
| 28 | 28 | class RenameChange extends Change implements IRenameChange { |
| 29 | - /** @var string */ |
|
| 30 | - private $targetPath; |
|
| 29 | + /** @var string */ |
|
| 30 | + private $targetPath; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Change constructor. |
|
| 34 | - * |
|
| 35 | - * @param int $type |
|
| 36 | - * @param string $path |
|
| 37 | - * @param string $targetPath |
|
| 38 | - */ |
|
| 39 | - public function __construct($type, $path, $targetPath) { |
|
| 40 | - parent::__construct($type, $path); |
|
| 41 | - $this->targetPath = $targetPath; |
|
| 42 | - } |
|
| 32 | + /** |
|
| 33 | + * Change constructor. |
|
| 34 | + * |
|
| 35 | + * @param int $type |
|
| 36 | + * @param string $path |
|
| 37 | + * @param string $targetPath |
|
| 38 | + */ |
|
| 39 | + public function __construct($type, $path, $targetPath) { |
|
| 40 | + parent::__construct($type, $path); |
|
| 41 | + $this->targetPath = $targetPath; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * Get the new path of the renamed file relative to the storage root |
|
| 46 | - * |
|
| 47 | - * @return string |
|
| 48 | - */ |
|
| 49 | - public function getTargetPath() { |
|
| 50 | - return $this->targetPath; |
|
| 51 | - } |
|
| 44 | + /** |
|
| 45 | + * Get the new path of the renamed file relative to the storage root |
|
| 46 | + * |
|
| 47 | + * @return string |
|
| 48 | + */ |
|
| 49 | + public function getTargetPath() { |
|
| 50 | + return $this->targetPath; |
|
| 51 | + } |
|
| 52 | 52 | } |
@@ -26,40 +26,40 @@ |
||
| 26 | 26 | use OCP\Files\Notify\IChange; |
| 27 | 27 | |
| 28 | 28 | class Change implements IChange { |
| 29 | - /** @var int */ |
|
| 30 | - private $type; |
|
| 29 | + /** @var int */ |
|
| 30 | + private $type; |
|
| 31 | 31 | |
| 32 | - /** @var string */ |
|
| 33 | - private $path; |
|
| 32 | + /** @var string */ |
|
| 33 | + private $path; |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Change constructor. |
|
| 37 | - * |
|
| 38 | - * @param int $type |
|
| 39 | - * @param string $path |
|
| 40 | - */ |
|
| 41 | - public function __construct($type, $path) { |
|
| 42 | - $this->type = $type; |
|
| 43 | - $this->path = $path; |
|
| 44 | - } |
|
| 35 | + /** |
|
| 36 | + * Change constructor. |
|
| 37 | + * |
|
| 38 | + * @param int $type |
|
| 39 | + * @param string $path |
|
| 40 | + */ |
|
| 41 | + public function __construct($type, $path) { |
|
| 42 | + $this->type = $type; |
|
| 43 | + $this->path = $path; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Get the type of the change |
|
| 48 | - * |
|
| 49 | - * @return int IChange::ADDED, IChange::REMOVED, IChange::MODIFIED or IChange::RENAMED |
|
| 50 | - */ |
|
| 51 | - public function getType() { |
|
| 52 | - return $this->type; |
|
| 53 | - } |
|
| 46 | + /** |
|
| 47 | + * Get the type of the change |
|
| 48 | + * |
|
| 49 | + * @return int IChange::ADDED, IChange::REMOVED, IChange::MODIFIED or IChange::RENAMED |
|
| 50 | + */ |
|
| 51 | + public function getType() { |
|
| 52 | + return $this->type; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Get the path of the file that was changed relative to the root of the storage |
|
| 57 | - * |
|
| 58 | - * Note, for rename changes this path is the old path for the file |
|
| 59 | - * |
|
| 60 | - * @return mixed |
|
| 61 | - */ |
|
| 62 | - public function getPath() { |
|
| 63 | - return $this->path; |
|
| 64 | - } |
|
| 55 | + /** |
|
| 56 | + * Get the path of the file that was changed relative to the root of the storage |
|
| 57 | + * |
|
| 58 | + * Note, for rename changes this path is the old path for the file |
|
| 59 | + * |
|
| 60 | + * @return mixed |
|
| 61 | + */ |
|
| 62 | + public function getPath() { |
|
| 63 | + return $this->path; |
|
| 64 | + } |
|
| 65 | 65 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * @package OC\AppFramework\Middleware\Security\Exceptions |
| 35 | 35 | */ |
| 36 | 36 | class CrossSiteRequestForgeryException extends SecurityException { |
| 37 | - public function __construct() { |
|
| 38 | - parent::__construct('CSRF check failed', Http::STATUS_PRECONDITION_FAILED); |
|
| 39 | - } |
|
| 37 | + public function __construct() { |
|
| 38 | + parent::__construct('CSRF check failed', Http::STATUS_PRECONDITION_FAILED); |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * @package OC\AppFramework\Middleware\Security\Exceptions |
| 35 | 35 | */ |
| 36 | 36 | class AppNotEnabledException extends SecurityException { |
| 37 | - public function __construct() { |
|
| 38 | - parent::__construct('App is not enabled', Http::STATUS_PRECONDITION_FAILED); |
|
| 39 | - } |
|
| 37 | + public function __construct() { |
|
| 38 | + parent::__construct('App is not enabled', Http::STATUS_PRECONDITION_FAILED); |
|
| 39 | + } |
|
| 40 | 40 | } |