| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | protected function updateSessionData($key, $value) |
||
|
1 ignored issue
–
show
|
|||
| 37 | { |
||
| 38 | if (is_null($value)) { |
||
| 39 | unset($_SESSION[$key]); |
||
| 40 | } else { |
||
| 41 | $_SESSION[$key] = $value; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 65 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: