Passed
Branch main (74a165)
by Sammy
06:35
created
Smith.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
   // $options : https://www.php.net/manual/fr/session.configuration.php
12 12
   public function __construct($options)
13 13
   {
14
-    if(isset($options['session_name']))
14
+    if (isset($options['session_name']))
15 15
     {
16 16
       session_name($options['session_name']);
17 17
       unset($options['session_name']);
@@ -32,28 +32,28 @@  discard block
 block discarded – undo
32 32
     return isset($_SESSION[$this->index_filter][$filter_name]) && strlen(''.$_SESSION[$this->index_filter][$filter_name]) > 0;
33 33
   }
34 34
 
35
-  public function filters($filter_name=null, $value=null)
35
+  public function filters($filter_name = null, $value = null)
36 36
   {
37
-    if(is_null($filter_name))
37
+    if (is_null($filter_name))
38 38
       return $_SESSION[$this->index_filter];
39 39
 
40
-    if(!is_null($value))
40
+    if (!is_null($value))
41 41
       $_SESSION[$this->index_filter][$filter_name] = $value;
42 42
 
43 43
     return $_SESSION[$this->index_filter][$filter_name] ?? null;
44 44
   }
45 45
 
46
-  public function reset_filters($filter_name=null)
46
+  public function reset_filters($filter_name = null)
47 47
   {
48
-    if(is_null($filter_name))
49
-      $_SESSION[$this->index_filter]=[];
48
+    if (is_null($filter_name))
49
+      $_SESSION[$this->index_filter] = [];
50 50
     else
51 51
       unset($_SESSION[$this->index_filter][$filter_name]);
52 52
   }
53 53
 
54 54
   public function operator_id($setter = null)
55 55
   {
56
-    if(!is_null($setter))
56
+    if (!is_null($setter))
57 57
       $_SESSION[$this->index_operator] = ['id' => $setter, 'set_on' => time()];
58 58
 
59 59
     return $_SESSION[$this->index_operator]['id'] ?? null;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
   public function destroy() : bool
69 69
   {
70 70
 
71
-    if(ini_get("session.use_cookies"))
71
+    if (ini_get("session.use_cookies"))
72 72
     {
73 73
       $params = session_get_cookie_params();
74 74
       setcookie(session_name(), '', time() - 42000,
Please login to merge, or discard this patch.
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,27 +34,31 @@
 block discarded – undo
34 34
 
35 35
   public function filters($filter_name=null, $value=null)
36 36
   {
37
-    if(is_null($filter_name))
38
-      return $_SESSION[$this->index_filter];
37
+    if(is_null($filter_name)) {
38
+          return $_SESSION[$this->index_filter];
39
+    }
39 40
 
40
-    if(!is_null($value))
41
-      $_SESSION[$this->index_filter][$filter_name] = $value;
41
+    if(!is_null($value)) {
42
+          $_SESSION[$this->index_filter][$filter_name] = $value;
43
+    }
42 44
 
43 45
     return $_SESSION[$this->index_filter][$filter_name] ?? null;
44 46
   }
45 47
 
46 48
   public function reset_filters($filter_name=null)
47 49
   {
48
-    if(is_null($filter_name))
49
-      $_SESSION[$this->index_filter]=[];
50
-    else
51
-      unset($_SESSION[$this->index_filter][$filter_name]);
50
+    if(is_null($filter_name)) {
51
+          $_SESSION[$this->index_filter]=[];
52
+    } else {
53
+          unset($_SESSION[$this->index_filter][$filter_name]);
54
+    }
52 55
   }
53 56
 
54 57
   public function operator_id($setter = null)
55 58
   {
56
-    if(!is_null($setter))
57
-      $_SESSION[$this->index_operator] = ['id' => $setter, 'set_on' => time()];
59
+    if(!is_null($setter)) {
60
+          $_SESSION[$this->index_operator] = ['id' => $setter, 'set_on' => time()];
61
+    }
58 62
 
59 63
     return $_SESSION[$this->index_operator]['id'] ?? null;
60 64
   }
Please login to merge, or discard this patch.