Completed
Pull Request — master (#1276)
by Thomas
04:23
created

AutoCompleteController::index()   A

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 3
Bugs 0 Features 2
Metric Value
c 3
b 0
f 2
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/**
4
 * ownCloud - Mail
5
 *
6
 * This file is licensed under the Affero General Public License version 3 or
7
 * later. See the COPYING file.
8
 *
9
 * @author Christoph Wurst <[email protected]>
10
 * @copyright Christoph Wurst 2016
11
 */
12
13
namespace OCA\Mail\Controller;
14
15
use OCP\AppFramework\Controller;
16
use OCP\IRequest;
17
use OCA\Mail\Service\AutoCompletion\AutoCompleteService;
18
19
class AutoCompleteController extends Controller {
20
21
	/** @var AutoCompleteService */
22
	private $service;
23
24
	/**
25
	 * @param string $appName
26
	 * @param IRequest $request
27
	 * @param AutoCompleteService $service
28
	 * @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...
29
	 */
30 1
	public function __construct($appName, IRequest $request,
31
		AutoCompleteService $service) {
32 1
		parent::__construct($appName, $request);
33 1
		$this->service = $service;
34 1
	}
35
36
	/**
37
	 * @NoAdminRequired
38
	 * @param string $term
39
	 * @return array
40
	 */
41 1
	public function index($term) {
42 1
		return $this->service->findMatches($term);
43
	}
44
45
}
46