1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author Tahaa Karim <[email protected]> |
4
|
|
|
* |
5
|
|
|
* ownCloud - Mail |
6
|
|
|
* |
7
|
|
|
* This code is free software: you can redistribute it and/or modify |
8
|
|
|
* it under the terms of the GNU Affero General Public License, version 3, |
9
|
|
|
* as published by the Free Software Foundation. |
10
|
|
|
* |
11
|
|
|
* This program is distributed in the hope that it will be useful, |
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14
|
|
|
* GNU Affero General Public License for more details. |
15
|
|
|
* |
16
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3, |
17
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/> |
18
|
|
|
* |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace OCA\Mail\Controller; |
22
|
|
|
|
23
|
|
|
use OCP\IRequest; |
24
|
|
|
use OCA\Mail\Service\AliasesService; |
25
|
|
|
use OCP\AppFramework\Controller; |
26
|
|
|
use OCP\AppFramework\Db\DoesNotExistException; |
27
|
|
|
use OCP\AppFramework\Http\JSONResponse; |
28
|
|
|
use OCP\AppFramework\Http; |
29
|
|
|
|
30
|
|
|
class AliasesController extends Controller { |
31
|
|
|
|
32
|
|
|
/** @var AliasesService */ |
33
|
|
|
private $aliasService; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var string |
37
|
|
|
*/ |
38
|
|
|
private $currentUserId; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param string $appName |
42
|
|
|
* @param IRequest $request |
43
|
|
|
* @param AliasesService $AliasService |
|
|
|
|
44
|
|
|
* @param $UserId |
45
|
|
|
*/ |
46
|
|
|
public function __construct($appName, IRequest $request, AliasesService $aliasesService, $UserId) { |
47
|
|
|
parent::__construct($appName, $request); |
48
|
|
|
$this->aliasService = $aliasesService; |
49
|
|
|
$this->currentUserId = $UserId; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @NoAdminRequired |
54
|
|
|
* @NoCSRFRequired |
55
|
|
|
* @param int $accountId |
56
|
|
|
*/ |
57
|
|
|
public function index($accountId) { |
58
|
|
|
//return new DataResponse($this->aliasService->findAll($this->accountId)); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @NoAdminRequired |
63
|
|
|
* @NoCSRFRequired |
64
|
|
|
*/ |
65
|
|
|
public function show() { |
66
|
|
|
$response = new JSONResponse(); |
67
|
|
|
$response->setStatus(Http::STATUS_NOT_IMPLEMENTED); |
68
|
|
|
return $response; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @NoAdminRequired |
73
|
|
|
* @NoCSRFRequired |
74
|
|
|
* @param int $accountId |
|
|
|
|
75
|
|
|
*/ |
76
|
|
|
public function update($id, $alias) { |
77
|
|
|
return $this->aliasService->update($id, $alias); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @NoAdminRequired |
82
|
|
|
* @NoCSRFRequired |
83
|
|
|
* @param int $accountId |
|
|
|
|
84
|
|
|
*/ |
85
|
|
|
public function destroy($id) { |
86
|
|
|
return $this->aliasService->delete($id); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @NoAdminRequired |
91
|
|
|
* @NoCSRFRequired |
92
|
|
|
* @param int $accountId |
93
|
|
|
*/ |
94
|
|
|
public function create($accountId, $alias) { |
95
|
|
|
return $this->aliasService->create($accountId, $alias); |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|
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.