diff options
Diffstat (limited to 'lib/private/Preview/MimeIconProvider.php')
-rw-r--r-- | lib/private/Preview/MimeIconProvider.php | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/lib/private/Preview/MimeIconProvider.php b/lib/private/Preview/MimeIconProvider.php index 80073c307c9..d1963fe882b 100644 --- a/lib/private/Preview/MimeIconProvider.php +++ b/lib/private/Preview/MimeIconProvider.php @@ -1,23 +1,8 @@ <?php + /** - * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com> - * - * @author John Molakvoæ <skjnldsv@protonmail.com> - * - * @license AGPL-3.0-or-later - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OC\Preview; @@ -38,7 +23,7 @@ class MimeIconProvider implements IMimeIconProvider { ) { } - public function getMimeIconUrl(string $mime): null|string { + public function getMimeIconUrl(string $mime): ?string { if (!$mime) { return null; } @@ -47,7 +32,7 @@ class MimeIconProvider implements IMimeIconProvider { $aliases = $this->mimetypeDetector->getAllAliases(); // Remove comments - $aliases = array_filter($aliases, static function ($key) { + $aliases = array_filter($aliases, static function (string $key) { return !($key === '' || $key[0] === '_'); }, ARRAY_FILTER_USE_KEY); @@ -70,8 +55,8 @@ class MimeIconProvider implements IMimeIconProvider { return null; } - - private function searchfileName(string $fileName): null|string { + + private function searchfileName(string $fileName): ?string { // If the file exists in the current enabled legacy // custom theme, let's return it $theme = $this->config->getSystemValue('theme', ''); @@ -81,7 +66,7 @@ class MimeIconProvider implements IMimeIconProvider { return $this->urlGenerator->getAbsoluteURL($path); } } - + // Previously, we used to pass this through Theming // But it was only used to colour icons containing // 0082c9. Since with vue we moved to inline svg icons, |