fix: Improve typing of mimetype aliases

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/44533/head
Côme Chilliet 3 weeks ago
parent d2de3e9981
commit ece3588252
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A

@ -31,7 +31,7 @@ class GenerateMimetypeFileBuilder {
/**
* Generate mime type list file
*
* @param array $aliases
* @param array<string,string> $aliases
* @return string
*/
public function generateFile(array $aliases): string {

@ -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();

@ -84,7 +84,7 @@ interface IMimeTypeDetector {
public function mimeTypeIcon($mimeType);
/**
* @return string[]
* @return array<string,string>
* @since 28.0.0
*/
public function getAllAliases(): array;

Loading…
Cancel
Save