mirror of https://github.com/nextcloud/server
fix: Improve typing of mimetype aliases
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
d2de3e9981
commit
ece3588252
|
@ -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 array $mimetypes = [];
|
||||
protected array $secureMimeTypes = [];
|
||||
|
||||
protected $mimetypeIcons = [];
|
||||
/** @var string[] */
|
||||
protected $mimeTypeAlias = [];
|
||||
protected array $mimetypeIcons = [];
|
||||
/** @var array<string,string> */
|
||||
protected array $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;
|
||||
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…
Reference in New Issue