SessionException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 29
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A alreadyStarted() 0 4 1
A headersAlreadySent() 0 4 1
A couldNotStart() 0 4 1
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