Passed
Push — master ( 078203...c81798 )
by Joas
14:40 queued 14s
created
apps/files_sharing/lib/Activity/Settings/Shared.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -25,61 +25,61 @@
 block discarded – undo
25 25
 namespace OCA\Files_Sharing\Activity\Settings;
26 26
 
27 27
 class Shared extends ShareActivitySettings {
28
-	/**
29
-	 * @return string Lowercase a-z and underscore only identifier
30
-	 * @since 11.0.0
31
-	 */
32
-	public function getIdentifier() {
33
-		return 'shared';
34
-	}
28
+    /**
29
+     * @return string Lowercase a-z and underscore only identifier
30
+     * @since 11.0.0
31
+     */
32
+    public function getIdentifier() {
33
+        return 'shared';
34
+    }
35 35
 
36
-	/**
37
-	 * @return string A translated string
38
-	 * @since 11.0.0
39
-	 */
40
-	public function getName() {
41
-		return $this->l->t('A file or folder has been <strong>shared</strong>');
42
-	}
36
+    /**
37
+     * @return string A translated string
38
+     * @since 11.0.0
39
+     */
40
+    public function getName() {
41
+        return $this->l->t('A file or folder has been <strong>shared</strong>');
42
+    }
43 43
 
44
-	/**
45
-	 * @return int whether the filter should be rather on the top or bottom of
46
-	 * the admin section. The filters are arranged in ascending order of the
47
-	 * priority values. It is required to return a value between 0 and 100.
48
-	 * @since 11.0.0
49
-	 */
50
-	public function getPriority() {
51
-		return 10;
52
-	}
44
+    /**
45
+     * @return int whether the filter should be rather on the top or bottom of
46
+     * the admin section. The filters are arranged in ascending order of the
47
+     * priority values. It is required to return a value between 0 and 100.
48
+     * @since 11.0.0
49
+     */
50
+    public function getPriority() {
51
+        return 10;
52
+    }
53 53
 
54
-	/**
55
-	 * @return bool True when the option can be changed for the stream
56
-	 * @since 11.0.0
57
-	 */
58
-	public function canChangeStream() {
59
-		return true;
60
-	}
54
+    /**
55
+     * @return bool True when the option can be changed for the stream
56
+     * @since 11.0.0
57
+     */
58
+    public function canChangeStream() {
59
+        return true;
60
+    }
61 61
 
62
-	/**
63
-	 * @return bool True when the option can be changed for the stream
64
-	 * @since 11.0.0
65
-	 */
66
-	public function isDefaultEnabledStream() {
67
-		return true;
68
-	}
62
+    /**
63
+     * @return bool True when the option can be changed for the stream
64
+     * @since 11.0.0
65
+     */
66
+    public function isDefaultEnabledStream() {
67
+        return true;
68
+    }
69 69
 
70
-	/**
71
-	 * @return bool True when the option can be changed for the mail
72
-	 * @since 11.0.0
73
-	 */
74
-	public function canChangeMail() {
75
-		return true;
76
-	}
70
+    /**
71
+     * @return bool True when the option can be changed for the mail
72
+     * @since 11.0.0
73
+     */
74
+    public function canChangeMail() {
75
+        return true;
76
+    }
77 77
 
78
-	/**
79
-	 * @return bool True when the option can be changed for the stream
80
-	 * @since 11.0.0
81
-	 */
82
-	public function isDefaultEnabledMail() {
83
-		return false;
84
-	}
78
+    /**
79
+     * @return bool True when the option can be changed for the stream
80
+     * @since 11.0.0
81
+     */
82
+    public function isDefaultEnabledMail() {
83
+        return false;
84
+    }
85 85
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Activity/Settings/RemoteShare.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -25,61 +25,61 @@
 block discarded – undo
25 25
 namespace OCA\Files_Sharing\Activity\Settings;
26 26
 
27 27
 class RemoteShare extends ShareActivitySettings {
28
-	/**
29
-	 * @return string Lowercase a-z and underscore only identifier
30
-	 * @since 11.0.0
31
-	 */
32
-	public function getIdentifier() {
33
-		return 'remote_share';
34
-	}
28
+    /**
29
+     * @return string Lowercase a-z and underscore only identifier
30
+     * @since 11.0.0
31
+     */
32
+    public function getIdentifier() {
33
+        return 'remote_share';
34
+    }
35 35
 
36
-	/**
37
-	 * @return string A translated string
38
-	 * @since 11.0.0
39
-	 */
40
-	public function getName() {
41
-		return $this->l->t('A file or folder was shared from <strong>another server</strong>');
42
-	}
36
+    /**
37
+     * @return string A translated string
38
+     * @since 11.0.0
39
+     */
40
+    public function getName() {
41
+        return $this->l->t('A file or folder was shared from <strong>another server</strong>');
42
+    }
43 43
 
44
-	/**
45
-	 * @return int whether the filter should be rather on the top or bottom of
46
-	 * the admin section. The filters are arranged in ascending order of the
47
-	 * priority values. It is required to return a value between 0 and 100.
48
-	 * @since 11.0.0
49
-	 */
50
-	public function getPriority() {
51
-		return 11;
52
-	}
44
+    /**
45
+     * @return int whether the filter should be rather on the top or bottom of
46
+     * the admin section. The filters are arranged in ascending order of the
47
+     * priority values. It is required to return a value between 0 and 100.
48
+     * @since 11.0.0
49
+     */
50
+    public function getPriority() {
51
+        return 11;
52
+    }
53 53
 
54
-	/**
55
-	 * @return bool True when the option can be changed for the stream
56
-	 * @since 11.0.0
57
-	 */
58
-	public function canChangeStream() {
59
-		return true;
60
-	}
54
+    /**
55
+     * @return bool True when the option can be changed for the stream
56
+     * @since 11.0.0
57
+     */
58
+    public function canChangeStream() {
59
+        return true;
60
+    }
61 61
 
62
-	/**
63
-	 * @return bool True when the option can be changed for the stream
64
-	 * @since 11.0.0
65
-	 */
66
-	public function isDefaultEnabledStream() {
67
-		return true;
68
-	}
62
+    /**
63
+     * @return bool True when the option can be changed for the stream
64
+     * @since 11.0.0
65
+     */
66
+    public function isDefaultEnabledStream() {
67
+        return true;
68
+    }
69 69
 
70
-	/**
71
-	 * @return bool True when the option can be changed for the mail
72
-	 * @since 11.0.0
73
-	 */
74
-	public function canChangeMail() {
75
-		return true;
76
-	}
70
+    /**
71
+     * @return bool True when the option can be changed for the mail
72
+     * @since 11.0.0
73
+     */
74
+    public function canChangeMail() {
75
+        return true;
76
+    }
77 77
 
78
-	/**
79
-	 * @return bool True when the option can be changed for the stream
80
-	 * @since 11.0.0
81
-	 */
82
-	public function isDefaultEnabledMail() {
83
-		return false;
84
-	}
78
+    /**
79
+     * @return bool True when the option can be changed for the stream
80
+     * @since 11.0.0
81
+     */
82
+    public function isDefaultEnabledMail() {
83
+        return false;
84
+    }
85 85
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Activity/Settings/ShareActivitySettings.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@
 block discarded – undo
27 27
 use OCP\IL10N;
28 28
 
29 29
 abstract class ShareActivitySettings extends ActivitySettings {
30
-	/** @var IL10N */
31
-	protected $l;
30
+    /** @var IL10N */
31
+    protected $l;
32 32
 
33
-	/**
34
-	 * @param IL10N $l
35
-	 */
36
-	public function __construct(IL10N $l) {
37
-		$this->l = $l;
38
-	}
33
+    /**
34
+     * @param IL10N $l
35
+     */
36
+    public function __construct(IL10N $l) {
37
+        $this->l = $l;
38
+    }
39 39
 
40
-	public function getGroupIdentifier() {
41
-		return 'files';
42
-	}
40
+    public function getGroupIdentifier() {
41
+        return 'files';
42
+    }
43 43
 
44
-	public function getGroupName() {
45
-		return $this->l->t('Files');
46
-	}
44
+    public function getGroupName() {
45
+        return $this->l->t('Files');
46
+    }
47 47
 }
Please login to merge, or discard this patch.
apps/dav/lib/Upload/ChunkingPlugin.php 1 patch
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -35,97 +35,97 @@
 block discarded – undo
35 35
 
36 36
 class ChunkingPlugin extends ServerPlugin {
37 37
 
38
-	/** @var Server */
39
-	private $server;
40
-	/** @var FutureFile */
41
-	private $sourceNode;
38
+    /** @var Server */
39
+    private $server;
40
+    /** @var FutureFile */
41
+    private $sourceNode;
42 42
 
43
-	/**
44
-	 * @inheritdoc
45
-	 */
46
-	public function initialize(Server $server) {
47
-		$server->on('beforeMove', [$this, 'beforeMove']);
48
-		$this->server = $server;
49
-	}
43
+    /**
44
+     * @inheritdoc
45
+     */
46
+    public function initialize(Server $server) {
47
+        $server->on('beforeMove', [$this, 'beforeMove']);
48
+        $this->server = $server;
49
+    }
50 50
 
51
-	/**
52
-	 * @param string $sourcePath source path
53
-	 * @param string $destination destination path
54
-	 * @return bool|void
55
-	 * @throws BadRequest
56
-	 * @throws NotFound
57
-	 */
58
-	public function beforeMove($sourcePath, $destination) {
59
-		$this->sourceNode = $this->server->tree->getNodeForPath($sourcePath);
60
-		if (!$this->sourceNode instanceof FutureFile) {
61
-			// skip handling as the source is not a chunked FutureFile
62
-			return;
63
-		}
51
+    /**
52
+     * @param string $sourcePath source path
53
+     * @param string $destination destination path
54
+     * @return bool|void
55
+     * @throws BadRequest
56
+     * @throws NotFound
57
+     */
58
+    public function beforeMove($sourcePath, $destination) {
59
+        $this->sourceNode = $this->server->tree->getNodeForPath($sourcePath);
60
+        if (!$this->sourceNode instanceof FutureFile) {
61
+            // skip handling as the source is not a chunked FutureFile
62
+            return;
63
+        }
64 64
 
65
-		try {
66
-			/** @var INode $destinationNode */
67
-			$destinationNode = $this->server->tree->getNodeForPath($destination);
68
-			if ($destinationNode instanceof Directory) {
69
-				throw new BadRequest("The given destination $destination is a directory.");
70
-			}
71
-		} catch (NotFound $e) {
72
-			// If the destination does not exist yet it's not a directory either ;)
73
-		}
65
+        try {
66
+            /** @var INode $destinationNode */
67
+            $destinationNode = $this->server->tree->getNodeForPath($destination);
68
+            if ($destinationNode instanceof Directory) {
69
+                throw new BadRequest("The given destination $destination is a directory.");
70
+            }
71
+        } catch (NotFound $e) {
72
+            // If the destination does not exist yet it's not a directory either ;)
73
+        }
74 74
 
75
-		$this->verifySize();
76
-		return $this->performMove($sourcePath, $destination);
77
-	}
75
+        $this->verifySize();
76
+        return $this->performMove($sourcePath, $destination);
77
+    }
78 78
 
79
-	/**
80
-	 * Move handler for future file.
81
-	 *
82
-	 * This overrides the default move behavior to prevent Sabre
83
-	 * to delete the target file before moving. Because deleting would
84
-	 * lose the file id and metadata.
85
-	 *
86
-	 * @param string $path source path
87
-	 * @param string $destination destination path
88
-	 * @return bool|void false to stop handling, void to skip this handler
89
-	 */
90
-	public function performMove($path, $destination) {
91
-		$fileExists = $this->server->tree->nodeExists($destination);
92
-		// do a move manually, skipping Sabre's default "delete" for existing nodes
93
-		try {
94
-			$this->server->tree->move($path, $destination);
95
-		} catch (Forbidden $e) {
96
-			$sourceNode = $this->server->tree->getNodeForPath($path);
97
-			if ($sourceNode instanceof FutureFile) {
98
-				$sourceNode->delete();
99
-			}
100
-			throw $e;
101
-		}
79
+    /**
80
+     * Move handler for future file.
81
+     *
82
+     * This overrides the default move behavior to prevent Sabre
83
+     * to delete the target file before moving. Because deleting would
84
+     * lose the file id and metadata.
85
+     *
86
+     * @param string $path source path
87
+     * @param string $destination destination path
88
+     * @return bool|void false to stop handling, void to skip this handler
89
+     */
90
+    public function performMove($path, $destination) {
91
+        $fileExists = $this->server->tree->nodeExists($destination);
92
+        // do a move manually, skipping Sabre's default "delete" for existing nodes
93
+        try {
94
+            $this->server->tree->move($path, $destination);
95
+        } catch (Forbidden $e) {
96
+            $sourceNode = $this->server->tree->getNodeForPath($path);
97
+            if ($sourceNode instanceof FutureFile) {
98
+                $sourceNode->delete();
99
+            }
100
+            throw $e;
101
+        }
102 102
 
103
-		// trigger all default events (copied from CorePlugin::move)
104
-		$this->server->emit('afterMove', [$path, $destination]);
105
-		$this->server->emit('afterUnbind', [$path]);
106
-		$this->server->emit('afterBind', [$destination]);
103
+        // trigger all default events (copied from CorePlugin::move)
104
+        $this->server->emit('afterMove', [$path, $destination]);
105
+        $this->server->emit('afterUnbind', [$path]);
106
+        $this->server->emit('afterBind', [$destination]);
107 107
 
108
-		$response = $this->server->httpResponse;
109
-		$response->setHeader('Content-Length', '0');
110
-		$response->setStatus($fileExists ? 204 : 201);
108
+        $response = $this->server->httpResponse;
109
+        $response->setHeader('Content-Length', '0');
110
+        $response->setStatus($fileExists ? 204 : 201);
111 111
 
112
-		return false;
113
-	}
112
+        return false;
113
+    }
114 114
 
115
-	/**
116
-	 * @throws BadRequest
117
-	 */
118
-	private function verifySize() {
119
-		$expectedSize = $this->server->httpRequest->getHeader('OC-Total-Length');
120
-		if ($expectedSize === null) {
121
-			return;
122
-		}
123
-		$actualSize = $this->sourceNode->getSize();
115
+    /**
116
+     * @throws BadRequest
117
+     */
118
+    private function verifySize() {
119
+        $expectedSize = $this->server->httpRequest->getHeader('OC-Total-Length');
120
+        if ($expectedSize === null) {
121
+            return;
122
+        }
123
+        $actualSize = $this->sourceNode->getSize();
124 124
 
125
-		// casted to string because cast to float cause equality for non equal numbers
126
-		// and integer has the problem of limited size on 32 bit systems
127
-		if ((string)$expectedSize !== (string)$actualSize) {
128
-			throw new BadRequest("Chunks on server do not sum up to $expectedSize but to $actualSize bytes");
129
-		}
130
-	}
125
+        // casted to string because cast to float cause equality for non equal numbers
126
+        // and integer has the problem of limited size on 32 bit systems
127
+        if ((string)$expectedSize !== (string)$actualSize) {
128
+            throw new BadRequest("Chunks on server do not sum up to $expectedSize but to $actualSize bytes");
129
+        }
130
+    }
131 131
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Service/UserTrait.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -31,45 +31,45 @@
 block discarded – undo
31 31
  */
32 32
 trait UserTrait {
33 33
 
34
-	/** @var IUserSession */
35
-	protected $userSession;
34
+    /** @var IUserSession */
35
+    protected $userSession;
36 36
 
37
-	/**
38
-	 * User override
39
-	 *
40
-	 * @var IUser|null
41
-	 */
42
-	private $user = null;
37
+    /**
38
+     * User override
39
+     *
40
+     * @var IUser|null
41
+     */
42
+    private $user = null;
43 43
 
44
-	/**
45
-	 * @return IUser|null
46
-	 */
47
-	protected function getUser() {
48
-		if ($this->user) {
49
-			return $this->user;
50
-		}
51
-		return $this->userSession->getUser();
52
-	}
44
+    /**
45
+     * @return IUser|null
46
+     */
47
+    protected function getUser() {
48
+        if ($this->user) {
49
+            return $this->user;
50
+        }
51
+        return $this->userSession->getUser();
52
+    }
53 53
 
54
-	/**
55
-	 * Override the user from the session
56
-	 * Unset with ->resetUser() when finished!
57
-	 *
58
-	 * @param IUser $user
59
-	 * @return self
60
-	 */
61
-	public function setUser(IUser $user) {
62
-		$this->user = $user;
63
-		return $this;
64
-	}
54
+    /**
55
+     * Override the user from the session
56
+     * Unset with ->resetUser() when finished!
57
+     *
58
+     * @param IUser $user
59
+     * @return self
60
+     */
61
+    public function setUser(IUser $user) {
62
+        $this->user = $user;
63
+        return $this;
64
+    }
65 65
 
66
-	/**
67
-	 * Reset the user override
68
-	 *
69
-	 * @return self
70
-	 */
71
-	public function resetUser() {
72
-		$this->user = null;
73
-		return $this;
74
-	}
66
+    /**
67
+     * Reset the user override
68
+     *
69
+     * @return self
70
+     */
71
+    public function resetUser() {
72
+        $this->user = null;
73
+        return $this;
74
+    }
75 75
 }
Please login to merge, or discard this patch.
apps/encryption/lib/HookManager.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -26,34 +26,34 @@
 block discarded – undo
26 26
 use OCA\Encryption\Hooks\Contracts\IHook;
27 27
 
28 28
 class HookManager {
29
-	/** @var IHook[] */
30
-	private $hookInstances = [];
29
+    /** @var IHook[] */
30
+    private $hookInstances = [];
31 31
 
32
-	/**
33
-	 * @param array|IHook $instances
34
-	 *        - This accepts either a single instance of IHook or an array of instances of IHook
35
-	 * @return bool
36
-	 */
37
-	public function registerHook($instances) {
38
-		if (is_array($instances)) {
39
-			foreach ($instances as $instance) {
40
-				if (!$instance instanceof IHook) {
41
-					return false;
42
-				}
43
-				$this->hookInstances[] = $instance;
44
-			}
45
-		} elseif ($instances instanceof IHook) {
46
-			$this->hookInstances[] = $instances;
47
-		}
48
-		return true;
49
-	}
32
+    /**
33
+     * @param array|IHook $instances
34
+     *        - This accepts either a single instance of IHook or an array of instances of IHook
35
+     * @return bool
36
+     */
37
+    public function registerHook($instances) {
38
+        if (is_array($instances)) {
39
+            foreach ($instances as $instance) {
40
+                if (!$instance instanceof IHook) {
41
+                    return false;
42
+                }
43
+                $this->hookInstances[] = $instance;
44
+            }
45
+        } elseif ($instances instanceof IHook) {
46
+            $this->hookInstances[] = $instances;
47
+        }
48
+        return true;
49
+    }
50 50
 
51
-	public function fireHooks() {
52
-		foreach ($this->hookInstances as $instance) {
53
-			/**
54
-			 * Fire off the add hooks method of each instance stored in cache
55
-			 */
56
-			$instance->addHooks();
57
-		}
58
-	}
51
+    public function fireHooks() {
52
+        foreach ($this->hookInstances as $instance) {
53
+            /**
54
+             * Fire off the add hooks method of each instance stored in cache
55
+             */
56
+            $instance->addHooks();
57
+        }
58
+    }
59 59
 }
Please login to merge, or discard this patch.
lib/private/Search.php 1 patch
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -36,85 +36,85 @@
 block discarded – undo
36 36
  * Provide an interface to all search providers
37 37
  */
38 38
 class Search implements ISearch {
39
-	/** @var Provider[] */
40
-	private $providers = [];
41
-	private $registeredProviders = [];
39
+    /** @var Provider[] */
40
+    private $providers = [];
41
+    private $registeredProviders = [];
42 42
 
43
-	/**
44
-	 * Search all providers for $query
45
-	 * @param string $query
46
-	 * @param string[] $inApps optionally limit results to the given apps
47
-	 * @param int $page pages start at page 1
48
-	 * @param int $size, 0 = all
49
-	 * @return array An array of OC\Search\Result's
50
-	 */
51
-	public function searchPaged($query, array $inApps = [], $page = 1, $size = 30) {
52
-		$this->initProviders();
53
-		$results = [];
54
-		foreach ($this->providers as $provider) {
55
-			if (! $provider->providesResultsFor($inApps)) {
56
-				continue;
57
-			}
58
-			if ($provider instanceof PagedProvider) {
59
-				$results = array_merge($results, $provider->searchPaged($query, $page, $size));
60
-			} elseif ($provider instanceof Provider) {
61
-				$providerResults = $provider->search($query);
62
-				if ($size > 0) {
63
-					$slicedResults = array_slice($providerResults, ($page - 1) * $size, $size);
64
-					$results = array_merge($results, $slicedResults);
65
-				} else {
66
-					$results = array_merge($results, $providerResults);
67
-				}
68
-			} else {
69
-				\OC::$server->getLogger()->warning('Ignoring Unknown search provider', ['provider' => $provider]);
70
-			}
71
-		}
72
-		return $results;
73
-	}
43
+    /**
44
+     * Search all providers for $query
45
+     * @param string $query
46
+     * @param string[] $inApps optionally limit results to the given apps
47
+     * @param int $page pages start at page 1
48
+     * @param int $size, 0 = all
49
+     * @return array An array of OC\Search\Result's
50
+     */
51
+    public function searchPaged($query, array $inApps = [], $page = 1, $size = 30) {
52
+        $this->initProviders();
53
+        $results = [];
54
+        foreach ($this->providers as $provider) {
55
+            if (! $provider->providesResultsFor($inApps)) {
56
+                continue;
57
+            }
58
+            if ($provider instanceof PagedProvider) {
59
+                $results = array_merge($results, $provider->searchPaged($query, $page, $size));
60
+            } elseif ($provider instanceof Provider) {
61
+                $providerResults = $provider->search($query);
62
+                if ($size > 0) {
63
+                    $slicedResults = array_slice($providerResults, ($page - 1) * $size, $size);
64
+                    $results = array_merge($results, $slicedResults);
65
+                } else {
66
+                    $results = array_merge($results, $providerResults);
67
+                }
68
+            } else {
69
+                \OC::$server->getLogger()->warning('Ignoring Unknown search provider', ['provider' => $provider]);
70
+            }
71
+        }
72
+        return $results;
73
+    }
74 74
 
75
-	/**
76
-	 * Remove all registered search providers
77
-	 */
78
-	public function clearProviders() {
79
-		$this->providers = [];
80
-		$this->registeredProviders = [];
81
-	}
75
+    /**
76
+     * Remove all registered search providers
77
+     */
78
+    public function clearProviders() {
79
+        $this->providers = [];
80
+        $this->registeredProviders = [];
81
+    }
82 82
 
83
-	/**
84
-	 * Remove one existing search provider
85
-	 * @param string $provider class name of a OC\Search\Provider
86
-	 */
87
-	public function removeProvider($provider) {
88
-		$this->registeredProviders = array_filter(
89
-			$this->registeredProviders,
90
-			function ($element) use ($provider) {
91
-				return ($element['class'] != $provider);
92
-			}
93
-		);
94
-		// force regeneration of providers on next search
95
-		$this->providers = [];
96
-	}
83
+    /**
84
+     * Remove one existing search provider
85
+     * @param string $provider class name of a OC\Search\Provider
86
+     */
87
+    public function removeProvider($provider) {
88
+        $this->registeredProviders = array_filter(
89
+            $this->registeredProviders,
90
+            function ($element) use ($provider) {
91
+                return ($element['class'] != $provider);
92
+            }
93
+        );
94
+        // force regeneration of providers on next search
95
+        $this->providers = [];
96
+    }
97 97
 
98
-	/**
99
-	 * Register a new search provider to search with
100
-	 * @param string $class class name of a OC\Search\Provider
101
-	 * @param array $options optional
102
-	 */
103
-	public function registerProvider($class, array $options = []) {
104
-		$this->registeredProviders[] = ['class' => $class, 'options' => $options];
105
-	}
98
+    /**
99
+     * Register a new search provider to search with
100
+     * @param string $class class name of a OC\Search\Provider
101
+     * @param array $options optional
102
+     */
103
+    public function registerProvider($class, array $options = []) {
104
+        $this->registeredProviders[] = ['class' => $class, 'options' => $options];
105
+    }
106 106
 
107
-	/**
108
-	 * Create instances of all the registered search providers
109
-	 */
110
-	private function initProviders() {
111
-		if (! empty($this->providers)) {
112
-			return;
113
-		}
114
-		foreach ($this->registeredProviders as $provider) {
115
-			$class = $provider['class'];
116
-			$options = $provider['options'];
117
-			$this->providers[] = new $class($options);
118
-		}
119
-	}
107
+    /**
108
+     * Create instances of all the registered search providers
109
+     */
110
+    private function initProviders() {
111
+        if (! empty($this->providers)) {
112
+            return;
113
+        }
114
+        foreach ($this->registeredProviders as $provider) {
115
+            $class = $provider['class'];
116
+            $options = $provider['options'];
117
+            $this->providers[] = new $class($options);
118
+        }
119
+    }
120 120
 }
Please login to merge, or discard this patch.
core/templates/404.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 /** @var \OCP\Defaults $theme */
5 5
 // @codeCoverageIgnoreStart
6 6
 if (!isset($_)) {//standalone  page is not supported anymore - redirect to /
7
-	require_once '../../lib/base.php';
7
+    require_once '../../lib/base.php';
8 8
 
9
-	$urlGenerator = \OC::$server->getURLGenerator();
10
-	header('Location: ' . $urlGenerator->getAbsoluteURL('/'));
11
-	exit;
9
+    $urlGenerator = \OC::$server->getURLGenerator();
10
+    header('Location: ' . $urlGenerator->getAbsoluteURL('/'));
11
+    exit;
12 12
 }
13 13
 // @codeCoverageIgnoreEnd
14 14
 ?>
Please login to merge, or discard this patch.
apps/settings/lib/Search/AppSearch.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -33,76 +33,76 @@
 block discarded – undo
33 33
 
34 34
 class AppSearch implements IProvider {
35 35
 
36
-	/** @var INavigationManager */
37
-	protected $navigationManager;
38
-
39
-	/** @var IL10N */
40
-	protected $l;
41
-
42
-	public function __construct(INavigationManager $navigationManager,
43
-								IL10N $l) {
44
-		$this->navigationManager = $navigationManager;
45
-		$this->l = $l;
46
-	}
47
-
48
-	/**
49
-	 * @inheritDoc
50
-	 */
51
-	public function getId(): string {
52
-		return 'settings_apps';
53
-	}
54
-
55
-	/**
56
-	 * @inheritDoc
57
-	 */
58
-	public function getName(): string {
59
-		return $this->l->t('Apps');
60
-	}
61
-
62
-	/**
63
-	 * @inheritDoc
64
-	 */
65
-	public function getOrder(string $route, array $routeParameters): int {
66
-		return -50;
67
-	}
68
-
69
-	/**
70
-	 * @inheritDoc
71
-	 */
72
-	public function search(IUser $user, ISearchQuery $query): SearchResult {
73
-		$entries = $this->navigationManager->getAll('all');
74
-
75
-		$result = [];
76
-		foreach ($entries as $entry) {
77
-			if (
78
-				stripos($entry['name'], $query->getTerm()) === false &&
79
-				stripos($entry['id'], $query->getTerm()) === false
80
-			) {
81
-				continue;
82
-			}
83
-
84
-			if (strpos($query->getRoute(), $entry['id'] . '.') === 0) {
85
-				// Skip the current app, unlikely this is intended
86
-				continue;
87
-			}
88
-
89
-			if ($entry['href'] === '') {
90
-				// Nothing we can open, so ignore
91
-				continue;
92
-			}
93
-
94
-			$result[] = new SearchResultEntry(
95
-				'',
96
-				$entry['name'],
97
-				'',
98
-				$entry['href'],
99
-				'icon-confirm'
100
-			);
101
-		}
102
-
103
-		return SearchResult::complete(
104
-			$this->l->t('Apps'),
105
-			$result
106
-		);
107
-	}
36
+    /** @var INavigationManager */
37
+    protected $navigationManager;
38
+
39
+    /** @var IL10N */
40
+    protected $l;
41
+
42
+    public function __construct(INavigationManager $navigationManager,
43
+                                IL10N $l) {
44
+        $this->navigationManager = $navigationManager;
45
+        $this->l = $l;
46
+    }
47
+
48
+    /**
49
+     * @inheritDoc
50
+     */
51
+    public function getId(): string {
52
+        return 'settings_apps';
53
+    }
54
+
55
+    /**
56
+     * @inheritDoc
57
+     */
58
+    public function getName(): string {
59
+        return $this->l->t('Apps');
60
+    }
61
+
62
+    /**
63
+     * @inheritDoc
64
+     */
65
+    public function getOrder(string $route, array $routeParameters): int {
66
+        return -50;
67
+    }
68
+
69
+    /**
70
+     * @inheritDoc
71
+     */
72
+    public function search(IUser $user, ISearchQuery $query): SearchResult {
73
+        $entries = $this->navigationManager->getAll('all');
74
+
75
+        $result = [];
76
+        foreach ($entries as $entry) {
77
+            if (
78
+                stripos($entry['name'], $query->getTerm()) === false &&
79
+                stripos($entry['id'], $query->getTerm()) === false
80
+            ) {
81
+                continue;
82
+            }
83
+
84
+            if (strpos($query->getRoute(), $entry['id'] . '.') === 0) {
85
+                // Skip the current app, unlikely this is intended
86
+                continue;
87
+            }
88
+
89
+            if ($entry['href'] === '') {
90
+                // Nothing we can open, so ignore
91
+                continue;
92
+            }
93
+
94
+            $result[] = new SearchResultEntry(
95
+                '',
96
+                $entry['name'],
97
+                '',
98
+                $entry['href'],
99
+                'icon-confirm'
100
+            );
101
+        }
102
+
103
+        return SearchResult::complete(
104
+            $this->l->t('Apps'),
105
+            $result
106
+        );
107
+    }
108 108
 }
Please login to merge, or discard this patch.