SearchProvider::search()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * ownCloud - Tasks
4
 *
5
 * @author Raimund Schlüßler
6
 * @copyright 2017 Raimund Schlüßler [email protected]
7
 *
8
 * This library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
10
 * License as published by the Free Software Foundation; either
11
 * version 3 of the License, or any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public
19
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
20
 *
21
 */
22
23
namespace OCA\Tasks\Controller;
24
25
use OCA\Tasks\AppInfo\Application;
26
27
/**
28
 * Tasks search provider
29
 */
30
class SearchProvider extends \OCP\Search\Provider {
31
32
	// private $tasksService;
33
34
	public function __construct() {
35
		$app = new Application();
36
		$container = $app->getContainer();
0 ignored issues
show
Unused Code introduced by
$container is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
37
		$this->app = $app;
38
		// $this->tasksService = $container->query('TasksService');
39
	}
40
41
42
	/**
43
	 * Search for query in tasks
44
	 *
45
	 * @param string $query
46
	 * @return array
47
	 */
48
	public function search($query) {
49
		return array();
50
		// return $this->tasksService->search($query);
51
	}
52
}
53