From d5efd17942cc901b82ccc4717b6bf755dc565997 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 18 Mar 2025 14:25:26 +0100 Subject: fix(IMimeTypeDetector): use correct return type In PHP array keys that are integers are always kept as integer, meaning the type of the key of `$a = ["1" => "one"]` will be integer not string. While are hacks to circumvent this (case std object with string keys to an assoc. array) those hacks are performance wise awefull and also not needed as in PHP you can always access that element with `$a[1]` or `$a["1"]`. So TL;DR;: do not lie about return types. Signed-off-by: Ferdinand Thiessen --- lib/private/Files/Type/Detection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/private/Files') diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php index 48907b3473f..09d73231f22 100644 --- a/lib/private/Files/Type/Detection.php +++ b/lib/private/Files/Type/Detection.php @@ -23,7 +23,7 @@ class Detection implements IMimeTypeDetector { private const CUSTOM_MIMETYPEMAPPING = 'mimetypemapping.json'; private const CUSTOM_MIMETYPEALIASES = 'mimetypealiases.json'; - /** @var array */ + /** @var array */ protected array $mimetypes = []; protected array $secureMimeTypes = []; @@ -140,7 +140,7 @@ class Detection implements IMimeTypeDetector { } /** - * @return array + * @return array */ public function getAllMappings(): array { $this->loadMappings(); -- cgit v1.2.3