BeforeLogin   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

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