Passed
Push — main ( aeb638...595d14 )
by Nicolaas
04:07 queued 02:06
created
src/Model/Extensions/DarkThemePreference.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
             [
30 30
                 OptionsetField::create(
31 31
                     'DarkModeSetting',
32
-                    $fieldLabels['DarkModeSetting'] ?? self::$field_labels['DarkModeSetting'],
32
+                    $fieldLabels[ 'DarkModeSetting' ] ?? self::$field_labels[ 'DarkModeSetting' ],
33 33
                     $this->getOwner()->dbObject('DarkModeSetting')->enumValues()
34 34
                 )
35 35
                     ->setDescription('Using a dark mode may reduce your electricity use. Please reload browser window to see change.'),
Please login to merge, or discard this patch.
src/Control/LeftAndMainDarkThemeToggle.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
      *
45 45
      * @return HTTPResponse
46 46
      */
47
-    public function switch($request)
47
+    public function switch ($request)
48 48
     {
49 49
         $owner = $this->getOwner();
50 50
         if (LeftAndMainDarkThemeApi::is_dark_mode()) {
Please login to merge, or discard this patch.
src/Api/LeftAndMainDarkThemeApi.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
     public static function set_display_mode(string $mode): void
35 35
     {
36
-        if (! self::is_valid_display_mode_setting((string) $mode)) {
36
+        if (!self::is_valid_display_mode_setting((string) $mode)) {
37 37
             user_error('Setting must be Dark or Light');
38 38
         }
39 39
         $member = Security::getCurrentUser();
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
             $config = SiteConfig::current_site_config();
57 57
             if (self::is_valid_display_mode_setting((string) $config->DarkModeSetting)) {
58 58
                 self::$darkModeSetInDatabaseCache = true;
59
-                if (! self::$darkModeValueCache) {
59
+                if (!self::$darkModeValueCache) {
60 60
                     self::$darkModeValueCache = (string) $config->DarkModeSetting;
61 61
                 }
62 62
             }
63
-            if (! self::is_valid_display_mode_setting((string) self::$darkModeValueCache)) {
63
+            if (!self::is_valid_display_mode_setting((string) self::$darkModeValueCache)) {
64 64
                 self::$darkModeValueCache = '';
65 65
             }
66 66
         }
@@ -80,6 +80,6 @@  discard block
 block discarded – undo
80 80
 
81 81
     public static function is_valid_display_mode_setting(string $mode): bool
82 82
     {
83
-        return in_array($mode, ['Dark', 'Light'], true);
83
+        return in_array($mode, [ 'Dark', 'Light' ], true);
84 84
     }
85 85
 }
Please login to merge, or discard this patch.
src/Admin/Extensions/LeftAndMainDarkTheme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
         // use browser setting.
48 48
         $css = '';
49 49
         if (false === LeftAndMainDarkThemeApi::get_is_dark_mode_set_in_database()) {
50
-            $css .= '@media (prefers-color-scheme: dark) {' . $makeDarkCss . '}';
50
+            $css .= '@media (prefers-color-scheme: dark) {'.$makeDarkCss.'}';
51 51
         } elseif (LeftAndMainDarkThemeApi::is_dark_mode()) {
52 52
             $css .= $makeDarkCss;
53 53
         }
Please login to merge, or discard this patch.