for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Repository;
use Cycle\ORM\Select;
use Yiisoft\Auth\IdentityInterface;
use Yiisoft\Auth\IdentityRepositoryInterface;
class UserRepository extends Select\Repository implements IdentityRepositoryInterface
{
private function findIdentityBy(string $field, string $value): ?IdentityInterface
return $this->findOne([$field => $value]);
}
public function findIdentity(string $id): ?IdentityInterface
return $this->findByPK($id);
public function findIdentityByToken(string $token, string $type): ?IdentityInterface
return $this->findIdentityBy('token', $token);
public function findByLogin(string $login): ?IdentityInterface
return $this->findIdentityBy('login', $login);