| Conditions | 5 |
| Paths | 12 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function run() |
||
| 25 | { |
||
| 26 | $currentSessionId = session_id(); |
||
| 27 | if (session_status() === PHP_SESSION_ACTIVE) { |
||
| 28 | session_write_close(); |
||
| 29 | } |
||
| 30 | |||
| 31 | foreach ($this->sessionIds as $sessionId) { |
||
| 32 | if ($sessionId === $currentSessionId) { |
||
| 33 | $currentSessionId = null; |
||
| 34 | } |
||
| 35 | |||
| 36 | session_id($sessionId); |
||
| 37 | session_start(); |
||
| 38 | session_destroy(); |
||
| 39 | } |
||
| 40 | |||
| 41 | if ($currentSessionId) { |
||
|
|
|||
| 42 | session_id($currentSessionId); |
||
| 43 | } |
||
| 44 | session_start(); |
||
| 45 | |||
| 46 | return true; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: