Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| NickRepository | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getById | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getByProperties | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Repository; |
| 4 | |
| 5 | use App\Entity\Nick; |
| 6 | use App\Entity\Qualifier; |
| 7 | use App\Entity\Subject; |
| 8 | use App\Enum\WordGender; |
| 9 | use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; |
| 10 | use Doctrine\Persistence\ManagerRegistry; |
| 11 | |
| 12 | /** |
| 13 | * @extends ServiceEntityRepository<Nick> |
| 14 | * |
| 15 | * @author Wilhelm Zwertvaegher |
| 16 | */ |
| 17 | class NickRepository extends ServiceEntityRepository implements NickRepositoryInterface |
| 18 | { |
| 19 | public function __construct(ManagerRegistry $registry) |
| 20 | { |
| 21 | parent::__construct($registry, Nick::class); |
| 22 | } |
| 23 | |
| 24 | public function getById(int $id): ?Nick |
| 25 | { |
| 26 | return parent::find($id); |
| 27 | } |
| 28 | |
| 29 | public function getByProperties(Subject $subject, Qualifier $qualifier, WordGender $targetGender): ?Nick |
| 30 | { |
| 31 | return parent::findOneBy(['subject' => $subject, 'qualifier' => $qualifier, 'targetGender' => $targetGender]); |
| 32 | } |
| 33 | } |