From f23d057ad92d77cbfeda9eed65a4874dc570761e Mon Sep 17 00:00:00 2001 From: Richard de Boer Date: Sat, 10 Apr 2021 14:49:13 +0200 Subject: [PATCH] Fix functions taking optional parameters before required ones PHP 8 shows deprecation warnings about this, see #25806 Removes the "default" values, as they actually are required parameters anyway. Signed-off-by: Richard de Boer --- apps/files/lib/Helper.php | 2 +- core/Controller/PreviewController.php | 4 ++-- lib/private/Files/Config/CachedMountFileInfo.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php index 699caec59e..5ed11bd866 100644 --- a/apps/files/lib/Helper.php +++ b/apps/files/lib/Helper.php @@ -217,7 +217,7 @@ class Helper { * @param ITagManager $tagManager * @return array file list populated with tags */ - public static function populateTags(array $fileList, $fileIdentifier = 'fileid', ITagManager $tagManager) { + public static function populateTags(array $fileList, $fileIdentifier, ITagManager $tagManager) { $ids = []; foreach ($fileList as $fileData) { $ids[] = $fileData[$fileIdentifier]; diff --git a/core/Controller/PreviewController.php b/core/Controller/PreviewController.php index 0b76209408..d46ecc6d15 100644 --- a/core/Controller/PreviewController.php +++ b/core/Controller/PreviewController.php @@ -156,8 +156,8 @@ class PreviewController extends Controller { Node $node, int $x, int $y, - bool $a = false, - bool $forceIcon = true, + bool $a, + bool $forceIcon, string $mode) : Http\Response { if (!($node instanceof File) || (!$forceIcon && !$this->preview->isAvailable($node))) { return new DataResponse([], Http::STATUS_NOT_FOUND); diff --git a/lib/private/Files/Config/CachedMountFileInfo.php b/lib/private/Files/Config/CachedMountFileInfo.php index 7bae52bb65..1ca680e8a1 100644 --- a/lib/private/Files/Config/CachedMountFileInfo.php +++ b/lib/private/Files/Config/CachedMountFileInfo.php @@ -31,7 +31,7 @@ class CachedMountFileInfo extends CachedMountInfo implements ICachedMountFileInf /** @var string */ private $internalPath; - public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId = null, $rootInternalPath = '', $internalPath) { + public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId, $rootInternalPath, $internalPath) { parent::__construct($user, $storageId, $rootId, $mountPoint, $mountId, $rootInternalPath); $this->internalPath = $internalPath; }