Passed
Push — master ( f97491...570c25 )
by Roeland
14:12 queued 10s
created
apps/dav/lib/Capabilities.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@
 block discarded – undo
25 25
 use OCP\Capabilities\ICapability;
26 26
 
27 27
 class Capabilities implements ICapability {
28
-	public function getCapabilities() {
29
-		return [
30
-			'dav' => [
31
-				'chunking' => '1.0',
32
-			]
33
-		];
34
-	}
28
+    public function getCapabilities() {
29
+        return [
30
+            'dav' => [
31
+                'chunking' => '1.0',
32
+            ]
33
+        ];
34
+    }
35 35
 }
Please login to merge, or discard this patch.
apps/dav/lib/Upload/UploadFolder.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 	}
40 40
 
41 41
 	public function createDirectory($name) {
42
-		throw new Forbidden('Permission denied to create file (filename ' . $name . ')');
42
+		throw new Forbidden('Permission denied to create file (filename '.$name.')');
43 43
 	}
44 44
 
45 45
 	public function getChild($name) {
Please login to merge, or discard this patch.
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -30,68 +30,68 @@
 block discarded – undo
30 30
 
31 31
 class UploadFolder implements ICollection {
32 32
 
33
-	/** @var Directory */
34
-	private $node;
35
-	/** @var CleanupService */
36
-	private $cleanupService;
37
-
38
-	public function __construct(Directory $node, CleanupService $cleanupService) {
39
-		$this->node = $node;
40
-		$this->cleanupService = $cleanupService;
41
-	}
42
-
43
-	public function createFile($name, $data = null) {
44
-		// TODO: verify name - should be a simple number
45
-		$this->node->createFile($name, $data);
46
-	}
47
-
48
-	public function createDirectory($name) {
49
-		throw new Forbidden('Permission denied to create file (filename ' . $name . ')');
50
-	}
51
-
52
-	public function getChild($name) {
53
-		if ($name === '.file') {
54
-			return new FutureFile($this->node, '.file');
55
-		}
56
-		return new UploadFile($this->node->getChild($name));
57
-	}
58
-
59
-	public function getChildren() {
60
-		$tmpChildren = $this->node->getChildren();
61
-
62
-		$children = [];
63
-		$children[] = new FutureFile($this->node, '.file');
64
-
65
-		foreach ($tmpChildren as $child) {
66
-			$children[] = new UploadFile($child);
67
-		}
68
-
69
-		return $children;
70
-	}
71
-
72
-	public function childExists($name) {
73
-		if ($name === '.file') {
74
-			return true;
75
-		}
76
-		return $this->node->childExists($name);
77
-	}
78
-
79
-	public function delete() {
80
-		$this->node->delete();
81
-
82
-		// Background cleanup job is not needed anymore
83
-		$this->cleanupService->removeJob($this->getName());
84
-	}
85
-
86
-	public function getName() {
87
-		return $this->node->getName();
88
-	}
89
-
90
-	public function setName($name) {
91
-		throw new Forbidden('Permission denied to rename this folder');
92
-	}
93
-
94
-	public function getLastModified() {
95
-		return $this->node->getLastModified();
96
-	}
33
+    /** @var Directory */
34
+    private $node;
35
+    /** @var CleanupService */
36
+    private $cleanupService;
37
+
38
+    public function __construct(Directory $node, CleanupService $cleanupService) {
39
+        $this->node = $node;
40
+        $this->cleanupService = $cleanupService;
41
+    }
42
+
43
+    public function createFile($name, $data = null) {
44
+        // TODO: verify name - should be a simple number
45
+        $this->node->createFile($name, $data);
46
+    }
47
+
48
+    public function createDirectory($name) {
49
+        throw new Forbidden('Permission denied to create file (filename ' . $name . ')');
50
+    }
51
+
52
+    public function getChild($name) {
53
+        if ($name === '.file') {
54
+            return new FutureFile($this->node, '.file');
55
+        }
56
+        return new UploadFile($this->node->getChild($name));
57
+    }
58
+
59
+    public function getChildren() {
60
+        $tmpChildren = $this->node->getChildren();
61
+
62
+        $children = [];
63
+        $children[] = new FutureFile($this->node, '.file');
64
+
65
+        foreach ($tmpChildren as $child) {
66
+            $children[] = new UploadFile($child);
67
+        }
68
+
69
+        return $children;
70
+    }
71
+
72
+    public function childExists($name) {
73
+        if ($name === '.file') {
74
+            return true;
75
+        }
76
+        return $this->node->childExists($name);
77
+    }
78
+
79
+    public function delete() {
80
+        $this->node->delete();
81
+
82
+        // Background cleanup job is not needed anymore
83
+        $this->cleanupService->removeJob($this->getName());
84
+    }
85
+
86
+    public function getName() {
87
+        return $this->node->getName();
88
+    }
89
+
90
+    public function setName($name) {
91
+        throw new Forbidden('Permission denied to rename this folder');
92
+    }
93
+
94
+    public function getLastModified() {
95
+        return $this->node->getLastModified();
96
+    }
97 97
 }
Please login to merge, or discard this patch.
apps/dav/lib/Upload/FutureFile.php 2 patches
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -36,87 +36,87 @@
 block discarded – undo
36 36
  */
37 37
 class FutureFile implements \Sabre\DAV\IFile {
38 38
 
39
-	/** @var Directory */
40
-	private $root;
41
-	/** @var string */
42
-	private $name;
39
+    /** @var Directory */
40
+    private $root;
41
+    /** @var string */
42
+    private $name;
43 43
 
44
-	/**
45
-	 * @param Directory $root
46
-	 * @param string $name
47
-	 */
48
-	public function __construct(Directory $root, $name) {
49
-		$this->root = $root;
50
-		$this->name = $name;
51
-	}
44
+    /**
45
+     * @param Directory $root
46
+     * @param string $name
47
+     */
48
+    public function __construct(Directory $root, $name) {
49
+        $this->root = $root;
50
+        $this->name = $name;
51
+    }
52 52
 
53
-	/**
54
-	 * @inheritdoc
55
-	 */
56
-	public function put($data) {
57
-		throw new Forbidden('Permission denied to put into this file');
58
-	}
53
+    /**
54
+     * @inheritdoc
55
+     */
56
+    public function put($data) {
57
+        throw new Forbidden('Permission denied to put into this file');
58
+    }
59 59
 
60
-	/**
61
-	 * @inheritdoc
62
-	 */
63
-	public function get() {
64
-		$nodes = $this->root->getChildren();
65
-		return AssemblyStream::wrap($nodes);
66
-	}
60
+    /**
61
+     * @inheritdoc
62
+     */
63
+    public function get() {
64
+        $nodes = $this->root->getChildren();
65
+        return AssemblyStream::wrap($nodes);
66
+    }
67 67
 
68
-	/**
69
-	 * @inheritdoc
70
-	 */
71
-	public function getContentType() {
72
-		return 'application/octet-stream';
73
-	}
68
+    /**
69
+     * @inheritdoc
70
+     */
71
+    public function getContentType() {
72
+        return 'application/octet-stream';
73
+    }
74 74
 
75
-	/**
76
-	 * @inheritdoc
77
-	 */
78
-	public function getETag() {
79
-		return $this->root->getETag();
80
-	}
75
+    /**
76
+     * @inheritdoc
77
+     */
78
+    public function getETag() {
79
+        return $this->root->getETag();
80
+    }
81 81
 
82
-	/**
83
-	 * @inheritdoc
84
-	 */
85
-	public function getSize() {
86
-		$children = $this->root->getChildren();
87
-		$sizes = array_map(function ($node) {
88
-			/** @var IFile $node */
89
-			return $node->getSize();
90
-		}, $children);
82
+    /**
83
+     * @inheritdoc
84
+     */
85
+    public function getSize() {
86
+        $children = $this->root->getChildren();
87
+        $sizes = array_map(function ($node) {
88
+            /** @var IFile $node */
89
+            return $node->getSize();
90
+        }, $children);
91 91
 
92
-		return array_sum($sizes);
93
-	}
92
+        return array_sum($sizes);
93
+    }
94 94
 
95
-	/**
96
-	 * @inheritdoc
97
-	 */
98
-	public function delete() {
99
-		$this->root->delete();
100
-	}
95
+    /**
96
+     * @inheritdoc
97
+     */
98
+    public function delete() {
99
+        $this->root->delete();
100
+    }
101 101
 
102
-	/**
103
-	 * @inheritdoc
104
-	 */
105
-	public function getName() {
106
-		return $this->name;
107
-	}
102
+    /**
103
+     * @inheritdoc
104
+     */
105
+    public function getName() {
106
+        return $this->name;
107
+    }
108 108
 
109
-	/**
110
-	 * @inheritdoc
111
-	 */
112
-	public function setName($name) {
113
-		throw new Forbidden('Permission denied to rename this file');
114
-	}
109
+    /**
110
+     * @inheritdoc
111
+     */
112
+    public function setName($name) {
113
+        throw new Forbidden('Permission denied to rename this file');
114
+    }
115 115
 
116
-	/**
117
-	 * @inheritdoc
118
-	 */
119
-	public function getLastModified() {
120
-		return $this->root->getLastModified();
121
-	}
116
+    /**
117
+     * @inheritdoc
118
+     */
119
+    public function getLastModified() {
120
+        return $this->root->getLastModified();
121
+    }
122 122
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 	 */
85 85
 	public function getSize() {
86 86
 		$children = $this->root->getChildren();
87
-		$sizes = array_map(function ($node) {
87
+		$sizes = array_map(function($node) {
88 88
 			/** @var IFile $node */
89 89
 			return $node->getSize();
90 90
 		}, $children);
Please login to merge, or discard this patch.
apps/dav/appinfo/v1/webdav.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 
63 63
 $requestUri = \OC::$server->getRequest()->getRequestUri();
64 64
 
65
-$server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, function () {
65
+$server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, function() {
66 66
 	// use the view for the logged in user
67 67
 	return \OC\Files\Filesystem::getView();
68 68
 });
Please login to merge, or discard this patch.
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
 // no php execution timeout for webdav
32 32
 if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
33
-	@set_time_limit(0);
33
+    @set_time_limit(0);
34 34
 }
35 35
 ignore_user_abort(true);
36 36
 
@@ -38,40 +38,40 @@  discard block
 block discarded – undo
38 38
 \OC_Util::obEnd();
39 39
 
40 40
 $serverFactory = new \OCA\DAV\Connector\Sabre\ServerFactory(
41
-	\OC::$server->getConfig(),
42
-	\OC::$server->getLogger(),
43
-	\OC::$server->getDatabaseConnection(),
44
-	\OC::$server->getUserSession(),
45
-	\OC::$server->getMountManager(),
46
-	\OC::$server->getTagManager(),
47
-	\OC::$server->getRequest(),
48
-	\OC::$server->getPreviewManager(),
49
-	\OC::$server->getEventDispatcher(),
50
-	\OC::$server->getL10N('dav')
41
+    \OC::$server->getConfig(),
42
+    \OC::$server->getLogger(),
43
+    \OC::$server->getDatabaseConnection(),
44
+    \OC::$server->getUserSession(),
45
+    \OC::$server->getMountManager(),
46
+    \OC::$server->getTagManager(),
47
+    \OC::$server->getRequest(),
48
+    \OC::$server->getPreviewManager(),
49
+    \OC::$server->getEventDispatcher(),
50
+    \OC::$server->getL10N('dav')
51 51
 );
52 52
 
53 53
 // Backends
54 54
 $authBackend = new \OCA\DAV\Connector\Sabre\Auth(
55
-	\OC::$server->getSession(),
56
-	\OC::$server->getUserSession(),
57
-	\OC::$server->getRequest(),
58
-	\OC::$server->getTwoFactorAuthManager(),
59
-	\OC::$server->getBruteForceThrottler(),
60
-	'principals/'
55
+    \OC::$server->getSession(),
56
+    \OC::$server->getUserSession(),
57
+    \OC::$server->getRequest(),
58
+    \OC::$server->getTwoFactorAuthManager(),
59
+    \OC::$server->getBruteForceThrottler(),
60
+    'principals/'
61 61
 );
62 62
 $authPlugin = new \Sabre\DAV\Auth\Plugin($authBackend);
63 63
 $bearerAuthPlugin = new \OCA\DAV\Connector\Sabre\BearerAuth(
64
-	\OC::$server->getUserSession(),
65
-	\OC::$server->getSession(),
66
-	\OC::$server->getRequest()
64
+    \OC::$server->getUserSession(),
65
+    \OC::$server->getSession(),
66
+    \OC::$server->getRequest()
67 67
 );
68 68
 $authPlugin->addBackend($bearerAuthPlugin);
69 69
 
70 70
 $requestUri = \OC::$server->getRequest()->getRequestUri();
71 71
 
72 72
 $server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, function () {
73
-	// use the view for the logged in user
74
-	return \OC\Files\Filesystem::getView();
73
+    // use the view for the logged in user
74
+    return \OC\Files\Filesystem::getView();
75 75
 });
76 76
 
77 77
 $dispatcher = \OC::$server->getEventDispatcher();
Please login to merge, or discard this patch.
apps/files_sharing/lib/External/Scanner.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 		} catch (\Exception $e) {
89 89
 			$this->storage->checkStorageAvailability();
90 90
 			throw new \Exception(
91
-				'Error while scanning remote share: "' .
92
-				$this->storage->getRemote() . '" ' .
91
+				'Error while scanning remote share: "'.
92
+				$this->storage->getRemote().'" '.
93 93
 				$e->getMessage()
94 94
 			);
95 95
 		}
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 			$this->addResult($data['data'], '');
98 98
 		} else {
99 99
 			throw new \Exception(
100
-				'Error while scanning remote share: "' .
101
-				$this->storage->getRemote() . '"'
100
+				'Error while scanning remote share: "'.
101
+				$this->storage->getRemote().'"'
102 102
 			);
103 103
 		}
104 104
 	}
