Skip to content

Commit 86e3a8a

Browse files
skjnldsvCarlSchwan
andauthored
Apply suggestions from code review
Co-authored-by: Carl Schwan <[email protected]>
1 parent 894c16e commit 86e3a8a

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

apps/accessibility/lib/Controller/AccessibilityController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ private function isDarkThemeEnabled(): bool {
247247
return false;
248248
}
249249
$user = $this->userSession->getUser();
250+
if (!$user) {
251+
return false;
252+
}
250253
return $this->config->getUserValue($user->getUID(), $this->appName, 'theme', false) === 'dark';
251254
}
252255
}

apps/theming/lib/ThemingDefaults.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public function getFDroidClientUrl() {
315315
/**
316316
* @return array scss variables to overwrite
317317
*/
318-
public function getScssVariables($brightBackground = true) {
318+
public function getScssVariables(bool $brightBackground = true) {
319319
$cacheBuster = $this->config->getAppValue('theming', 'cachebuster', '0');
320320
$cache = $this->cacheFactory->createDistributed('theming-' . $cacheBuster . '-' . $this->urlGenerator->getBaseUrl());
321321
if ($value = $cache->get('getScssVariables')) {

lib/private/legacy/OC_Defaults.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public function getColorPrimary() {
311311
/**
312312
* @return array scss variables to overwrite
313313
*/
314-
public function getScssVariables($brightBackground = true) {
314+
public function getScssVariables(bool $brightBackground = true) {
315315
if ($this->themeExist('getScssVariables')) {
316316
return $this->theme->getScssVariables($brightBackground);
317317
}

themes/example/defaults.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function getColorPrimary() {
119119
* Returns variables to overload defaults from core/css/variables.scss
120120
* @return array
121121
*/
122-
public function getScssVariables($brightBackground) {
122+
public function getScssVariables(bool $brightBackground) {
123123
return [
124124
'color-primary' => '#745bca'
125125
];

0 commit comments

Comments
 (0)