Lines 100.00% 5 / 5
Functions and Methods 100.00% 2 / 2
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
UserRepository 100.00% 5 / 5 100.00% 2 / 2 2 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 findUsers 100.00% 4 / 4 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5/**
6 * Created by PhpStorm.
7 * User: elkuku
8 * Date: 19.03.17
9 * Time: 12:40.
10 */
11
12namespace App\Repository;
13
14use App\Entity\User;
15use App\Enum\UserRole;
16use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
17use Doctrine\Persistence\ManagerRegistry;
18
19/**
20 * @extends ServiceEntityRepository<User>
21 */
22class UserRepository extends ServiceEntityRepository
23{
24    public function __construct(ManagerRegistry $registry)
25    {
26        parent::__construct($registry, User::class);
27    }
28
29    /**
30     * @return User[]
31     */
32    public function findUsers(): array
33    {
34        return $this->findBy(
35            ['role' => UserRole::USER],
36            ['id' => 'ASC']
37        );
38    }
39}