Passed
Push — master ( aad9e9...893d1e )
by Kirill
04:12
created

TestAuthProvider::getActor()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Auth\Stub;
13
14
use Spiral\Auth\ActorProviderInterface;
15
use Spiral\Auth\TokenInterface;
16
17
class TestAuthProvider implements ActorProviderInterface
18
{
19
    public function getActor(TokenInterface $token): ?object
20
    {
21
        if ($token->getPayload()['ok']) {
22
            return new \stdClass();
23
        }
24
25
        return null;
26
    }
27
}
28