Failed Conditions
Push — master ( aacec5...b5a0b4 )
by Florent
04:50
created

OpenIdConnect/UserInfo/Claim/UpdatedAt.php (2 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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\Component\OpenIdConnect\UserInfo\Claim;
15
16
use OAuth2Framework\Component\Core\UserAccount\UserAccount;
17
18
final class UpdatedAt implements Claim
19
{
20
    private const CLAIM_NAME = 'updated_at';
21
22
    public function name(): string
23
    {
24
        return self::CLAIM_NAME;
25
    }
26
27
    public function isAvailableForUserAccount(UserAccount $userAccount, ?string $claimLocale): bool
28
    {
29
        return null !== $user->getLastUpdateAt();
0 ignored issues
show
The variable $user does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
30
    }
31
32
    public function getForUserAccount(UserAccount $userAccount, ?string $claimLocale)
33
    {
34
        return $user->getLastUpdateAt();
0 ignored issues
show
The variable $user does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
35
    }
36
}
37