AutoCompleteController::index()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/**
4
 * @author Christoph Wurst <[email protected]>
5
 *
6
 * Mail
7
 *
8
 * This code is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License, version 3,
10
 * as published by the Free Software Foundation.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
 * GNU Affero General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Affero General Public License, version 3,
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
19
 *
20
 */
21
22
namespace OCA\Mail\Controller;
23
24
use OCP\AppFramework\Controller;
25
use OCP\IRequest;
26
use OCA\Mail\Service\AutoCompletion\AutoCompleteService;
27
28
class AutoCompleteController extends Controller {
29
30
	/** @var AutoCompleteService */
31
	private $service;
32
33
	/**
34
	 * @param string $appName
35
	 * @param IRequest $request
36
	 * @param AutoCompleteService $service
37
	 * @param string $UserId
0 ignored issues
show
Bug introduced by
There is no parameter named $UserId. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
38
	 */
39 1
	public function __construct($appName, IRequest $request,
40
		AutoCompleteService $service) {
41 1
		parent::__construct($appName, $request);
42 1
		$this->service = $service;
43 1
	}
44
45
	/**
46
	 * @NoAdminRequired
47
	 * @param string $term
48
	 * @return array
49
	 */
50 1
	public function index($term) {
51 1
		return $this->service->findMatches($term);
52
	}
53
54
}
55