Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
85.71% covered (warning)
85.71%
6 / 7
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
ApiKey
85.71% covered (warning)
85.71%
6 / 7
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
80.00% covered (warning)
80.00%
4 / 5
5.20
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
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
 getId
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
 getHash
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
 getCreatedAt
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
 getExpiresAt
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\Entity;
4
5use Doctrine\ORM\Mapping as ORM;
6
7/**
8 * @author Wilhelm Zwertvaegher
9 */
10#[ORM\Entity]
11#[ORM\Table(name: 'api_key')]
12class ApiKey
13{
14    #[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
15    private int $id;
16
17    #[ORM\Column(type: 'string', length: 64, unique: true)]
18    private string $hash;
19
20    #[ORM\Column(type: 'datetime_immutable')]
21    private \DateTimeImmutable $createdAt;
22
23    #[ORM\Column(type: 'datetime_immutable', nullable: true)]
24    private ?\DateTimeImmutable $expiresAt = null;
25
26    public function __construct(string $hash, \DateTimeImmutable $createdAt, ?\DateTimeImmutable $expiresAt = null)
27    {
28        $this->hash = $hash;
29        $this->createdAt = $createdAt;
30        $this->expiresAt = $expiresAt;
31    }
32
33    public function getId(): int
34    {
35        return $this->id;
36    }
37
38    public function getHash(): string
39    {
40        return $this->hash;
41    }
42
43    public function getCreatedAt(): \DateTimeImmutable
44    {
45        return $this->createdAt;
46    }
47
48    public function getExpiresAt(): ?\DateTimeImmutable
49    {
50        return $this->expiresAt;
51    }
52}

Paths

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

ApiKey->__construct
26    public function __construct(string $hash, \DateTimeImmutable $createdAt, ?\DateTimeImmutable $expiresAt = null)
27    {
28        $this->hash = $hash;
29        $this->createdAt = $createdAt;
30        $this->expiresAt = $expiresAt;
31    }
ApiKey->getCreatedAt
45        return $this->createdAt;
46    }
ApiKey->getExpiresAt
50        return $this->expiresAt;
51    }
ApiKey->getHash
40        return $this->hash;
41    }
ApiKey->getId
35        return $this->id;
36    }
{main}
3namespace App\Entity;
4
5use Doctrine\ORM\Mapping as ORM;
6
7/**
8 * @author Wilhelm Zwertvaegher
9 */
10#[ORM\Entity]
11#[ORM\Table(name: 'api_key')]
12class ApiKey
13{
14    #[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
15    private int $id;
16
17    #[ORM\Column(type: 'string', length: 64, unique: true)]
18    private string $hash;
19
20    #[ORM\Column(type: 'datetime_immutable')]
21    private \DateTimeImmutable $createdAt;
22
23    #[ORM\Column(type: 'datetime_immutable', nullable: true)]
24    private ?\DateTimeImmutable $expiresAt = null;
25
26    public function __construct(string $hash, \DateTimeImmutable $createdAt, ?\DateTimeImmutable $expiresAt = null)
27    {
28        $this->hash = $hash;
29        $this->createdAt = $createdAt;
30        $this->expiresAt = $expiresAt;
31    }
32
33    public function getId(): int
34    {
35        return $this->id;
36    }
37
38    public function getHash(): string
39    {
40        return $this->hash;
41    }
42
43    public function getCreatedAt(): \DateTimeImmutable
44    {
45        return $this->createdAt;
46    }
47
48    public function getExpiresAt(): ?\DateTimeImmutable
49    {
50        return $this->expiresAt;
51    }