@@ -113,14 +113,14 @@  discard block
 block discarded – undo
113 113
 			$children = [];
114 114
 			foreach ($data['children'] as $child) {
115 115
 				$children[$child['name']] = true;
116
-				$this->addResult($child, ltrim($path . '/' . $child['name'], '/'));
116
+				$this->addResult($child, ltrim($path.'/'.$child['name'], '/'));
117 117
 			}
118 118
 
119 119
 			$existingCache = $this->cache->getFolderContentsById($id);
120 120
 			foreach ($existingCache as $existingChild) {
121 121
 				// if an existing child is not in the new data, remove it
122 122
 				if (!isset($children[$existingChild['name']])) {
123
-					$this->cache->remove(ltrim($path . '/' . $existingChild['name'], '/'));
123
+					$this->cache->remove(ltrim($path.'/'.$existingChild['name'], '/'));
124 124
 				}
125 125
 			}
126 126
 		}
Please login to merge, or discard this patch.
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -33,97 +33,97 @@
 block discarded – undo
33 33
 use OCP\Files\StorageNotAvailableException;
34 34
 
35 35
 class Scanner extends \OC\Files\Cache\Scanner {
36
-	/** @var \OCA\Files_Sharing\External\Storage */
37
-	protected $storage;
36
+    /** @var \OCA\Files_Sharing\External\Storage */
37
+    protected $storage;
38 38
 
39
-	/** {@inheritDoc} */
40
-	public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
41
-		if (!$this->storage->remoteIsOwnCloud()) {
42
-			return parent::scan($path, $recursive, $recursive, $lock);
43
-		}
39
+    /** {@inheritDoc} */
40
+    public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
41
+        if (!$this->storage->remoteIsOwnCloud()) {
42
+            return parent::scan($path, $recursive, $recursive, $lock);
43
+        }
44 44
 
45
-		$this->scanAll();
46
-	}
45
+        $this->scanAll();
46
+    }
47 47
 
