Passed
Pull Request — master (#653)
by Aleksei
05:48
created

UserRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
rs 10
wmc 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