Passed
Push — master ( 14fcc6...5ef74e )
by Roeland
11:44
created
apps/dav/lib/Connector/Sabre/AnonymousOptionsPlugin.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -30,44 +30,44 @@
 block discarded – undo
30 30
 
31 31
 class AnonymousOptionsPlugin extends ServerPlugin {
32 32
 
33
-	/**
34
-	 * @var \Sabre\DAV\Server
35
-	 */
36
-	private $server;
33
+    /**
34
+     * @var \Sabre\DAV\Server
35
+     */
36
+    private $server;
37 37
 
38
-	/**
39
-	 * @param \Sabre\DAV\Server $server
40
-	 * @return void
41
-	 */
42
-	public function initialize(\Sabre\DAV\Server $server) {
43
-		$this->server = $server;
44
-		// before auth
45
-		$this->server->on('beforeMethod', [$this, 'handleAnonymousOptions'], 9);
46
-	}
38
+    /**
39
+     * @param \Sabre\DAV\Server $server
40
+     * @return void
41
+     */
42
+    public function initialize(\Sabre\DAV\Server $server) {
43
+        $this->server = $server;
44
+        // before auth
45
+        $this->server->on('beforeMethod', [$this, 'handleAnonymousOptions'], 9);
46
+    }
47 47
 
48
-	/**
49
-	 * @return bool
50
-	 */
51
-	public function isRequestInRoot($path) {
52
-		return $path === '' || (is_string($path) && strpos($path, '/') === FALSE);
53
-	}
48
+    /**
49
+     * @return bool
50
+     */
51
+    public function isRequestInRoot($path) {
52
+        return $path === '' || (is_string($path) && strpos($path, '/') === FALSE);
53
+    }
54 54
 
55
-	/**
56
-	 * @throws \Sabre\DAV\Exception\Forbidden
57
-	 * @return bool
58
-	 */
59
-	public function handleAnonymousOptions(RequestInterface $request, ResponseInterface $response) {
60
-		if ($request->getHeader('Authorization') === null && $request->getMethod() === 'OPTIONS' && $this->isRequestInRoot($request->getPath())) {
61
-			/** @var CorePlugin $corePlugin */
62
-			$corePlugin = $this->server->getPlugin('core');
63
-			// setup a fake tree for anonymous access
64
-			$this->server->tree = new Tree(new Directory(''));
65
-			$corePlugin->httpOptions($request, $response);
66
-			$this->server->emit('afterMethod', [$request, $response]);
67
-			$this->server->emit('afterMethod:OPTIONS', [$request, $response]);
55
+    /**
56
+     * @throws \Sabre\DAV\Exception\Forbidden
57
+     * @return bool
58
+     */
59
+    public function handleAnonymousOptions(RequestInterface $request, ResponseInterface $response) {
60
+        if ($request->getHeader('Authorization') === null && $request->getMethod() === 'OPTIONS' && $this->isRequestInRoot($request->getPath())) {
61
+            /** @var CorePlugin $corePlugin */
62
+            $corePlugin = $this->server->getPlugin('core');
63
+            // setup a fake tree for anonymous access
64
+            $this->server->tree = new Tree(new Directory(''));
65
+            $corePlugin->httpOptions($request, $response);
66
+            $this->server->emit('afterMethod', [$request, $response]);
67
+            $this->server->emit('afterMethod:OPTIONS', [$request, $response]);
68 68
 
69
-			$this->server->sapi->sendResponse($response);
70
-			return false;
71
-		}
72
-	}
69
+            $this->server->sapi->sendResponse($response);
70
+            return false;
71
+        }
72
+    }
73 73
 }
Please login to merge, or discard this patch.