Issues (104)

src/Orm/TokenRepo.php (1 issue)

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