aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-04-23 22:05:21 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-04-23 22:05:21 +0200
commit3b3ff39431bb856edd3188c1db536655a511adcd (patch)
treea70f3d7bce11797e39f73d35ab99e85445cb1b7d /apps/files_sharing
parent83b0ce0955bc5ff92cec54aeb8a35dd798221dfc (diff)
downloadnextcloud-server-3b3ff39431bb856edd3188c1db536655a511adcd.tar.gz
nextcloud-server-3b3ff39431bb856edd3188c1db536655a511adcd.zip
Make ShareesAPIController strict
Fixes #9279 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/Controller/ShareesAPIController.php11
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';
}
}