diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-04-29 15:21:22 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-04-30 09:24:00 +0200 |
commit | ece358825237e7a34b27e54805a0b734962f328b (patch) | |
tree | 65cf3f7d3788d24d71a3ba25f8a03f699e15e2a0 /lib | |
parent | d2de3e998191d3f6240fe9172310678ba328ab90 (diff) | |
download | nextcloud-server-ece358825237e7a34b27e54805a0b734962f328b.tar.gz nextcloud-server-ece358825237e7a34b27e54805a0b734962f328b.zip |
fix: Improve typing of mimetype aliases
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Type/Detection.php | 41 | ||||
-rw-r--r-- | lib/public/Files/IMimeTypeDetector.php | 2 |
2 files changed, 15 insertions, 28 deletions
diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php index 71b8cb986d7..a6944995f4c 100644 --- a/lib/private/Files/Type/Detection.php +++ b/lib/private/Files/Type/Detection.php @@ -56,32 +56,19 @@ class Detection implements IMimeTypeDetector { private const CUSTOM_MIMETYPEMAPPING = 'mimetypemapping.json'; private const CUSTOM_MIMETYPEALIASES = 'mimetypealiases.json'; - protected $mimetypes = []; - protected $secureMimeTypes = []; - - protected $mimetypeIcons = []; - /** @var string[] */ - protected $mimeTypeAlias = []; - - /** @var IURLGenerator */ - private $urlGenerator; - - private LoggerInterface $logger; - - /** @var string */ - private $customConfigDir; - - /** @var string */ - private $defaultConfigDir; - - public function __construct(IURLGenerator $urlGenerator, - LoggerInterface $logger, - string $customConfigDir, - string $defaultConfigDir) { - $this->urlGenerator = $urlGenerator; - $this->logger = $logger; - $this->customConfigDir = $customConfigDir; - $this->defaultConfigDir = $defaultConfigDir; + protected array $mimetypes = []; + protected array $secureMimeTypes = []; + + protected array $mimetypeIcons = []; + /** @var array<string,string> */ + protected array $mimeTypeAlias = []; + + public function __construct( + private IURLGenerator $urlGenerator, + private LoggerInterface $logger, + private string $customConfigDir, + private string $defaultConfigDir, + ) { } /** @@ -151,7 +138,7 @@ class Detection implements IMimeTypeDetector { } /** - * @return string[] + * @return array<string,string> */ public function getAllAliases(): array { $this->loadAliases(); diff --git a/lib/public/Files/IMimeTypeDetector.php b/lib/public/Files/IMimeTypeDetector.php index 9992c153edc..4933975e108 100644 --- a/lib/public/Files/IMimeTypeDetector.php +++ b/lib/public/Files/IMimeTypeDetector.php @@ -84,7 +84,7 @@ interface IMimeTypeDetector { public function mimeTypeIcon($mimeType); /** - * @return string[] + * @return array<string,string> * @since 28.0.0 */ public function getAllAliases(): array; |