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 |
|
|
|
|
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
|
|
|
|
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 methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.