Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
66.67% covered (warning)
66.67%
2 / 3
66.67% covered (warning)
66.67%
2 / 3
66.67% covered (warning)
66.67%
2 / 3
66.67% covered (warning)
66.67%
2 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
ApiKeyRepository
66.67% covered (warning)
66.67%
2 / 3
66.67% covered (warning)
66.67%
2 / 3
66.67% covered (warning)
66.67%
2 / 3
66.67% covered (warning)
66.67%
2 / 3
3.33
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 findById
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 findByHash
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\Repository;
4
5use App\Entity\ApiKey;
6use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
7use Doctrine\Persistence\ManagerRegistry;
8
9/**
10 * @extends ServiceEntityRepository<ApiKey>
11 *
12 * @author Wilhelm Zwertvaegher
13 */
14class ApiKeyRepository extends ServiceEntityRepository implements ApiKeyRepositoryInterface
15{
16    public function __construct(ManagerRegistry $registry)
17    {
18        parent::__construct($registry, ApiKey::class);
19    }
20
21    public function findById(int $id): ?ApiKey
22    {
23        return parent::find($id);
24    }
25
26    public function findByHash(string $hash): ?ApiKey
27    {
28        return parent::findOneBy(['hash' => $hash]);
29    }
30}

Branches

Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once. Please also be aware that some branches may be implicit rather than explicit, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

ApiKeyRepository->__construct
16    public function __construct(ManagerRegistry $registry)
17    {
18        parent::__construct($registry, ApiKey::class);
19    }
ApiKeyRepository->findByHash
26    public function findByHash(string $hash): ?ApiKey
27    {
28        return parent::findOneBy(['hash' => $hash]);
29    }
ApiKeyRepository->findById
21    public function findById(int $id): ?ApiKey
22    {
23        return parent::find($id);
24    }
{main}
3namespace App\Repository;
4
5use App\Entity\ApiKey;
6use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
7use Doctrine\Persistence\ManagerRegistry;
8
9/**
10 * @extends ServiceEntityRepository<ApiKey>
11 *
12 * @author Wilhelm Zwertvaegher
13 */
14class ApiKeyRepository extends ServiceEntityRepository implements ApiKeyRepositoryInterface
15{
16    public function __construct(ManagerRegistry $registry)
17    {
18        parent::__construct($registry, ApiKey::class);
19    }
20
21    public function findById(int $id): ?ApiKey
22    {
23        return parent::find($id);
24    }
25
26    public function findByHash(string $hash): ?ApiKey
27    {
28        return parent::findOneBy(['hash' => $hash]);
29    }