Passed
Push — master ( 67aa31...d47bdf )
by Kirill
03:20
created

TestProvider::getActor()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
rs 10
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;
13
14
use Spiral\Auth\ActorProviderInterface;
15
use Spiral\Auth\TokenInterface;
16
17
class TestProvider 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