diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-04-25 11:53:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-25 11:53:52 +0200 |
commit | c907b68842482d5a535dcf25ce2413f31fa80c6f (patch) | |
tree | f395efe19d29bb4c75b9f7ae71a52f62da26de30 /apps | |
parent | b3a0dec8d54e28aa9f3e91cd93877946f58d696a (diff) | |
parent | 3b3ff39431bb856edd3188c1db536655a511adcd (diff) | |
download | nextcloud-server-c907b68842482d5a535dcf25ce2413f31fa80c6f.tar.gz nextcloud-server-c907b68842482d5a535dcf25ce2413f31fa80c6f.zip |
Merge pull request #9284 from nextcloud/bugfix/9279/strict_sharee_api
Make ShareesAPIController strict
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareesAPIController.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php index 742962e6490..d25f24f6f72 100644 --- a/apps/files_sharing/lib/Controller/ShareesAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -90,7 +91,7 @@ class ShareesAPIController extends OCSController { * @param ISearch $collaboratorSearch */ public function __construct( - $appName, + string $appName, IRequest $request, IConfig $config, IURLGenerator $urlGenerator, @@ -117,7 +118,7 @@ class ShareesAPIController extends OCSController { * @return DataResponse * @throws OCSBadRequestException */ - public function search($search = '', $itemType = null, $page = 1, $perPage = 200, $shareType = null, $lookup = true) { + public function search(string $search = '', string $itemType = null, int $page = 1, int $perPage = 200, $shareType = null, bool $lookup = true): DataResponse { // only search for string larger than a given threshold $threshold = (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0); @@ -205,7 +206,7 @@ class ShareesAPIController extends OCSController { * @param string $itemType * @return bool */ - protected function isRemoteSharingAllowed($itemType) { + protected function isRemoteSharingAllowed(string $itemType): bool { try { // FIXME: static foo makes unit testing unnecessarily difficult $backend = \OC\Share\Share::getBackend($itemType); @@ -223,7 +224,7 @@ class ShareesAPIController extends OCSController { * @param array $params Parameters for the URL * @return string */ - protected function getPaginationLink($page, array $params) { + protected function getPaginationLink(int $page, array $params): string { if ($this->isV2()) { $url = $this->urlGenerator->getAbsoluteURL('/ocs/v2.php/apps/files_sharing/api/v1/sharees') . '?'; } else { @@ -236,7 +237,7 @@ class ShareesAPIController extends OCSController { /** * @return bool */ - protected function isV2() { + protected function isV2(): bool { return $this->request->getScriptName() === '/ocs/v2.php'; } } |