Passed
Push — 2.2 ( df6c66...52f601 )
by Myles
01:48
created
scwCookie/scwCookie.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,22 +137,22 @@
 block discarded – undo
137 137
             switch ($lifetimePeriod) {
138 138
                 case 'minute':
139 139
                 case 'minutes':
140
-                    $expiry = time() + (60 * $lifetime);        // 60 = 1 minute
140
+                    $expiry = time() + (60 * $lifetime); // 60 = 1 minute
141 141
                     break;
142 142
 
143 143
                 case 'hour':
144 144
                 case 'hours':
145
-                    $expiry = time() + (3600 * $lifetime);      // 3600 = 1 hour
145
+                    $expiry = time() + (3600 * $lifetime); // 3600 = 1 hour
146 146
                     break;
147 147
 
148 148
                 case 'day':
149 149
                 case 'days':
150
-                    $expiry = time() + (86400 * $lifetime);     // 86400 = 1 day
150
+                    $expiry = time() + (86400 * $lifetime); // 86400 = 1 day
151 151
                     break;
152 152
 
153 153
                 case 'week':
154 154
                 case 'weeks':
155
-                    $expiry = time() + (604800 * $lifetime);    // 604800 = 1 week
155
+                    $expiry = time() + (604800 * $lifetime); // 604800 = 1 week
156 156
                     break;
157 157
                 
158 158
                 default:
Please login to merge, or discard this patch.
scwCookie/ajax.php 1 patch
Switch Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -7,34 +7,34 @@
 block discarded – undo
7 7
 }
8 8
 
9 9
 switch ($_POST['action']) {
10
-    case 'hide':
11
-        // Set cookie
12
-        ScwCookie\ScwCookie::setCookie('scwCookieHidden', 'true', 52, 'weeks');
13
-        header('Content-Type: application/json');
14
-        die(json_encode(['success' => true]));
15
-        break;
10
+        case 'hide':
11
+            // Set cookie
12
+            ScwCookie\ScwCookie::setCookie('scwCookieHidden', 'true', 52, 'weeks');
13
+            header('Content-Type: application/json');
14
+            die(json_encode(['success' => true]));
15
+            break;
16 16
 
17
-    case 'toggle':
18
-        // Update if cookie allowed or not
19
-        $choices = ScwCookie\ScwCookie::getCookie('scwCookie');
20
-        if ($choices == false) {
21
-            $choices = [];
22
-            $scwCookie = new ScwCookie\ScwCookie;
23
-            $enabledCookies = $scwCookie->enabledCookies();
24
-            foreach ($enabledCookies as $name => $label) {
25
-                $choices[$name] = $scwCookie->config['unsetDefault'];
17
+        case 'toggle':
18
+            // Update if cookie allowed or not
19
+            $choices = ScwCookie\ScwCookie::getCookie('scwCookie');
20
+            if ($choices == false) {
21
+                $choices = [];
22
+                $scwCookie = new ScwCookie\ScwCookie;
23
+                $enabledCookies = $scwCookie->enabledCookies();
24
+                foreach ($enabledCookies as $name => $label) {
25
+                    $choices[$name] = $scwCookie->config['unsetDefault'];
26
+                }
27
+                ScwCookie\ScwCookie::setCookie('scwCookie', ScwCookie\ScwCookie::encrypt($choices), 52, 'weeks');
28
+            } else {
29
+                $choices = ScwCookie\ScwCookie::decrypt($choices);
26 30
             }
27
-            ScwCookie\ScwCookie::setCookie('scwCookie', ScwCookie\ScwCookie::encrypt($choices), 52, 'weeks');
28
-        } else {
29
-            $choices = ScwCookie\ScwCookie::decrypt($choices);
30
-        }
31
-        $choices[$_POST['name']] = $_POST['value'] == 'true' ? 'allowed' : 'blocked';
32
-        $choices = ScwCookie\ScwCookie::encrypt($choices);
33
-        ScwCookie\ScwCookie::setCookie('scwCookie', $choices, 52, 'weeks');
34
-        break;
31
+            $choices[$_POST['name']] = $_POST['value'] == 'true' ? 'allowed' : 'blocked';
32
+            $choices = ScwCookie\ScwCookie::encrypt($choices);
33
+            ScwCookie\ScwCookie::setCookie('scwCookie', $choices, 52, 'weeks');
34
+            break;
35 35
 
36
-    default:
37
-        header('HTTP/1.0 403 Forbidden');
38
-        throw new Exception("Action not recognised");
39
-        break;
36
+        default:
37
+            header('HTTP/1.0 403 Forbidden');
38
+            throw new Exception("Action not recognised");
39
+            break;
40 40
 }
Please login to merge, or discard this patch.