TokenRepo   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getByClientId() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Orm;
6
7
use AbterPhp\Admin\Domain\Entities\Token as Entity;
8
use AbterPhp\Admin\Orm\DataMappers\TokenSqlDataMapper; // @phan-suppress-current-line PhanUnreferencedUseNormal
9
use Opulence\Orm\OrmException;
10
use Opulence\Orm\Repositories\Repository;
11
12
class TokenRepo extends Repository
13
{
14
    /**
15
     * @param string $username
16
     *
17
     * @return Entity|null
18
     * @throws OrmException
19
     */
20
    public function getByClientId(string $username): ?Entity
21
    {
22
        /** @see TokenSqlDataMapper::getByClientId() */
23
        return $this->getFromDataMapper('getByClientId', [$username]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFromDat...tId', array($username)) could return the type array<mixed,object> which is incompatible with the type-hinted return AbterPhp\Admin\Domain\Entities\Token|null. Consider adding an additional type-check to rule them out.
Loading history...
24
    }
25
}
26