@@ -28,45 +28,45 @@ |
||
28 | 28 | |
29 | 29 | class Credentials implements ICredentials { |
30 | 30 | |
31 | - /** @var string */ |
|
32 | - private $uid; |
|
31 | + /** @var string */ |
|
32 | + private $uid; |
|
33 | 33 | |
34 | - /** @var string */ |
|
35 | - private $loginName; |
|
34 | + /** @var string */ |
|
35 | + private $loginName; |
|
36 | 36 | |
37 | - /** @var string */ |
|
38 | - private $password; |
|
37 | + /** @var string */ |
|
38 | + private $password; |
|
39 | 39 | |
40 | - /** |
|
41 | - * @param string $uid |
|
42 | - * @param string $loginName |
|
43 | - * @param string $password |
|
44 | - */ |
|
45 | - public function __construct($uid, $loginName, $password) { |
|
46 | - $this->uid = $uid; |
|
47 | - $this->loginName = $loginName; |
|
48 | - $this->password = $password; |
|
49 | - } |
|
40 | + /** |
|
41 | + * @param string $uid |
|
42 | + * @param string $loginName |
|
43 | + * @param string $password |
|
44 | + */ |
|
45 | + public function __construct($uid, $loginName, $password) { |
|
46 | + $this->uid = $uid; |
|
47 | + $this->loginName = $loginName; |
|
48 | + $this->password = $password; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * @return string |
|
53 | - */ |
|
54 | - public function getUID() { |
|
55 | - return $this->uid; |
|
56 | - } |
|
51 | + /** |
|
52 | + * @return string |
|
53 | + */ |
|
54 | + public function getUID() { |
|
55 | + return $this->uid; |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * @return string |
|
60 | - */ |
|
61 | - public function getLoginName() { |
|
62 | - return $this->loginName; |
|
63 | - } |
|
58 | + /** |
|
59 | + * @return string |
|
60 | + */ |
|
61 | + public function getLoginName() { |
|
62 | + return $this->loginName; |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * @return string |
|
67 | - */ |
|
68 | - public function getPassword() { |
|
69 | - return $this->password; |
|
70 | - } |
|
65 | + /** |
|
66 | + * @return string |
|
67 | + */ |
|
68 | + public function getPassword() { |
|
69 | + return $this->password; |
|
70 | + } |
|
71 | 71 | |
72 | 72 | } |
@@ -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 | } |
@@ -25,12 +25,12 @@ |
||
25 | 25 | use OC\BackgroundJob\QueuedJob; |
26 | 26 | |
27 | 27 | class CallableJob extends QueuedJob { |
28 | - protected function run($serializedCallable) { |
|
29 | - $callable = unserialize($serializedCallable); |
|
30 | - if (is_callable($callable)) { |
|
31 | - $callable(); |
|
32 | - } else { |
|
33 | - throw new \InvalidArgumentException('Invalid serialized callable'); |
|
34 | - } |
|
35 | - } |
|
28 | + protected function run($serializedCallable) { |
|
29 | + $callable = unserialize($serializedCallable); |
|
30 | + if (is_callable($callable)) { |
|
31 | + $callable(); |
|
32 | + } else { |
|
33 | + throw new \InvalidArgumentException('Invalid serialized callable'); |
|
34 | + } |
|
35 | + } |
|
36 | 36 | } |
@@ -24,23 +24,23 @@ |
||
24 | 24 | namespace OC\Template; |
25 | 25 | |
26 | 26 | class ResourceNotFoundException extends \LogicException { |
27 | - protected $resource; |
|
28 | - protected $webPath; |
|
27 | + protected $resource; |
|
28 | + protected $webPath; |
|
29 | 29 | |
30 | - /** |
|
31 | - * @param string $resource |
|
32 | - * @param string $webPath |
|
33 | - */ |
|
34 | - public function __construct($resource, $webPath) { |
|
35 | - parent::__construct('Resource not found'); |
|
36 | - $this->resource = $resource; |
|
37 | - $this->webPath = $webPath; |
|
38 | - } |
|
30 | + /** |
|
31 | + * @param string $resource |
|
32 | + * @param string $webPath |
|
33 | + */ |
|
34 | + public function __construct($resource, $webPath) { |
|
35 | + parent::__construct('Resource not found'); |
|
36 | + $this->resource = $resource; |
|
37 | + $this->webPath = $webPath; |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public function getResourcePath() { |
|
44 | - return $this->webPath . '/' . $this->resource; |
|
45 | - } |
|
40 | + /** |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public function getResourcePath() { |
|
44 | + return $this->webPath . '/' . $this->resource; |
|
45 | + } |
|
46 | 46 | } |
@@ -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 | } |
@@ -23,32 +23,32 @@ |
||
23 | 23 | namespace OC\Memcache; |
24 | 24 | |
25 | 25 | trait CADTrait { |
26 | - abstract public function get($key); |
|
26 | + abstract public function get($key); |
|
27 | 27 | |
28 | - abstract public function remove($key); |
|
28 | + abstract public function remove($key); |
|
29 | 29 | |
30 | - abstract public function add($key, $value, $ttl = 0); |
|
30 | + abstract public function add($key, $value, $ttl = 0); |
|
31 | 31 | |
32 | - /** |
|
33 | - * Compare and delete |
|
34 | - * |
|
35 | - * @param string $key |
|
36 | - * @param mixed $old |
|
37 | - * @return bool |
|
38 | - */ |
|
39 | - public function cad($key, $old) { |
|
40 | - //no native cas, emulate with locking |
|
41 | - if ($this->add($key . '_lock', true)) { |
|
42 | - if ($this->get($key) === $old) { |
|
43 | - $this->remove($key); |
|
44 | - $this->remove($key . '_lock'); |
|
45 | - return true; |
|
46 | - } else { |
|
47 | - $this->remove($key . '_lock'); |
|
48 | - return false; |
|
49 | - } |
|
50 | - } else { |
|
51 | - return false; |
|
52 | - } |
|
53 | - } |
|
32 | + /** |
|
33 | + * Compare and delete |
|
34 | + * |
|
35 | + * @param string $key |
|
36 | + * @param mixed $old |
|
37 | + * @return bool |
|
38 | + */ |
|
39 | + public function cad($key, $old) { |
|
40 | + //no native cas, emulate with locking |
|
41 | + if ($this->add($key . '_lock', true)) { |
|
42 | + if ($this->get($key) === $old) { |
|
43 | + $this->remove($key); |
|
44 | + $this->remove($key . '_lock'); |
|
45 | + return true; |
|
46 | + } else { |
|
47 | + $this->remove($key . '_lock'); |
|
48 | + return false; |
|
49 | + } |
|
50 | + } else { |
|
51 | + return false; |
|
52 | + } |
|
53 | + } |
|
54 | 54 | } |
@@ -33,27 +33,27 @@ |
||
33 | 33 | */ |
34 | 34 | class CoreCapabilities implements ICapability { |
35 | 35 | |
36 | - /** @var IConfig */ |
|
37 | - private $config; |
|
36 | + /** @var IConfig */ |
|
37 | + private $config; |
|
38 | 38 | |
39 | - /** |
|
40 | - * @param IConfig $config |
|
41 | - */ |
|
42 | - public function __construct(IConfig $config) { |
|
43 | - $this->config = $config; |
|
44 | - } |
|
39 | + /** |
|
40 | + * @param IConfig $config |
|
41 | + */ |
|
42 | + public function __construct(IConfig $config) { |
|
43 | + $this->config = $config; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Return this classes capabilities |
|
48 | - * |
|
49 | - * @return array |
|
50 | - */ |
|
51 | - public function getCapabilities() { |
|
52 | - return [ |
|
53 | - 'core' => [ |
|
54 | - 'pollinterval' => $this->config->getSystemValue('pollinterval', 60), |
|
55 | - 'webdav-root' => $this->config->getSystemValue('webdav-root', 'remote.php/webdav'), |
|
56 | - ] |
|
57 | - ]; |
|
58 | - } |
|
46 | + /** |
|
47 | + * Return this classes capabilities |
|
48 | + * |
|
49 | + * @return array |
|
50 | + */ |
|
51 | + public function getCapabilities() { |
|
52 | + return [ |
|
53 | + 'core' => [ |
|
54 | + 'pollinterval' => $this->config->getSystemValue('pollinterval', 60), |
|
55 | + 'webdav-root' => $this->config->getSystemValue('webdav-root', 'remote.php/webdav'), |
|
56 | + ] |
|
57 | + ]; |
|
58 | + } |
|
59 | 59 | } |
@@ -27,19 +27,19 @@ |
||
27 | 27 | * Defines the mount point to be (re)moved by the user |
28 | 28 | */ |
29 | 29 | interface MoveableMount { |
30 | - /** |
|
31 | - * Move the mount point to $target |
|
32 | - * |
|
33 | - * @param string $target the target mount point |
|
34 | - * @return bool |
|
35 | - */ |
|
36 | - public function moveMount($target); |
|
30 | + /** |
|
31 | + * Move the mount point to $target |
|
32 | + * |
|
33 | + * @param string $target the target mount point |
|
34 | + * @return bool |
|
35 | + */ |
|
36 | + public function moveMount($target); |
|
37 | 37 | |
38 | - /** |
|
39 | - * Remove the mount points |
|
40 | - * |
|
41 | - * @return mixed |
|
42 | - * @return bool |
|
43 | - */ |
|
44 | - public function removeMount(); |
|
38 | + /** |
|
39 | + * Remove the mount points |
|
40 | + * |
|
41 | + * @return mixed |
|
42 | + * @return bool |
|
43 | + */ |
|
44 | + public function removeMount(); |
|
45 | 45 | } |
@@ -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 | } |