Completed
Pull Request — master (#109)
by Alexander
15:38 queued 32s
created

BeforeLogout::invalidate()   A

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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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