diff --git a/apps/theming/lib/Capabilities.php b/apps/theming/lib/Capabilities.php
index b0c6a71731b86..b6020051b4e1f 100644
--- a/apps/theming/lib/Capabilities.php
+++ b/apps/theming/lib/Capabilities.php
@@ -41,33 +41,13 @@
* @package OCA\Theming
*/
class Capabilities implements IPublicCapability {
-
- /** @var ThemingDefaults */
- protected $theming;
-
- /** @var Util */
- protected $util;
-
- /** @var IURLGenerator */
- protected $url;
-
- /** @var IConfig */
- protected $config;
-
- protected IUserSession $userSession;
-
- /**
- * @param ThemingDefaults $theming
- * @param Util $util
- * @param IURLGenerator $url
- * @param IConfig $config
- */
- public function __construct(ThemingDefaults $theming, Util $util, IURLGenerator $url, IConfig $config, IUserSession $userSession) {
- $this->theming = $theming;
- $this->util = $util;
- $this->url = $url;
- $this->config = $config;
- $this->userSession = $userSession;
+ public function __construct(
+ protected ThemingDefaults $theming,
+ protected Util $util,
+ protected IURLGenerator $url,
+ protected IConfig $config,
+ protected IUserSession $userSession,
+ ) {
}
/**
@@ -92,7 +72,7 @@ public function __construct(ThemingDefaults $theming, Util $util, IURLGenerator
* },
* }
*/
- public function getCapabilities() {
+ public function getCapabilities(): array {
$color = $this->theming->getDefaultColorPrimary();
// Same as in DefaultTheme
if ($color === BackgroundService::DEFAULT_COLOR) {
diff --git a/apps/theming/lib/ITheme.php b/apps/theming/lib/ITheme.php
index 4ff455005a2c0..5b3ab6b726676 100644
--- a/apps/theming/lib/ITheme.php
+++ b/apps/theming/lib/ITheme.php
@@ -30,7 +30,6 @@
* @since 25.0.0
*/
interface ITheme {
-
public const TYPE_THEME = 1;
public const TYPE_FONT = 2;
diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php
index 8d6546cdcce33..cb4d7442cc25f 100644
--- a/apps/theming/lib/IconBuilder.php
+++ b/apps/theming/lib/IconBuilder.php
@@ -31,35 +31,18 @@
use OCP\Files\SimpleFS\ISimpleFile;
class IconBuilder {
- /** @var ThemingDefaults */
- private $themingDefaults;
- /** @var Util */
- private $util;
- /** @var ImageManager */
- private $imageManager;
-
- /**
- * IconBuilder constructor.
- *
- * @param ThemingDefaults $themingDefaults
- * @param Util $util
- * @param ImageManager $imageManager
- */
public function __construct(
- ThemingDefaults $themingDefaults,
- Util $util,
- ImageManager $imageManager
+ private ThemingDefaults $themingDefaults,
+ private Util $util,
+ private ImageManager $imageManager,
) {
- $this->themingDefaults = $themingDefaults;
- $this->util = $util;
- $this->imageManager = $imageManager;
}
/**
* @param $app string app name
* @return string|false image blob
*/
- public function getFavicon($app) {
+ public function getFavicon($app): bool|string {
if (!$this->imageManager->shouldReplaceIcons()) {
return false;
}
@@ -102,7 +85,7 @@ public function getFavicon($app) {
* @param $app string app name
* @return string|false image blob
*/
- public function getTouchIcon($app) {
+ public function getTouchIcon($app): bool|string {
try {
$icon = $this->renderAppIcon($app, 512);
if ($icon === false) {
@@ -125,7 +108,7 @@ public function getTouchIcon($app) {
* @param $size int size of the icon in px
* @return Imagick|false
*/
- public function renderAppIcon($app, $size) {
+ public function renderAppIcon($app, $size): Imagick|bool {
$appIcon = $this->util->getAppIcon($app);
if ($appIcon === false) {
return false;
@@ -150,8 +133,8 @@ public function renderAppIcon($app, $size) {
'' .
'';
// resize svg magic as this seems broken in Imagemagick
- if ($mime === "image/svg+xml" || substr($appIconContent, 0, 4) === "