48
-	/**
49
-	 * Scan a single file and store it in the cache.
50
-	 * If an exception happened while accessing the external storage,
51
-	 * the storage will be checked for availability and removed
52
-	 * if it is not available any more.
53
-	 *
54
-	 * @param string $file file to scan
55
-	 * @param int $reuseExisting
56
-	 * @param int $parentId
57
-	 * @param array | null $cacheData existing data in the cache for the file to be scanned
58
-	 * @param bool $lock set to false to disable getting an additional read lock during scanning
59
-	 * @return array | null an array of metadata of the scanned file
60
-	 */
61
-	public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = null, $lock = true, $data = null) {
62
-		try {
63
-			return parent::scanFile($file, $reuseExisting);
64
-		} catch (ForbiddenException $e) {
65
-			$this->storage->checkStorageAvailability();
66
-		} catch (NotFoundException $e) {
67
-			// if the storage isn't found, the call to
68
-			// checkStorageAvailable() will verify it and remove it
69
-			// if appropriate
70
-			$this->storage->checkStorageAvailability();
71
-		} catch (StorageInvalidException $e) {
72
-			$this->storage->checkStorageAvailability();
73
-		} catch (StorageNotAvailableException $e) {
74
-			$this->storage->checkStorageAvailability();
75
-		}
76
-	}
48
+    /**
49
+     * Scan a single file and store it in the cache.
50
+     * If an exception happened while accessing the external storage,
51
+     * the storage will be checked for availability and removed
52
+     * if it is not available any more.
53
+     *
54
+     * @param string $file file to scan
55
+     * @param int $reuseExisting
56
+     * @param int $parentId
57
+     * @param array | null $cacheData existing data in the cache for the file to be scanned
58
+     * @param bool $lock set to false to disable getting an additional read lock during scanning
59
+     * @return array | null an array of metadata of the scanned file
60
+     */
61
+    public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = null, $lock = true, $data = null) {
62
+        try {
63
+            return parent::scanFile($file, $reuseExisting);
64
+        } catch (ForbiddenException $e) {
65
+            $this->storage->checkStorageAvailability();
66
+        } catch (NotFoundException $e) {
67
+            // if the storage isn't found, the call to
68
+            // checkStorageAvailable() will verify it and remove it
69
+            // if appropriate
70
+            $this->storage->checkStorageAvailability();
71
+        } catch (StorageInvalidException $e) {
72
+            $this->storage->checkStorageAvailability();
73
+        } catch (StorageNotAvailableException $e) {
74
+            $this->storage->checkStorageAvailability();
75
+        }
76
+    }
77 77
 
