Properly annotate exceptions thrown by services

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-07-15 15:01:01 +02:00
parent 2482dc963a
commit dcfb9f3903
10 changed files with 401 additions and 33 deletions

View File

@@ -123,6 +123,10 @@ class AttachmentService {
return $attachments;
}
/**
* @param $cardId
* @return int|mixed
*/
public function count($cardId) {
$count = $this->cache->get('card-' . $cardId);
if (!$count) {
@@ -132,6 +136,14 @@ class AttachmentService {
return $count;
}
/**
* @param $cardId
* @param $type
* @param $data
* @return Attachment|\OCP\AppFramework\Db\Entity
* @throws NoPermissionException
* @throws StatusException
*/
public function create($cardId, $type, $data) {
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT);
@@ -172,7 +184,11 @@ class AttachmentService {
* @param $cardId
* @param $attachmentId
* @return Response
* @throws \OCA\Deck\NotFoundException
* @throws NoPermissionException
* @throws NotFoundException
* @throws \OCP\AppFramework\Db\DoesNotExistException
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
*/
public function display($cardId, $attachmentId) {
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_READ);