Passed
Push — develop ( 3ca15e...dfb906 )
by Laurent
01:30
created

UserChecker   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A checkPostAuth() 0 4 2
A checkPreAuth() 0 4 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the G.L.S.R. Apps package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Core\Infrastructure\Security;
15
16
use Core\Domain\Model\User;
17
use Symfony\Component\Security\Core\User\UserCheckerInterface;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Securi...er\UserCheckerInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
use Symfony\Component\Security\Core\User\UserInterface;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Security\Core\User\UserInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
20
class UserChecker implements UserCheckerInterface
21
{
22
    public function checkPreAuth(UserInterface $user): void
23
    {
24
        if (!$user instanceof User) {
25
            return;
26
        }
27
        // if ($user->isDeleted()) {
28
        //     throw new CustomUserMessageAuthenticationException('Your user account is not enabled!');
29
        // }
30
    }
31
32
    public function checkPostAuth(UserInterface $user): void
33
    {
34
        if (!$user instanceof User) {
35
            return;
36
        }
37
        // if ($user->isDeleted()) {
38
        //     throw new CustomUserMessageAuthenticationException('Your user account is not enabled!');
39
        // }
40
    }
41
}
42