SessionException::alreadyStarted()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
5
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
6
 *
7
 * Licensed under The MIT License
8
 * For full copyright and license information, please see the LICENSE.txt
9
 * Redistributions of files must retain the above copyright notice.
10
 *
11
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
12
 * @link          https://cakephp.org CakePHP(tm) Project
13
 * @since         0.10.0
14
 * @license       https://opensource.org/licenses/mit-license.php MIT License
15
 */
16
17
declare(strict_types=1);
18
19
namespace Phauthentic\Infrastructure\Http\Session;
20
21
use Exception;
22
23
/**
24
 * SessionException
25
 */
26
class SessionException extends Exception
27
{
28
    /**
29
     * @return self
30
     */
31
    public static function headersAlreadySent(): self
32
    {
33
        return new self(
34
            'Headers already sent. You can\'t set the session id anymore'
35
        );
36
    }
37
38
    /**
39
     * @return self
40
     */
41
    public static function couldNotStart(): self
42
    {
43
        return new self(
44
            'Could not start the session'
45
        );
46
    }
47
48
    /**
49
     * @return self
50
     */
51
    public static function alreadyStarted(): self
52
    {
53
        return new self(
54
            'Session was already started'
55
        );
56
    }
57
}
58