aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-09-19 11:10:31 +0200
committerprovokateurin <kate@provokateurin.de>2024-09-19 14:21:20 +0200
commit9836e9b16484582d309c8437ab46d82e34956941 (patch)
treed3da87bb7dfd1a8877ed25072ecf609def844089 /apps/theming
parent8c60ffa0f21414e6e671c567d664a9b9e5253e26 (diff)
downloadnextcloud-server-9836e9b16484582d309c8437ab46d82e34956941.tar.gz
nextcloud-server-9836e9b16484582d309c8437ab46d82e34956941.zip
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/lib/Controller/IconController.php2
-rw-r--r--apps/theming/lib/IconBuilder.php6
-rw-r--r--apps/theming/lib/Jobs/MigrateBackgroundImages.php4
-rw-r--r--apps/theming/lib/Jobs/RestoreBackgroundImageColor.php6
-rw-r--r--apps/theming/lib/Listener/BeforeTemplateRenderedListener.php2
-rw-r--r--apps/theming/lib/Service/BackgroundService.php4
-rw-r--r--apps/theming/lib/Service/ThemesService.php3
-rw-r--r--apps/theming/lib/ThemingDefaults.php10
-rw-r--r--apps/theming/lib/Util.php2
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php6
-rw-r--r--apps/theming/tests/IconBuilderTest.php6
11 files changed, 26 insertions, 25 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php
index bdd5a43ddc3..7ba9e801d9b 100644
--- a/apps/theming/lib/Controller/IconController.php
+++ b/apps/theming/lib/Controller/IconController.php
@@ -40,7 +40,7 @@ class IconController extends Controller {
IconBuilder $iconBuilder,
ImageManager $imageManager,
FileAccessHelper $fileAccessHelper,
- IAppManager $appManager
+ IAppManager $appManager,
) {
parent::__construct($appName, $request);
diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php
index e7e83a0b4c0..5e8754dec83 100644
--- a/apps/theming/lib/IconBuilder.php
+++ b/apps/theming/lib/IconBuilder.php
@@ -27,7 +27,7 @@ class IconBuilder {
public function __construct(
ThemingDefaults $themingDefaults,
Util $util,
- ImageManager $imageManager
+ ImageManager $imageManager,
) {
$this->themingDefaults = $themingDefaults;
$this->util = $util;
@@ -127,12 +127,12 @@ class IconBuilder {
$cornerRadius = 0.2 * $size;
$background = '<?xml version="1.0" encoding="UTF-8"?>' .
'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:cc="http://creativecommons.org/ns#" width="' . $size . '" height="' . $size . '" xmlns:xlink="http://www.w3.org/1999/xlink">' .
- '<rect x="0" y="0" rx="' . $cornerRadius . '" ry="' . $cornerRadius . '" width="' . $size. '" height="' . $size . '" style="fill:' . $color . ';" />' .
+ '<rect x="0" y="0" rx="' . $cornerRadius . '" ry="' . $cornerRadius . '" width="' . $size . '" height="' . $size . '" style="fill:' . $color . ';" />' .
'</svg>';
// resize svg magic as this seems broken in Imagemagick
if ($mime === 'image/svg+xml' || substr($appIconContent, 0, 4) === '<svg') {
if (substr($appIconContent, 0, 5) !== '<?xml') {
- $svg = '<?xml version="1.0"?>'.$appIconContent;
+ $svg = '<?xml version="1.0"?>' . $appIconContent;
} else {
$svg = $appIconContent;
}
diff --git a/apps/theming/lib/Jobs/MigrateBackgroundImages.php b/apps/theming/lib/Jobs/MigrateBackgroundImages.php
index aff13fc2910..6bf1dd4e5bc 100644
--- a/apps/theming/lib/Jobs/MigrateBackgroundImages.php
+++ b/apps/theming/lib/Jobs/MigrateBackgroundImages.php
@@ -42,7 +42,7 @@ class MigrateBackgroundImages extends QueuedJob {
IJobList $jobList,
IDBConnection $dbc,
IAppData $appData,
- LoggerInterface $logger
+ LoggerInterface $logger,
) {
parent::__construct($time);
$this->appDataFactory = $appDataFactory;
@@ -54,7 +54,7 @@ class MigrateBackgroundImages extends QueuedJob {
protected function run(mixed $argument): void {
if (!is_array($argument) || !isset($argument['stage'])) {
- throw new \Exception('Job '.self::class.' called with wrong argument');
+ throw new \Exception('Job ' . self::class . ' called with wrong argument');
}
switch ($argument['stage']) {
diff --git a/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php b/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php
index 1ec659d0646..42662dacef2 100644
--- a/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php
+++ b/apps/theming/lib/Jobs/RestoreBackgroundImageColor.php
@@ -42,7 +42,7 @@ class RestoreBackgroundImageColor extends QueuedJob {
protected function run(mixed $argument): void {
if (!is_array($argument) || !isset($argument['stage'])) {
- throw new \Exception('Job '.self::class.' called with wrong argument');
+ throw new \Exception('Job ' . self::class . ' called with wrong argument');
}
switch ($argument['stage']) {
@@ -69,7 +69,7 @@ class RestoreBackgroundImageColor extends QueuedJob {
// Get those users, that have a background_image set - not the default, but no background_color.
$result = $qb->selectDistinct('a.userid')
->from('preferences', 'a')
- ->leftJoin('a', $qb->createFunction('('.$innerSQL->getSQL().')'), 'b', 'a.userid = b.userid')
+ ->leftJoin('a', $qb->createFunction('(' . $innerSQL->getSQL() . ')'), 'b', 'a.userid = b.userid')
->where($qb2->expr()->eq('a.configkey', $qb->createNamedParameter('background_image')))
->andWhere($qb2->expr()->neq('a.configvalue', $qb->createNamedParameter(BackgroundService::BACKGROUND_DEFAULT)))
->andWhere($qb2->expr()->isNull('b.userid'))
@@ -101,7 +101,7 @@ class RestoreBackgroundImageColor extends QueuedJob {
}
$background = $this->config->getUserValue($userId, Application::APP_ID, 'background_image');
- switch($background) {
+ switch ($background) {
case BackgroundService::BACKGROUND_DEFAULT:
$this->service->setDefaultBackground($userId);
break;
diff --git a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php
index cb72e46360e..2ad495b0239 100644
--- a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php
+++ b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php
@@ -35,7 +35,7 @@ class BeforeTemplateRenderedListener implements IEventListener {
ContainerInterface $container,
ThemeInjectionService $themeInjectionService,
IUserSession $userSession,
- IConfig $config
+ IConfig $config,
) {
$this->initialState = $initialState;
$this->container = $container;
diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php
index a0158dcb667..bf650874448 100644
--- a/apps/theming/lib/Service/BackgroundService.php
+++ b/apps/theming/lib/Service/BackgroundService.php
@@ -321,7 +321,7 @@ class BackgroundService {
* @param resource|string $path
* @return string|null The fallback background color - if any
*/
- public function setGlobalBackground($path): string|null {
+ public function setGlobalBackground($path): ?string {
$image = new \OCP\Image();
$handle = is_resource($path) ? $path : fopen($path, 'rb');
@@ -347,7 +347,7 @@ class BackgroundService {
$hex = dechex($channel);
return match (strlen($hex)) {
0 => '00',
- 1 => '0'.$hex,
+ 1 => '0' . $hex,
2 => $hex,
default => 'ff',
};
diff --git a/apps/theming/lib/Service/ThemesService.php b/apps/theming/lib/Service/ThemesService.php
index 49cd72d4255..ef8d1ff44ff 100644
--- a/apps/theming/lib/Service/ThemesService.php
+++ b/apps/theming/lib/Service/ThemesService.php
@@ -31,7 +31,8 @@ class ThemesService {
private DarkTheme $darkTheme,
HighContrastTheme $highContrastTheme,
DarkHighContrastTheme $darkHighContrastTheme,
- DyslexiaFont $dyslexiaFont) {
+ DyslexiaFont $dyslexiaFont,
+ ) {
// Register themes
$this->themesProviders = [
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 9be830a61fd..42c96557ba7 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -123,7 +123,7 @@ class ThemingDefaults extends \OC_Defaults {
$footer = '<a href="' . $baseUrl . '" target="_blank"' .
' rel="noreferrer noopener" class="entity-name">' . $entity . '</a>';
} else {
- $footer = '<span class="entity-name">' .$entity . '</span>';
+ $footer = '<span class="entity-name">' . $entity . '</span>';
}
}
$footer .= ($slogan !== '' ? ' – ' . $slogan : '');
@@ -340,10 +340,10 @@ class ThemingDefaults extends \OC_Defaults {
'theming-favicon-mime' => "'" . $this->config->getAppValue('theming', 'faviconMime') . "'"
];
- $variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')";
- $variables['image-logoheader'] = "url('".$this->imageManager->getImageUrl('logoheader')."')";
- $variables['image-favicon'] = "url('".$this->imageManager->getImageUrl('favicon')."')";
- $variables['image-login-background'] = "url('".$this->imageManager->getImageUrl('background')."')";
+ $variables['image-logo'] = "url('" . $this->imageManager->getImageUrl('logo') . "')";
+ $variables['image-logoheader'] = "url('" . $this->imageManager->getImageUrl('logoheader') . "')";
+ $variables['image-favicon'] = "url('" . $this->imageManager->getImageUrl('favicon') . "')";
+ $variables['image-login-background'] = "url('" . $this->imageManager->getImageUrl('background') . "')";
$variables['image-login-plain'] = 'false';
if ($this->appConfig->getValueString(Application::APP_ID, 'primary_color', '') !== '') {
diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php
index 809ff53f5e1..839ef1d0b46 100644
--- a/apps/theming/lib/Util.php
+++ b/apps/theming/lib/Util.php
@@ -189,7 +189,7 @@ class Util {
*/
public function generateRadioButton($color) {
$radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">' .
- '<path d="M8 1a7 7 0 0 0-7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0-7-7zm0 1a6 6 0 0 1 6 6 6 6 0 0 1-6 6 6 6 0 0 1-6-6 6 6 0 0 1 6-6zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8z" fill="'.$color.'"/></svg>';
+ '<path d="M8 1a7 7 0 0 0-7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0-7-7zm0 1a6 6 0 0 1 6 6 6 6 0 0 1-6 6 6 6 0 0 1-6-6 6 6 0 0 1 6-6zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8z" fill="' . $color . '"/></svg>';
return base64_encode($radioButtonIcon);
}
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index d69ceefa0e5..6ce808253a0 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -256,7 +256,7 @@ class ThemingControllerTest extends TestCase {
->method('getUploadedFile')
->with('image')
->willReturn([
- 'tmp_name' => __DIR__ . '/../../../../tests/data/testimagelarge.svg',
+ 'tmp_name' => __DIR__ . '/../../../../tests/data/testimagelarge.svg',
'type' => 'image/svg',
'name' => 'testimagelarge.svg',
'error' => 0,
@@ -297,7 +297,7 @@ class ThemingControllerTest extends TestCase {
->method('getUploadedFile')
->with('image')
->willReturn([
- 'tmp_name' => __DIR__ . '/../../../../tests/data/lorem.txt',
+ 'tmp_name' => __DIR__ . '/../../../../tests/data/lorem.txt',
'type' => 'application/pdf',
'name' => 'logo.pdf',
'error' => 0,
@@ -443,7 +443,7 @@ class ThemingControllerTest extends TestCase {
$tmpLogo = \OC::$server->getTempManager()->getTemporaryFolder() . '/logo.svg';
touch($tmpLogo);
- file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/data.zip'));
+ file_put_contents($tmpLogo, file_get_contents(__DIR__ . '/../../../../tests/data/data.zip'));
$this->request
->expects($this->once())
->method('getParam')
diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php
index 942bcf399fa..bef48448bfa 100644
--- a/apps/theming/tests/IconBuilderTest.php
+++ b/apps/theming/tests/IconBuilderTest.php
@@ -84,7 +84,7 @@ class IconBuilderTest extends TestCase {
->with('global/images')
->willThrowException(new NotFoundException());
- $expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file);
+ $expectedIcon = new \Imagick(realpath(__DIR__) . '/data/' . $file);
$icon = $this->iconBuilder->renderAppIcon($app, 512);
$this->assertEquals(true, $icon->valid());
@@ -113,7 +113,7 @@ class IconBuilderTest extends TestCase {
->with('global/images')
->willThrowException(new NotFoundException());
- $expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file);
+ $expectedIcon = new \Imagick(realpath(__DIR__) . '/data/' . $file);
$icon = new \Imagick();
$icon->readImageBlob($this->iconBuilder->getTouchIcon($app));
@@ -146,7 +146,7 @@ class IconBuilderTest extends TestCase {
->with('global/images')
->willThrowException(new NotFoundException());
- $expectedIcon = new \Imagick(realpath(__DIR__). '/data/' . $file);
+ $expectedIcon = new \Imagick(realpath(__DIR__) . '/data/' . $file);
$actualIcon = $this->iconBuilder->getFavicon($app);
$icon = new \Imagick();