Completed
Push — master ( e4c888...b002ee )
by Alexander
10:41 queued 05:38
created

BeforeLogout   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 23
ccs 0
cts 15
cp 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 3 1
A invalidate() 0 3 1
A getIdentity() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Yiisoft\Yii\Web\User\Event;
4
5
use Yiisoft\Yii\Web\User\IdentityInterface;
6
7
class BeforeLogout
8
{
9
    private $identity;
10
    private $isValid = true;
11
12
    public function __construct(IdentityInterface $identity)
13
    {
14
        $this->identity = $identity;
15
    }
16
17
    public function invalidate(): void
18
    {
19
        $this->isValid = false;
20
    }
21
22
    public function isValid(): bool
23
    {
24
        return $this->isValid;
25
    }
26
27
    public function getIdentity(): IdentityInterface
28
    {
29
        return $this->identity;
30
    }
31
}
32