Passed
Push — main ( 8522a5...443191 )
by Sammy
16:36 queued 09:15
created
Smith.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,20 +20,20 @@  discard block
 block discarded – undo
20 20
         return self::$instance;
21 21
     }
22 22
 
23
-    private static function sessionsAreDisabled(){
23
+    private static function sessionsAreDisabled() {
24 24
       return session_status() === PHP_SESSION_DISABLED;
25 25
     }
26 26
 
27
-    private static function hasNoSession(){
27
+    private static function hasNoSession() {
28 28
       return session_status() === PHP_SESSION_NONE;
29 29
     }
30 30
 
31 31
     private function __construct($options = [])
32 32
     {
33
-        if(self::sessionsAreDisabled())
34
-          throw new \UnexpectedValueException(__CLASS__ . '::PHP_SESSION_DISABLED');
33
+        if (self::sessionsAreDisabled())
34
+          throw new \UnexpectedValueException(__CLASS__.'::PHP_SESSION_DISABLED');
35 35
 
36
-        if(self::hasNoSession()){
36
+        if (self::hasNoSession()) {
37 37
           session_name($options['session_name'] ?? StateAgentInterface::DEFAULT_SESSION_NAME);
38 38
           unset($options['session_name']);
39 39
           session_start($options); // https://www.php.net/manual/fr/function.session-start.php
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     // camelCase wrapper for setcookie, coherent with getCookie
56 56
     public function setCookie($name, $value = "", $expires_in = 365 * 24 * 60 * 60, $path = "/", $domain = "", $secure = false, $httponly = false): bool
57 57
     {
58
-        return setcookie($name, $value, time() + $expires_in, $path, $domain, $secure, $httponly);
58
+        return setcookie($name, $value, time()+$expires_in, $path, $domain, $secure, $httponly);
59 59
     }
60 60
 
61 61
     // returns the value stored or null
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
     public function hasFilter($filter_name): bool
103 103
     {
104
-        return isset($_SESSION[self::INDEX_FILTER][$filter_name]) && strlen('' . $_SESSION[self::INDEX_FILTER][$filter_name]) > 0;
104
+        return isset($_SESSION[self::INDEX_FILTER][$filter_name]) && strlen(''.$_SESSION[self::INDEX_FILTER][$filter_name]) > 0;
105 105
     }
106 106
 
107 107
     public function addFilter($filter_name, $value)
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             setcookie(
152 152
                 session_name(),
153 153
                 '',
154
-                time() - 42000,
154
+                time()-42000,
155 155
                 $params["path"],
156 156
                 $params["domain"],
157 157
                 $params["secure"],
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@
 block discarded – undo
30 30
 
31 31
     private function __construct($options = [])
32 32
     {
33
-        if(self::sessionsAreDisabled())
34
-          throw new \UnexpectedValueException(__CLASS__ . '::PHP_SESSION_DISABLED');
33
+        if(self::sessionsAreDisabled()) {
34
+                  throw new \UnexpectedValueException(__CLASS__ . '::PHP_SESSION_DISABLED');
35
+        }
35 36
 
36 37
         if(self::hasNoSession()){
37 38
           session_name($options['session_name'] ?? StateAgentInterface::DEFAULT_SESSION_NAME);
Please login to merge, or discard this patch.