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

TestAuthHttpProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getActor() 0 7 2
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 TestAuthHttpProvider implements ActorProviderInterface
18
{
19
    public function getActor(TokenInterface $token): ?object
20
    {
21
        if ($token->getID() === 'ok') {
22
            return new \stdClass();
23
        }
24
25
        return null;
26
    }
27
}
28