78
-	/**
79
-	 * Checks the remote share for changes.
80
-	 * If changes are available, scan them and update
81
-	 * the cache.
82
-	 * @throws NotFoundException
83
-	 * @throws StorageInvalidException
84
-	 * @throws \Exception
85
-	 */
86
-	public function scanAll() {
87
-		try {
88
-			$data = $this->storage->getShareInfo();
89
-		} catch (\Exception $e) {
90
-			$this->storage->checkStorageAvailability();
91
-			throw new \Exception(
92
-				'Error while scanning remote share: "' .
93
-				$this->storage->getRemote() . '" ' .
94
-				$e->getMessage()
95
-			);
96
-		}
97
-		if ($data['status'] === 'success') {
98
-			$this->addResult($data['data'], '');
99
-		} else {
100
-			throw new \Exception(
101
-				'Error while scanning remote share: "' .
102
-				$this->storage->getRemote() . '"'
103
-			);
104
-		}
105
-	}
78
+    /**
79
+     * Checks the remote share for changes.
80
+     * If changes are available, scan them and update
81
+     * the cache.
82
+     * @throws NotFoundException
83
+     * @throws StorageInvalidException
84
+     * @throws \Exception
85
+     */
86
+    public function scanAll() {
87
+        try {
88
+            $data = $this->storage->getShareInfo();
89
+        } catch (\Exception $e) {
90
+            $this->storage->checkStorageAvailability();
91
+            throw new \Exception(
92
+                'Error while scanning remote share: "' .
93
+                $this->storage->getRemote() . '" ' .
94
+                $e->getMessage()
95
+            );
96
+        }
97
+        if ($data['status'] === 'success') {
98
+            $this->addResult($data['data'], '');
99
+        } else {
100
+            throw new \Exception(
101
+                'Error while scanning remote share: "' .
102
+                $this->storage->getRemote() . '"'
103
+            );
104
+        }
105
+    }
106 106
 
107
-	/**
108
-	 * @param array $data
109
-	 * @param string $path
110
-	 */
111
-	private function addResult($data, $path) {
112
-		$id = $this->cache->put($path, $data);
113
-		if (isset($data['children'])) {
114
-			$children = [];
115
-			foreach ($data['children'] as $child) {
116
-				$children[$child['name']] = true;
117
-				$this->addResult($child, ltrim($path . '/' . $child['name'], '/'));
118
-			}
107
+    /**
108
+     * @param array $data
109
+     * @param string $path
110
+     */
111
+    private function addResult($data, $path) {
112
+        $id = $this->cache->put($path, $data);
113
+        if (isset($data['children'])) {
114
+            $children = [];
115
+            foreach ($data['children'] as $child) {
116
+                $children[$child['name']] = true;
117
+                $this->addResult($child, ltrim($path . '/' . $child['name'], '/'));
118
+            }
119 119
 
120
-			$existingCache = $this->cache->getFolderContentsById($id);
121
-			foreach ($existingCache as $existingChild) {
122
-				// if an existing child is not in the new data, remove it
123
-				if (!isset($children[$existingChild['name']])) {
124
-					$this->cache->remove(ltrim($path . '/' . $existingChild['name'], '/'));
125
-				}
126
-			}
127
-		}
128
-	}
120
+            $existingCache = $this->cache->getFolderContentsById($id);
121
+            foreach ($existingCache as $existingChild) {
122
+                // if an existing child is not in the new data, remove it
123
+                if (!isset($children[$existingChild['name']])) {
124
+                    $this->cache->remove(ltrim($path . '/' . $existingChild['name'], '/'));
125
+                }
126
+            }
127
+        }
128
+    }
129 129
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/DeleteOrphanedSharesJob.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -31,35 +31,35 @@
 block discarded – undo
31 31
  */
