Passed
Push — master ( 1d30f9...202808 )
by Peter
04:48
created

TokenRepo::getByClientId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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;
9
use AbterPhp\Framework\Orm\IGridRepo;
10
use Opulence\Orm\Repositories\Repository;
11
12
class TokenRepo extends Repository implements IGridRepo
13
{
14
    /**
15
     * @param string $username
16
     *
17
     * @return Entity|null
18
     */
19
    public function getByClientId(string $username): ?Entity
20
    {
21
        /** @see TokenSqlDataMapper::getByClientId() */
22
        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...
23
    }
24
}
25