Passed
Pull Request — master (#225)
by Anton
02:23
created

UserRepository::getActor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
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\App\User;
13
14
use Cycle\ORM\Select\Repository;
15
use Spiral\Auth\ActorProviderInterface;
16
use Spiral\Auth\TokenInterface;
17
18
class UserRepository extends Repository implements ActorProviderInterface
19
{
20
    public function getActor(TokenInterface $token): ?object
21
    {
22
        return $this->findByPK($token->getPayload()['userID']);
23
    }
24
}
25