Failed Conditions
Push — master ( cccd95...989cb2 )
by Florent
03:57
created

UserManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 14
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isPasswordCredentialValid() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2018 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace OAuth2Framework\SecurityBundle\Tests\TestBundle\Entity;
15
16
use OAuth2Framework\Component\Core\UserAccount\UserAccount;
17
use OAuth2Framework\Component\Core\UserAccount\UserAccountManager;
18
19
class UserManager implements UserAccountManager
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function isPasswordCredentialValid(UserAccount $user, string $password): bool
25
    {
26
        if (!$user instanceof User) {
27
            return false;
28
        }
29
30
        return in_array($password, $user->getOAuth2Passwords());
31
    }
32
}
33