Sessions   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A isStarted() 0 11 3
1
<?php
2
3
namespace BFW\Helpers;
4
5
/**
6
 * Helpers to manage sessions
7
 */
8
class Sessions
9
{
10
    /**
11
     * Check if the session is started
12
     * 
13
     * @link http://fr2.php.net/manual/en/function.session-status.php#113468
14
     * 
15
     * @return boolean
16
     */
17
    public static function isStarted(): bool
18
    {
19
        if (PHP_SAPI === 'cli') {
20
            return false;
21
        }
22
23
        if (session_status() === PHP_SESSION_ACTIVE) {
24
            return true;
25
        }
26
27
        return false;
28
    }
29
}
30