32 32
 class DeleteOrphanedSharesJob extends TimedJob {
33 33
 
34
-	/**
35
-	 * Default interval in minutes
36
-	 *
37
-	 * @var int $defaultIntervalMin
38
-	 **/
39
-	protected $defaultIntervalMin = 15;
34
+    /**
35
+     * Default interval in minutes
36
+     *
37
+     * @var int $defaultIntervalMin
38
+     **/
39
+    protected $defaultIntervalMin = 15;
40 40
 
41
-	/**
42
-	 * sets the correct interval for this timed job
43
-	 */
44
-	public function __construct() {
45
-		$this->interval = $this->defaultIntervalMin * 60;
46
-	}
41
+    /**
42
+     * sets the correct interval for this timed job
43
+     */
44
+    public function __construct() {
45
+        $this->interval = $this->defaultIntervalMin * 60;
46
+    }
47 47
 
48
-	/**
49
-	 * Makes the background job do its work
50
-	 *
51
-	 * @param array $argument unused argument
52
-	 */
53
-	public function run($argument) {
54
-		$connection = \OC::$server->getDatabaseConnection();
55
-		$logger = \OC::$server->getLogger();
48
+    /**
49
+     * Makes the background job do its work
50
+     *
51
+     * @param array $argument unused argument
52
+     */
53
+    public function run($argument) {
54
+        $connection = \OC::$server->getDatabaseConnection();
55
+        $logger = \OC::$server->getLogger();
56 56
 
57
-		$sql =
58
-			'DELETE FROM `*PREFIX*share` ' .
59
-			'WHERE `item_type` in (\'file\', \'folder\') ' .
60
-			'AND NOT EXISTS (SELECT `fileid` FROM `*PREFIX*filecache` WHERE `file_source` = `fileid`)';
57
+        $sql =
58
+            'DELETE FROM `*PREFIX*share` ' .
59
+            'WHERE `item_type` in (\'file\', \'folder\') ' .
60
+            'AND NOT EXISTS (SELECT `fileid` FROM `*PREFIX*filecache` WHERE `file_source` = `fileid`)';
61 61
 
62
-		$deletedEntries = $connection->executeUpdate($sql);
63
-		$logger->debug("$deletedEntries orphaned share(s) deleted", ['app' => 'DeleteOrphanedSharesJob']);
64
-	}
62
+        $deletedEntries = $connection->executeUpdate($sql);
63
+        $logger->debug("$deletedEntries orphaned share(s) deleted", ['app' => 'DeleteOrphanedSharesJob']);
64
+    }
65 65
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@
 block discarded – undo
55 55
 		$logger = \OC::$server->getLogger();
56 56
 
57 57
 		$sql =
58
-			'DELETE FROM `*PREFIX*share` ' .
59
-			'WHERE `item_type` in (\'file\', \'folder\') ' .
58
+			'DELETE FROM `*PREFIX*share` '.
59
+			'WHERE `item_type` in (\'file\', \'folder\') '.
60 60
 			'AND NOT EXISTS (SELECT `fileid` FROM `*PREFIX*filecache` WHERE `file_source` = `fileid`)';
61 61
 
62 62
 		$deletedEntries = $connection->executeUpdate($sql);
Please login to merge, or discard this patch.
apps/testing/lib/Controller/LockingController.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	protected function getPath($user, $path) {
102 102
 		$node = $this->rootFolder->getUserFolder($user)->get($path);
103
-		return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/'));
103
+		return 'files/'.md5($node->getStorage()->getId().'::'.trim($node->getInternalPath(), '/'));
104 104
 	}
105 105
 
106 106
 	/**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
 		try {
138 138
 			$lockingProvider->acquireLock($path, $type);
139
-			$this->config->setAppValue('testing', 'locking_' . $path, $type);
139
+			$this->config->setAppValue('testing', 'locking_'.$path, $type);
140 140
 			return new DataResponse();
141 141
 		} catch (LockedException $e) {
142 142
 			throw new OCSException('', Http::STATUS_LOCKED, $e);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
 		try {
165 165
 			$lockingProvider->changeLock($path, $type);
166
-			$this->config->setAppValue('testing', 'locking_' . $path, $type);
166
+			$this->config->setAppValue('testing', 'locking_'.$path, $type);
167 167
 			return new DataResponse();
168 168
 		} catch (LockedException $e) {
169 169
 			throw new OCSException('', Http::STATUS_LOCKED, $e);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
 		try {
192 192
 			$lockingProvider->releaseLock($path, $type);
193
-			$this->config->deleteAppValue('testing', 'locking_' . $path);
193
+			$this->config->deleteAppValue('testing', 'locking_'.$path);
194 194
 			return new DataResponse();
195 195
 		} catch (LockedException $e) {
196 196
 			throw new OCSException('', Http::STATUS_LOCKED, $e);
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
 			if (strpos($lock, 'locking_') === 0) {
234 234
 				$path = substr($lock, strlen('locking_'));
235 235
 
236
-				if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) {
236
+				if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) {
237 237
 					$lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
238
-				} elseif ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) {
238
+				} elseif ($type === ILockingProvider::LOCK_SHARED && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) {
239 239
 					$lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
240 240
 				} else {
241 241
 					$lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
Please login to merge, or discard this patch.
Indentation   +204 added lines, -204 removed lines patch added patch discarded remove patch
@@ -39,208 +39,208 @@
 block discarded – undo
39 39
 
40 40
 class LockingController extends OCSController {
41 41
 
42
-	/** @var ILockingProvider */
43
-	protected $lockingProvider;
44
-
45
-	/** @var FakeDBLockingProvider */
46
-	protected $fakeDBLockingProvider;
47
-
48
-	/** @var IDBConnection */
49
-	protected $connection;
50
-
51
-	/** @var IConfig */
52
-	protected $config;
53
-
54
-	/** @var IRootFolder */
55
-	protected $rootFolder;
56
-
57
-	/**
58
-	 * @param string $appName
59
-	 * @param IRequest $request
60
-	 * @param ILockingProvider $lockingProvider
61
-	 * @param FakeDBLockingProvider $fakeDBLockingProvider
62
-	 * @param IDBConnection $connection
63
-	 * @param IConfig $config
64
-	 * @param IRootFolder $rootFolder
65
-	 */
66
-	public function __construct($appName,
67
-								IRequest $request,
68
-								ILockingProvider $lockingProvider,
69
-								FakeDBLockingProvider $fakeDBLockingProvider,
70
-								IDBConnection $connection,
71
-								IConfig $config,
72
-								IRootFolder $rootFolder) {
73
-		parent::__construct($appName, $request);
74
-
75
-		$this->lockingProvider = $lockingProvider;
76
-		$this->fakeDBLockingProvider = $fakeDBLockingProvider;
77
-		$this->connection = $connection;
78
-		$this->config = $config;
79
-		$this->rootFolder = $rootFolder;
80
-	}
81
-
82
-	/**
83
-	 * @return ILockingProvider
84
-	 * @throws \RuntimeException
85
-	 */
86
-	protected function getLockingProvider() {
87
-		if ($this->lockingProvider instanceof DBLockingProvider) {
88
-			return $this->fakeDBLockingProvider;
89
-		}
90
-		throw new \RuntimeException('Lock provisioning is only possible using the DBLockingProvider');
91
-	}
92
-
93
-	/**
94
-	 * @param string $user
95
-	 * @param string $path
96
-	 * @return string
97
-	 * @throws NotFoundException
98
-	 */
99
-	protected function getPath($user, $path) {
100
-		$node = $this->rootFolder->getUserFolder($user)->get($path);
101
-		return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/'));
102
-	}
103
-
104
-	/**
105
-	 * @return DataResponse
106
-	 * @throws OCSException
107
-	 */
108
-	public function isLockingEnabled() {
109
-		try {
110
-			$this->getLockingProvider();
111
-			return new DataResponse();
112
-		} catch (\RuntimeException $e) {
113
-			throw new OCSException($e->getMessage(), Http::STATUS_NOT_IMPLEMENTED, $e);
114
-		}
115
-	}
116
-
117
-	/**
118
-	 * @param int $type
119
-	 * @param string $user
120
-	 * @param string $path
121
-	 * @return DataResponse
122
-	 * @throws OCSException
123
-	 */
124
-	public function acquireLock($type, $user, $path) {
125
-		try {
126
-			$path = $this->getPath($user, $path);
127
-		} catch (NoUserException $e) {
128
-			throw new OCSException('User not found', Http::STATUS_NOT_FOUND, $e);
129
-		} catch (NotFoundException $e) {
130
-			throw new OCSException('Path not found', Http::STATUS_NOT_FOUND, $e);
131
-		}
132
-
133
-		$lockingProvider = $this->getLockingProvider();
134
-
135
-		try {
136
-			$lockingProvider->acquireLock($path, $type);
137
-			$this->config->setAppValue('testing', 'locking_' . $path, $type);
138
-			return new DataResponse();
139
-		} catch (LockedException $e) {
140
-			throw new OCSException('', Http::STATUS_LOCKED, $e);
141
-		}
142
-	}
143
-
144
-	/**
145
-	 * @param int $type
146
-	 * @param string $user
147
-	 * @param string $path
148
-	 * @return DataResponse
149
-	 * @throws OCSException
150
-	 */
151
-	public function changeLock($type, $user, $path) {
152
-		try {
153
-			$path = $this->getPath($user, $path);
154
-		} catch (NoUserException $e) {
155
-			throw new OCSException('User not found', Http::STATUS_NOT_FOUND, $e);
156
-		} catch (NotFoundException $e) {
157
-			throw new OCSException('Path not found', Http::STATUS_NOT_FOUND, $e);
158
-		}
159
-
160
-		$lockingProvider = $this->getLockingProvider();
161
-
162
-		try {
163
-			$lockingProvider->changeLock($path, $type);
164
-			$this->config->setAppValue('testing', 'locking_' . $path, $type);
165
-			return new DataResponse();
166
-		} catch (LockedException $e) {
167
-			throw new OCSException('', Http::STATUS_LOCKED, $e);
168
-		}
169
-	}
170
-
171
-	/**
172
-	 * @param int $type
173
-	 * @param string $user
174
-	 * @param string $path
175
-	 * @return DataResponse
176
-	 * @throws OCSException
177
-	 */
178
-	public function releaseLock($type, $user, $path) {
179
-		try {
180
-			$path = $this->getPath($user, $path);
181
-		} catch (NoUserException $e) {
182
-			throw new OCSException('User not found', Http::STATUS_NOT_FOUND, $e);
183
-		} catch (NotFoundException $e) {
184
-			throw new OCSException('Path not found', Http::STATUS_NOT_FOUND, $e);
185
-		}
186
-
187
-		$lockingProvider = $this->getLockingProvider();
188
-
189
-		try {
190
-			$lockingProvider->releaseLock($path, $type);
191
-			$this->config->deleteAppValue('testing', 'locking_' . $path);
192
-			return new DataResponse();
193
-		} catch (LockedException $e) {
194
-			throw new OCSException('', Http::STATUS_LOCKED, $e);
195
-		}
196
-	}
197
-
198
-	/**
199
-	 * @param int $type
200
-	 * @param string $user
201
-	 * @param string $path
202
-	 * @return DataResponse
203
-	 * @throws OCSException
204
-	 */
205
-	public function isLocked($type, $user, $path) {
206
-		try {
207
-			$path = $this->getPath($user, $path);
208
-		} catch (NoUserException $e) {
209
-			throw new OCSException('User not found', Http::STATUS_NOT_FOUND, $e);
210
-		} catch (NotFoundException $e) {
211
-			throw new OCSException('Path not found', Http::STATUS_NOT_FOUND, $e);
212
-		}
213
-
214
-		$lockingProvider = $this->getLockingProvider();
215
-
216
-		if ($lockingProvider->isLocked($path, $type)) {
217
-			return new DataResponse();
218
-		}
219
-
220
-		throw new OCSException('', Http::STATUS_LOCKED);
221
-	}
222
-
223
-	/**
224
-	 * @param int $type
225
-	 * @return DataResponse
226
-	 */
227
-	public function releaseAll($type = null) {
228
-		$lockingProvider = $this->getLockingProvider();
229
-
230
-		foreach ($this->config->getAppKeys('testing') as $lock) {
231
-			if (strpos($lock, 'locking_') === 0) {
232
-				$path = substr($lock, strlen('locking_'));
233
-
234
-				if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) {
235
-					$lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
236
-				} elseif ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) {
237
-					$lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
238
-				} else {
239
-					$lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
240
-				}
241
-			}
242
-		}
243
-
244
-		return new DataResponse();
245
-	}
42
+    /** @var ILockingProvider */
43
+    protected $lockingProvider;
44
+
45
+    /** @var FakeDBLockingProvider */
46
+    protected $fakeDBLockingProvider;
47
+
48
+    /** @var IDBConnection */
49
+    protected $connection;
50
+
51
+    /** @var IConfig */
52
+    protected $config;
53
+
54
+    /** @var IRootFolder */
55
+    protected $rootFolder;
56
+
57
+    /**
58
+     * @param string $appName
59
+     * @param IRequest $request
60
+     * @param ILockingProvider $lockingProvider
61
+     * @param FakeDBLockingProvider $fakeDBLockingProvider
62
+     * @param IDBConnection $connection
63
+     * @param IConfig $config
64
+     * @param IRootFolder $rootFolder
65
+     */
66
+    public function __construct($appName,
67
+                                IRequest $request,
68
+                                ILockingProvider $lockingProvider,
69
+                                FakeDBLockingProvider $fakeDBLockingProvider,
70
+                                IDBConnection $connection,
71
+                                IConfig $config,
72
+                                IRootFolder $rootFolder) {
73
+        parent::__construct($appName, $request);
74
+
75
+        $this->lockingProvider = $lockingProvider;
76
+        $this->fakeDBLockingProvider = $fakeDBLockingProvider;
77
+        $this->connection = $connection;
78
+        $this->config = $config;
79
+        $this->rootFolder = $rootFolder;
80
+    }
81
+
82
+    /**
83
+     * @return ILockingProvider
84
+     * @throws \RuntimeException
85
+     */
86
+    protected function getLockingProvider() {
87
+        if ($this->lockingProvider instanceof DBLockingProvider) {
88
+            return $this->fakeDBLockingProvider;
89
+        }
90
+        throw new \RuntimeException('Lock provisioning is only possible using the DBLockingProvider');
91
+    }
92
+
93
+    /**
94
+     * @param string $user
95
+     * @param string $path
96
+     * @return string
97
+     * @throws NotFoundException
98
+     */
99
+    protected function getPath($user, $path) {
100
+        $node = $this->rootFolder->getUserFolder($user)->get($path);
101
+        return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/'));
102
+    }
103
+
104
+    /**
105
+     * @return DataResponse
106
+     * @throws OCSException
107
+     */
108
+    public function isLockingEnabled() {
109
+        try {
110
+            $this->getLockingProvider();
111
+            return new DataResponse();
112
+        } catch (\RuntimeException $e) {
113
+            throw new OCSException($e->getMessage(), Http::STATUS_NOT_IMPLEMENTED, $e);
114
+        }
115
+    }
116
+
117
+    /**
118
+     * @param int $type
119
+     * @param string $user
120
+     * @param string $path
121
+     * @return DataResponse
122
+     * @throws OCSException
123
+     */
124
+    public function acquireLock($type, $user, $path) {
125
+        try {
126
+            $path = $this->getPath($user, $path);
127
+        } catch (NoUserException $e) {
128
+            throw new OCSException('User not found', Http::STATUS_NOT_FOUND, $e);
129
+        } catch (NotFoundException $e) {
130
+            throw new OCSException('Path not found', Http::STATUS_NOT_FOUND, $e);
131
+        }
132
+
133
+        $lockingProvider = $this->getLockingProvider();
134
+
135
+        try {
136
+            $lockingProvider->acquireLock($path, $type);
137
+            $this->config->setAppValue('testing', 'locking_' . $path, $type);
138
+            return new DataResponse();
139
+        } catch (LockedException $e) {
140
+            throw new OCSException('', Http::STATUS_LOCKED, $e);
141
+        }
142
+    }
143
+
144
+    /**
145
+     * @param int $type
146
+     * @param string $user
147
+     * @param string $path
148
+     * @return DataResponse
149
+     * @throws OCSException
150
+     */
151
+    public function changeLock($type, $user, $path) {
152
+        try {
153
+            $path = $this->getPath($user, $path);
154
+        } catch (NoUserException $e) {
155
+            throw new OCSException('User not found', Http::STATUS_NOT_FOUND, $e);
156
+        } catch (NotFoundException $e) {
157
+            throw new OCSException('Path not found', Http::STATUS_NOT_FOUND, $e);
158
+        }
159
+
160
+        $lockingProvider = $this->getLockingProvider();
161
+
162
+        try {
163
+            $lockingProvider->changeLock($path, $type);
164
+            $this->config->setAppValue('testing', 'locking_' . $path, $type);
165
+            return new DataResponse();
166
+        } catch (LockedException $e) {
167
+            throw new OCSException('', Http::STATUS_LOCKED, $e);
168
+        }
169
+    }
170
+
171
+    /**
172
+     * @param int $type
173
+     * @param string $user
174
+     * @param string $path
175
+     * @return DataResponse
176
+     * @throws OCSException
177
+     */
178
+    public function releaseLock($type, $user, $path) {
179
+        try {
180
+            $path = $this->getPath($user, $path);
181
+        } catch (NoUserException $e) {
182
+            throw new OCSException('User not found', Http::STATUS_NOT_FOUND, $e);
183
+        } catch (NotFoundException $e) {
184
+            throw new OCSException('Path not found', Http::STATUS_NOT_FOUND, $e);
185
+        }
186
+
187
+        $lockingProvider = $this->getLockingProvider();
188
+
189
+        try {
190
+            $lockingProvider->releaseLock($path, $type);
191
+            $this->config->deleteAppValue('testing', 'locking_' . $path);
192
+            return new DataResponse();
193
+        } catch (LockedException $e) {
194
+            throw new OCSException('', Http::STATUS_LOCKED, $e);
195
+        }
196
+    }
197
+
198
+    /**
199
+     * @param int $type
200
+     * @param string $user
201
+     * @param string $path
202
+     * @return DataResponse
203
+     * @throws OCSException
204
+     */
205
+    public function isLocked($type, $user, $path) {
206
+        try {
207
+            $path = $this->getPath($user, $path);
208
+        } catch (NoUserException $e) {
209
+            throw new OCSException('User not found', Http::STATUS_NOT_FOUND, $e);
210
+        } catch (NotFoundException $e) {
211
+            throw new OCSException('Path not found', Http::STATUS_NOT_FOUND, $e);
212
+        }
213
+
214
+        $lockingProvider = $this->getLockingProvider();
215
+
216
+        if ($lockingProvider->isLocked($path, $type)) {
217
+            return new DataResponse();
218
+        }
219
+
220
+        throw new OCSException('', Http::STATUS_LOCKED);
221
+    }
222
+
223
+    /**
224
+     * @param int $type
225
+     * @return DataResponse
226
+     */
227
+    public function releaseAll($type = null) {
228
+        $lockingProvider = $this->getLockingProvider();
229
+
230
+        foreach ($this->config->getAppKeys('testing') as $lock) {
231
+            if (strpos($lock, 'locking_') === 0) {
232
+                $path = substr($lock, strlen('locking_'));
233
+
234
+                if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) {
235
+                    $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
236
+                } elseif ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) {
237
+                    $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
238
+                } else {
239
+                    $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
240
+                }
241
+            }
242
+        }
243
+
244
+        return new DataResponse();
245
+    }
246 246
 }
Please login to merge, or discard this patch.
apps/testing/appinfo/routes.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -21,62 +21,62 @@
 block discarded – undo
21 21
  */
22 22
 
23 23
 return [
24
-	'routes' => [
25
-		[
26
-			'name' => 'RateLimitTest#userAndAnonProtected',
27
-			'url' => '/userAndAnonProtected',
28
-			'verb' => 'GET',
29
-		],
30
-		[
31
-			'name' => 'RateLimitTest#onlyAnonProtected',
32
-			'url' => '/anonProtected',
33
-			'verb' => 'GET',
34
-		],
35
-	],
24
+    'routes' => [
25
+        [
26
+            'name' => 'RateLimitTest#userAndAnonProtected',
27
+            'url' => '/userAndAnonProtected',
28
+            'verb' => 'GET',
29
+        ],
30
+        [
31
+            'name' => 'RateLimitTest#onlyAnonProtected',
32
+            'url' => '/anonProtected',
33
+            'verb' => 'GET',
34
+        ],
35
+    ],
36 36
 
37
-	'ocs' => [
38
-		[
39
-			'name' => 'Config#setAppValue',
40
-			'url' => '/api/v1/app/{appid}/{configkey}',
41
-			'verb' => 'POST',
42
-		],
43
-		[
44
-			'name' => 'Config#deleteAppValue',
45
-			'url' => '/api/v1/app/{appid}/{configkey}',
46
-			'verb' => 'DELETE',
47
-		],
48
-		[
49
-			'name' => 'Locking#isLockingEnabled',
50
-			'url' => '/api/v1/lockprovisioning',
51
-			'verb' => 'GET',
52
-		],
53
-		[
54
-			'name' => 'Locking#isLocked',
55
-			'url' => '/api/v1/lockprovisioning/{type}/{user}',
56
-			'verb' => 'GET',
57
-		],
58
-		[
59
-			'name' => 'Locking#acquireLock',
60
-			'url' => '/api/v1/lockprovisioning/{type}/{user}',
61
-			'verb' => 'POST',
62
-		],
63
-		[
64
-			'name' => 'Locking#changeLock',
65
-			'url' => '/api/v1/lockprovisioning/{type}/{user}',
66
-			'verb' => 'PUT',
67
-		],
68
-		[
69
-			'name' => 'Locking#releaseLock',
70
-			'url' => '/api/v1/lockprovisioning/{type}/{user}',
71
-			'verb' => 'DELETE',
72
-		],
73
-		[
74
-			'name' => 'Locking#releaseAll',
75
-			'url' => '/api/v1/lockprovisioning/{type}',
76
-			'verb' => 'DELETE',
77
-			'defaults' => [
78
-				'type' => null
79
-			]
80
-		],
81
-	],
37
+    'ocs' => [
38
+        [
39
+            'name' => 'Config#setAppValue',
40
+            'url' => '/api/v1/app/{appid}/{configkey}',
41
+            'verb' => 'POST',
42
+        ],
43
+        [
44
+            'name' => 'Config#deleteAppValue',
45
+            'url' => '/api/v1/app/{appid}/{configkey}',
46
+            'verb' => 'DELETE',
47
+        ],
48
+        [
49
+            'name' => 'Locking#isLockingEnabled',
50
+            'url' => '/api/v1/lockprovisioning',
51
+            'verb' => 'GET',
52
+        ],
53
+        [
54
+            'name' => 'Locking#isLocked',
55
+            'url' => '/api/v1/lockprovisioning/{type}/{user}',
56
+            'verb' => 'GET',
57
+        ],
58
+        [
59
+            'name' => 'Locking#acquireLock',
60
+            'url' => '/api/v1/lockprovisioning/{type}/{user}',
61
+            'verb' => 'POST',
62
+        ],
63
+        [
64
+            'name' => 'Locking#changeLock',
65
+            'url' => '/api/v1/lockprovisioning/{type}/{user}',
66
+            'verb' => 'PUT',
67
+        ],
68
+        [
69
+            'name' => 'Locking#releaseLock',
70
+            'url' => '/api/v1/lockprovisioning/{type}/{user}',
71
+            'verb' => 'DELETE',
72
+        ],
73
+        [
74
+            'name' => 'Locking#releaseAll',
75
+            'url' => '/api/v1/lockprovisioning/{type}',
76
+            'verb' => 'DELETE',
77
+            'defaults' => [
78
+                'type' => null
79
+            ]
80
+        ],
81
+    ],
82 82
 ];
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/PriorityTrait.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -29,31 +29,31 @@
 block discarded – undo
