Session::offsetUnset()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jasny\SSO\Broker;
6
7
/**
8
 * Use global $_SESSION to persist the client token.
9
 *
10
 * @implements \ArrayAccess<string,mixed>
11
 * @codeCoverageIgnore
12
 */
13
class Session implements \ArrayAccess
14
{
15
    /**
16
     * @inheritDoc
17
     */
18
    public function offsetSet($name, $value): void
19
    {
20
        $_SESSION[$name] = $value;
21
    }
22
23
    /**
24
     * @inheritDoc
25
     */
26
    public function offsetUnset($name): void
27
    {
28
        unset($_SESSION[$name]);
29
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function offsetGet($name)
0 ignored issues
show
introduced by
Return type of Jasny\SSO\Broker\Session::offsetGet($name) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Loading history...
35
    {
36
        return $_SESSION[$name] ?? null;
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42
    public function offsetExists($name): bool
43
    {
44
        return isset($_SESSION[$name]);
45
    }
46
}
47