GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Sessions::isStarted()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 3
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
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