Passed
Push — master ( a8aeaa...bf4c0c )
by Daniel
26:56 queued 11s
created
lib/private/Memcache/CASTrait.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -23,35 +23,35 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/private/Memcache/Cache.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -26,72 +26,72 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/private/Memcache/CADTrait.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -23,32 +23,32 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/private/OCS/CoreCapabilities.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -33,27 +33,27 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/private/Files/Mount/MoveableMount.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -27,19 +27,19 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/private/Files/Config/LazyStorageMountInfo.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -29,60 +29,60 @@
 block discarded – undo
29 29
 use OCP\IUser;
30 30
 
31 31
 class LazyStorageMountInfo extends CachedMountInfo {
32
-	/** @var IMountPoint */
33
-	private $mount;
32
+    /** @var IMountPoint */
33
+    private $mount;
34 34
 
35
-	/**
36
-	 * CachedMountInfo constructor.
37
-	 *
38
-	 * @param IUser $user
39
-	 * @param IMountPoint $mount
40
-	 */
41
-	public function __construct(IUser $user, IMountPoint $mount) {
42
-		$this->user = $user;
43
-		$this->mount = $mount;
44
-	}
35
+    /**
36
+     * CachedMountInfo constructor.
37
+     *
38
+     * @param IUser $user
39
+     * @param IMountPoint $mount
40
+     */
41
+    public function __construct(IUser $user, IMountPoint $mount) {
42
+        $this->user = $user;
43
+        $this->mount = $mount;
44
+    }
45 45
 
46
-	/**
47
-	 * @return int the numeric storage id of the mount
48
-	 */
49
-	public function getStorageId() {
50
-		if (!$this->storageId) {
51
-			$this->storageId = $this->mount->getNumericStorageId();
52
-		}
53
-		return parent::getStorageId();
54
-	}
46
+    /**
47
+     * @return int the numeric storage id of the mount
48
+     */
49
+    public function getStorageId() {
50
+        if (!$this->storageId) {
51
+            $this->storageId = $this->mount->getNumericStorageId();
52
+        }
53
+        return parent::getStorageId();
54
+    }
55 55
 
56
-	/**
57
-	 * @return int the fileid of the root of the mount
58
-	 */
59
-	public function getRootId() {
60
-		if (!$this->rootId) {
61
-			$this->rootId = $this->mount->getStorageRootId();
62
-		}
63
-		return parent::getRootId();
64
-	}
56
+    /**
57
+     * @return int the fileid of the root of the mount
58
+     */
59
+    public function getRootId() {
60
+        if (!$this->rootId) {
61
+            $this->rootId = $this->mount->getStorageRootId();
62
+        }
63
+        return parent::getRootId();
64
+    }
65 65
 
66
-	/**
67
-	 * @return string the mount point of the mount for the user
68
-	 */
69
-	public function getMountPoint() {
70
-		if (!$this->mountPoint) {
71
-			$this->mountPoint = $this->mount->getMountPoint();
72
-		}
73
-		return parent::getMountPoint();
74
-	}
66
+    /**
67
+     * @return string the mount point of the mount for the user
68
+     */
69
+    public function getMountPoint() {
70
+        if (!$this->mountPoint) {
71
+            $this->mountPoint = $this->mount->getMountPoint();
72
+        }
73
+        return parent::getMountPoint();
74
+    }
75 75
 
76
-	public function getMountId() {
77
-		return $this->mount->getMountId();
78
-	}
76
+    public function getMountId() {
77
+        return $this->mount->getMountId();
78
+    }
79 79
 
80
-	/**
81
-	 * Get the internal path (within the storage) of the root of the mount
82
-	 *
83
-	 * @return string
84
-	 */
85
-	public function getRootInternalPath() {
86
-		return $this->mount->getInternalPath($this->mount->getMountPoint());
87
-	}
80
+    /**
81
+     * Get the internal path (within the storage) of the root of the mount
82
+     *
83
+     * @return string
84
+     */
85
+    public function getRootInternalPath() {
86
+        return $this->mount->getInternalPath($this->mount->getMountPoint());
87
+    }
88 88
 }
Please login to merge, or discard this patch.
lib/private/Files/Config/UserMountCacheListener.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,21 +29,21 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/private/Files/ObjectStore/Mapper.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -31,25 +31,25 @@
 block discarded – undo
31 31
  * Map a user to a bucket.
32 32
  */
33 33
 class Mapper {
34
-	/** @var IUser */
35
-	private $user;
34
+    /** @var IUser */
35
+    private $user;
36 36
 
37
-	/**
38
-	 * Mapper constructor.
39
-	 *
40
-	 * @param IUser $user
41
-	 */
42
-	public function __construct(IUser $user) {
43
-		$this->user = $user;
44
-	}
37
+    /**
38
+     * Mapper constructor.
39
+     *
40
+     * @param IUser $user
41
+     */
42
+    public function __construct(IUser $user) {
43
+        $this->user = $user;
44
+    }
45 45
 
46
-	/**
47
-	 * @param int $numBuckets
48
-	 * @return string
49
-	 */
50
-	public function getBucket($numBuckets = 64) {
51
-		$hash = md5($this->user->getUID());
52
-		$num = hexdec(substr($hash, 0, 4));
53
-		return (string)($num % $numBuckets);
54
-	}
46
+    /**
47
+     * @param int $numBuckets
48
+     * @return string
49
+     */
50
+    public function getBucket($numBuckets = 64) {
51
+        $hash = md5($this->user->getUID());
52
+        $num = hexdec(substr($hash, 0, 4));
53
+        return (string)($num % $numBuckets);
54
+    }
55 55
 }
Please login to merge, or discard this patch.
lib/private/Files/Storage/LocalTempFileTrait.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -37,45 +37,45 @@
 block discarded – undo
37 37
  */
38 38
 trait LocalTempFileTrait {
39 39
 
40
-	/** @var string[] */
41
-	protected $cachedFiles = [];
40
+    /** @var string[] */
41
+    protected $cachedFiles = [];
42 42
 
43
-	/**
44
-	 * @param string $path
45
-	 * @return string
46
-	 */
47
-	protected function getCachedFile($path) {
48
-		if (!isset($this->cachedFiles[$path])) {
49
-			$this->cachedFiles[$path] = $this->toTmpFile($path);
50
-		}
51
-		return $this->cachedFiles[$path];
52
-	}
43
+    /**
44
+     * @param string $path
45
+     * @return string
46
+     */
47
+    protected function getCachedFile($path) {
48
+        if (!isset($this->cachedFiles[$path])) {
49
+            $this->cachedFiles[$path] = $this->toTmpFile($path);
50
+        }
51
+        return $this->cachedFiles[$path];
52
+    }
53 53
 
54
-	/**
55
-	 * @param string $path
56
-	 */
57
-	protected function removeCachedFile($path) {
58
-		unset($this->cachedFiles[$path]);
59
-	}
54
+    /**
55
+     * @param string $path
56
+     */
57
+    protected function removeCachedFile($path) {
58
+        unset($this->cachedFiles[$path]);
59
+    }
60 60
 
61
-	/**
62
-	 * @param string $path
63
-	 * @return string
64
-	 */
65
-	protected function toTmpFile($path) { //no longer in the storage api, still useful here
66
-		$source = $this->fopen($path, 'r');
67
-		if (!$source) {
68
-			return false;
69
-		}
70
-		if ($pos = strrpos($path, '.')) {
71
-			$extension = substr($path, $pos);
72
-		} else {
73
-			$extension = '';
74
-		}
75
-		$tmpFile = \OC::$server->getTempManager()->getTemporaryFile($extension);
76
-		$target = fopen($tmpFile, 'w');
77
-		\OC_Helper::streamCopy($source, $target);
78
-		fclose($target);
79
-		return $tmpFile;
80
-	}
61
+    /**
62
+     * @param string $path
63
+     * @return string
64
+     */
65
+    protected function toTmpFile($path) { //no longer in the storage api, still useful here
66
+        $source = $this->fopen($path, 'r');
67
+        if (!$source) {
68
+            return false;
69
+        }
70
+        if ($pos = strrpos($path, '.')) {
71
+            $extension = substr($path, $pos);
72
+        } else {
73
+            $extension = '';
74
+        }
75
+        $tmpFile = \OC::$server->getTempManager()->getTemporaryFile($extension);
76
+        $target = fopen($tmpFile, 'w');
77
+        \OC_Helper::streamCopy($source, $target);
78
+        fclose($target);
79
+        return $tmpFile;
80
+    }
81 81
 }
Please login to merge, or discard this patch.