@@ -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 | } |
@@ -41,6 +41,6 @@ |
||
41 | 41 | * @return string |
42 | 42 | */ |
43 | 43 | public function getResourcePath() { |
44 | - return $this->webPath . '/' . $this->resource; |
|
44 | + return $this->webPath.'/'.$this->resource; |
|
45 | 45 | } |
46 | 46 | } |
@@ -26,14 +26,14 @@ |
||
26 | 26 | use OCP\AutoloadNotAllowedException; |
27 | 27 | |
28 | 28 | class RegularJob extends \OC\BackgroundJob\Job { |
29 | - public function run($argument) { |
|
30 | - try { |
|
31 | - if (is_callable($argument)) { |
|
32 | - call_user_func($argument); |
|
33 | - } |
|
34 | - } catch (AutoloadNotAllowedException $e) { |
|
35 | - // job is from a disabled app, ignore |
|
36 | - return null; |
|
37 | - } |
|
38 | - } |
|
29 | + public function run($argument) { |
|
30 | + try { |
|
31 | + if (is_callable($argument)) { |
|
32 | + call_user_func($argument); |
|
33 | + } |
|
34 | + } catch (AutoloadNotAllowedException $e) { |
|
35 | + // job is from a disabled app, ignore |
|
36 | + return null; |
|
37 | + } |
|
38 | + } |
|
39 | 39 | } |
@@ -26,67 +26,67 @@ |
||
26 | 26 | use OCP\Settings\IIconSection; |
27 | 27 | |
28 | 28 | class Section implements IIconSection { |
29 | - /** @var string */ |
|
30 | - private $id; |
|
31 | - /** @var string */ |
|
32 | - private $name; |
|
33 | - /** @var int */ |
|
34 | - private $priority; |
|
35 | - /** @var string */ |
|
36 | - private $icon; |
|
29 | + /** @var string */ |
|
30 | + private $id; |
|
31 | + /** @var string */ |
|
32 | + private $name; |
|
33 | + /** @var int */ |
|
34 | + private $priority; |
|
35 | + /** @var string */ |
|
36 | + private $icon; |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param string $id |
|
40 | - * @param string $name |
|
41 | - * @param int $priority |
|
42 | - * @param string $icon |
|
43 | - */ |
|
44 | - public function __construct($id, $name, $priority, $icon = '') { |
|
45 | - $this->id = $id; |
|
46 | - $this->name = $name; |
|
47 | - $this->priority = $priority; |
|
48 | - $this->icon = $icon; |
|
49 | - } |
|
38 | + /** |
|
39 | + * @param string $id |
|
40 | + * @param string $name |
|
41 | + * @param int $priority |
|
42 | + * @param string $icon |
|
43 | + */ |
|
44 | + public function __construct($id, $name, $priority, $icon = '') { |
|
45 | + $this->id = $id; |
|
46 | + $this->name = $name; |
|
47 | + $this->priority = $priority; |
|
48 | + $this->icon = $icon; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * returns the ID of the section. It is supposed to be a lower case string, |
|
53 | - * e.g. 'ldap' |
|
54 | - * |
|
55 | - * @returns string |
|
56 | - */ |
|
57 | - public function getID() { |
|
58 | - return $this->id; |
|
59 | - } |
|
51 | + /** |
|
52 | + * returns the ID of the section. It is supposed to be a lower case string, |
|
53 | + * e.g. 'ldap' |
|
54 | + * |
|
55 | + * @returns string |
|
56 | + */ |
|
57 | + public function getID() { |
|
58 | + return $this->id; |
|
59 | + } |
|
60 | 60 | |
61 | - /** |
|
62 | - * returns the translated name as it should be displayed, e.g. 'LDAP / AD |
|
63 | - * integration'. Use the L10N service to translate it. |
|
64 | - * |
|
65 | - * @return string |
|
66 | - */ |
|
67 | - public function getName() { |
|
68 | - return $this->name; |
|
69 | - } |
|
61 | + /** |
|
62 | + * returns the translated name as it should be displayed, e.g. 'LDAP / AD |
|
63 | + * integration'. Use the L10N service to translate it. |
|
64 | + * |
|
65 | + * @return string |
|
66 | + */ |
|
67 | + public function getName() { |
|
68 | + return $this->name; |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * @return int whether the form should be rather on the top or bottom of |
|
73 | - * the settings navigation. The sections are arranged in ascending order of |
|
74 | - * the priority values. It is required to return a value between 0 and 99. |
|
75 | - * |
|
76 | - * E.g.: 70 |
|
77 | - */ |
|
78 | - public function getPriority() { |
|
79 | - return $this->priority; |
|
80 | - } |
|
71 | + /** |
|
72 | + * @return int whether the form should be rather on the top or bottom of |
|
73 | + * the settings navigation. The sections are arranged in ascending order of |
|
74 | + * the priority values. It is required to return a value between 0 and 99. |
|
75 | + * |
|
76 | + * E.g.: 70 |
|
77 | + */ |
|
78 | + public function getPriority() { |
|
79 | + return $this->priority; |
|
80 | + } |
|
81 | 81 | |
82 | - /** |
|
83 | - * returns the relative path to an 16*16 icon describing the section. |
|
84 | - * e.g. '/core/img/places/files.svg' |
|
85 | - * |
|
86 | - * @returns string |
|
87 | - * @since 12 |
|
88 | - */ |
|
89 | - public function getIcon() { |
|
90 | - return $this->icon; |
|
91 | - } |
|
82 | + /** |
|
83 | + * returns the relative path to an 16*16 icon describing the section. |
|
84 | + * e.g. '/core/img/places/files.svg' |
|
85 | + * |
|
86 | + * @returns string |
|
87 | + * @since 12 |
|
88 | + */ |
|
89 | + public function getIcon() { |
|
90 | + return $this->icon; |
|
91 | + } |
|
92 | 92 | } |
@@ -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 | } |
@@ -41,13 +41,13 @@ |
||
41 | 41 | */ |
42 | 42 | public function cas($key, $old, $new) { |
43 | 43 | //no native cas, emulate with locking |
44 | - if ($this->add($key . '_lock', true)) { |
|
44 | + if ($this->add($key.'_lock', true)) { |
|
45 | 45 | if ($this->get($key) === $old) { |
46 | 46 | $this->set($key, $new); |
47 | - $this->remove($key . '_lock'); |
|
47 | + $this->remove($key.'_lock'); |
|
48 | 48 | return true; |
49 | 49 | } else { |
50 | - $this->remove($key . '_lock'); |
|
50 | + $this->remove($key.'_lock'); |
|
51 | 51 | return false; |
52 | 52 | } |
53 | 53 | } else { |
@@ -26,72 +26,72 @@ |
||
26 | 26 | namespace OC\Memcache; |
27 | 27 | |
28 | 28 | abstract class Cache implements \ArrayAccess, \OCP\ICache { |
29 | - /** |
|
30 | - * @var string $prefix |
|
31 | - */ |
|
32 | - protected $prefix; |
|
29 | + /** |
|
30 | + * @var string $prefix |
|
31 | + */ |
|
32 | + protected $prefix; |
|
33 | 33 | |
34 | - /** |
|
35 | - * @param string $prefix |
|
36 | - */ |
|
37 | - public function __construct($prefix = '') { |
|
38 | - $this->prefix = $prefix; |
|
39 | - } |
|
34 | + /** |
|
35 | + * @param string $prefix |
|
36 | + */ |
|
37 | + public function __construct($prefix = '') { |
|
38 | + $this->prefix = $prefix; |
|
39 | + } |
|
40 | 40 | |
41 | - /** |
|
42 | - * @return string Prefix used for caching purposes |
|
43 | - */ |
|
44 | - public function getPrefix() { |
|
45 | - return $this->prefix; |
|
46 | - } |
|
41 | + /** |
|
42 | + * @return string Prefix used for caching purposes |
|
43 | + */ |
|
44 | + public function getPrefix() { |
|
45 | + return $this->prefix; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * @param string $key |
|
50 | - * @return mixed |
|
51 | - */ |
|
52 | - abstract public function get($key); |
|
48 | + /** |
|
49 | + * @param string $key |
|
50 | + * @return mixed |
|
51 | + */ |
|
52 | + abstract public function get($key); |
|
53 | 53 | |
54 | - /** |
|
55 | - * @param string $key |
|
56 | - * @param mixed $value |
|
57 | - * @param int $ttl |
|
58 | - * @return mixed |
|
59 | - */ |
|
60 | - abstract public function set($key, $value, $ttl = 0); |
|
54 | + /** |
|
55 | + * @param string $key |
|
56 | + * @param mixed $value |
|
57 | + * @param int $ttl |
|
58 | + * @return mixed |
|
59 | + */ |
|
60 | + abstract public function set($key, $value, $ttl = 0); |
|
61 | 61 | |
62 | - /** |
|
63 | - * @param string $key |
|
64 | - * @return mixed |
|
65 | - */ |
|
66 | - abstract public function hasKey($key); |
|
62 | + /** |
|
63 | + * @param string $key |
|
64 | + * @return mixed |
|
65 | + */ |
|
66 | + abstract public function hasKey($key); |
|
67 | 67 | |
68 | - /** |
|
69 | - * @param string $key |
|
70 | - * @return mixed |
|
71 | - */ |
|
72 | - abstract public function remove($key); |
|
68 | + /** |
|
69 | + * @param string $key |
|
70 | + * @return mixed |
|
71 | + */ |
|
72 | + abstract public function remove($key); |
|
73 | 73 | |
74 | - /** |
|
75 | - * @param string $prefix |
|
76 | - * @return mixed |
|
77 | - */ |
|
78 | - abstract public function clear($prefix = ''); |
|
74 | + /** |
|
75 | + * @param string $prefix |
|
76 | + * @return mixed |
|
77 | + */ |
|
78 | + abstract public function clear($prefix = ''); |
|
79 | 79 | |
80 | - //implement the ArrayAccess interface |
|
80 | + //implement the ArrayAccess interface |
|
81 | 81 | |
82 | - public function offsetExists($offset) { |
|
83 | - return $this->hasKey($offset); |
|
84 | - } |
|
82 | + public function offsetExists($offset) { |
|
83 | + return $this->hasKey($offset); |
|
84 | + } |
|
85 | 85 | |
86 | - public function offsetSet($offset, $value) { |
|
87 | - $this->set($offset, $value); |
|
88 | - } |
|
86 | + public function offsetSet($offset, $value) { |
|
87 | + $this->set($offset, $value); |
|
88 | + } |
|
89 | 89 | |
90 | - public function offsetGet($offset) { |
|
91 | - return $this->get($offset); |
|
92 | - } |
|
90 | + public function offsetGet($offset) { |
|
91 | + return $this->get($offset); |
|
92 | + } |
|
93 | 93 | |
94 | - public function offsetUnset($offset) { |
|
95 | - $this->remove($offset); |
|
96 | - } |
|
94 | + public function offsetUnset($offset) { |
|
95 | + $this->remove($offset); |
|
96 | + } |
|
97 | 97 | } |
@@ -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 | } |
@@ -38,13 +38,13 @@ |
||
38 | 38 | */ |
39 | 39 | public function cad($key, $old) { |
40 | 40 | //no native cas, emulate with locking |
41 | - if ($this->add($key . '_lock', true)) { |
|
41 | + if ($this->add($key.'_lock', true)) { |
|
42 | 42 | if ($this->get($key) === $old) { |
43 | 43 | $this->remove($key); |
44 | - $this->remove($key . '_lock'); |
|
44 | + $this->remove($key.'_lock'); |
|
45 | 45 | return true; |
46 | 46 | } else { |
47 | - $this->remove($key . '_lock'); |
|
47 | + $this->remove($key.'_lock'); |
|
48 | 48 | return false; |
49 | 49 | } |
50 | 50 | } else { |
@@ -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 | } |