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

TestProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

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

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;
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