for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace User\Repository;
use Doctrine\ORM\EntityRepository;
use User\Entity\User as UserModel;
/**
* User Repository
*
* @author Thiago Paes <[email protected]>
*/
final class User extends EntityRepository implements UserInterface
{
* @inheritdoc
public function findById(int $id): UserModel
$user = $this->findOneBy(
[
'id' => $id,
'active' => true
]
);
if (null === $user) {
$user = new UserModel();
}
return $user;
public function findAll(): array
$users = $this->findBy(
return $users;