29 29
  */
30 30
 trait PriorityTrait {
31 31
 
32
-	/** @var int initial priority */
33
-	protected $priority = BackendService::PRIORITY_DEFAULT;
32
+    /** @var int initial priority */
33
+    protected $priority = BackendService::PRIORITY_DEFAULT;
34 34
 
35
-	/**
36
-	 * @return int
37
-	 */
38
-	public function getPriority() {
39
-		return $this->priority;
40
-	}
35
+    /**
36
+     * @return int
37
+     */
38
+    public function getPriority() {
39
+        return $this->priority;
40
+    }
41 41
 
42
-	/**
43
-	 * @param int $priority
44
-	 * @return self
45
-	 */
46
-	public function setPriority($priority) {
47
-		$this->priority = $priority;
48
-		return $this;
49
-	}
42
+    /**
43
+     * @param int $priority
44
+     * @return self
45
+     */
46
+    public function setPriority($priority) {
47
+        $this->priority = $priority;
48
+        return $this;
49
+    }
50 50
 
51
-	/**
52
-	 * @param PriorityTrait $a
53
-	 * @param PriorityTrait $b
54
-	 * @return int
55
-	 */
56
-	public static function priorityCompare(PriorityTrait $a, PriorityTrait $b) {
57
-		return ($a->getPriority() - $b->getPriority());
58
-	}
51
+    /**
52
+     * @param PriorityTrait $a
53
+     * @param PriorityTrait $b
54
+     * @return int
55
+     */
56
+    public static function priorityCompare(PriorityTrait $a, PriorityTrait $b) {
57
+        return ($a->getPriority() - $b->getPriority());
58
+    }
59 59
 }
Please login to merge, or discard this patch.