Passed
Push — main ( 78f92c...3e7ef1 )
by Nicolaas
06:43 queued 03:45
created
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/Admin/Extensions/LeftAndMainDarkTheme.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     public function updateClientConfig(array $clientConfig)
35 35
     {
36 36
         Requirements::customCSS(self::generate_display_mode_css(), self::CUSTOM_CODE);
37
-        Requirements::customScript(self::generate_display_mode_js(), self::CUSTOM_CODE . 'JS');
37
+        Requirements::customScript(self::generate_display_mode_js(), self::CUSTOM_CODE.'JS');
38 38
     }
39 39
 
40 40
     public static function get_display_mode_menu_title($class = null, $localise = true): string
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         // use browser setting.
50 50
         $css = '';
51 51
         if (false === LeftAndMainDarkThemeApi::get_is_dark_mode_set_in_database()) {
52
-            $css .= '@media (prefers-color-scheme: dark) {' . $makeDarkCss . '}';
52
+            $css .= '@media (prefers-color-scheme: dark) {'.$makeDarkCss.'}';
53 53
         } elseif (LeftAndMainDarkThemeApi::is_dark_mode()) {
54 54
             $css .= $makeDarkCss;
55 55
         }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             $undetermined = 'true';
69 69
         }
70 70
 
71
-        return $js . <<<js
71
+        return $js.<<<js
72 72
         document.addEventListener("DOMContentLoaded", function() {
73 73
             // Check if the user prefers dark mode
74 74
             const el = document.querySelector(".cms-help__links a[href='/admin/displaymode/']");
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($mode)) {
36
+        if (!self::is_valid_display_mode_setting($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/Model/Extensions/DarkThemePreference.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
             [
49 49
                 OptionsetField::create(
50 50
                     'DarkModeSetting',
51
-                    $fieldLabels['DarkModeSetting'] ?? self::$field_labels['DarkModeSetting'],
51
+                    $fieldLabels[ 'DarkModeSetting' ] ?? self::$field_labels[ 'DarkModeSetting' ],
52 52
                     $this->getOwner()->dbObject('DarkModeSetting')->enumValues()
53 53
                 )
54 54
                     ->setDescription($description),
Please login to merge, or discard this patch.