Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
ReportRequest
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 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
 getSenderEmail
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
 getReason
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
 getNickId
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\Dto\Request;
4
5use App\Exception\ValidationErrorMessage;
6use Symfony\Component\Validator\Constraints as Assert;
7
8/**
9 * @author Wilhelm Zwertvaegher
10 */
11readonly class ReportRequest
12{
13    public function __construct(
14        #[Assert\Email(message: ValidationErrorMessage::INVALID_EMAIL)]
15        #[Assert\NoSuspiciousCharacters]
16        private string $senderEmail,
17        #[Assert\NotBlank(
18            message: ValidationErrorMessage::FIELD_CANNOT_BE_EMPTY,
19        )]
20        #[Assert\Regex(
21            pattern: '/<[^>]+>/',
22            message: ValidationErrorMessage::FIELD_CANNOT_CONTAIN_HTML,
23            match: false
24        )]
25        private string $reason,
26        #[Assert\NotBlank(message: ValidationErrorMessage::FIELD_CANNOT_BE_EMPTY)]
27        private int $nickId,
28    ) {
29    }
30
31    public function getSenderEmail(): string
32    {
33        return $this->senderEmail;
34    }
35
36    public function getReason(): string
37    {
38        return $this->reason;
39    }
40
41    public function getNickId(): int
42    {
43        return $this->nickId;
44    }
45}

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.

ReportRequest->__construct
13    public function __construct(
14        #[Assert\Email(message: ValidationErrorMessage::INVALID_EMAIL)]
15        #[Assert\NoSuspiciousCharacters]
16        private string $senderEmail,
17        #[Assert\NotBlank(
18            message: ValidationErrorMessage::FIELD_CANNOT_BE_EMPTY,
19        )]
20        #[Assert\Regex(
21            pattern: '/<[^>]+>/',
22            message: ValidationErrorMessage::FIELD_CANNOT_CONTAIN_HTML,
23            match: false
24        )]
25        private string $reason,
26        #[Assert\NotBlank(message: ValidationErrorMessage::FIELD_CANNOT_BE_EMPTY)]
27        private int $nickId,
28    ) {
29    }
ReportRequest->getNickId
43        return $this->nickId;
44    }
ReportRequest->getReason
38        return $this->reason;
39    }
ReportRequest->getSenderEmail
33        return $this->senderEmail;
34    }
{main}
3namespace App\Dto\Request;
4
5use App\Exception\ValidationErrorMessage;
6use Symfony\Component\Validator\Constraints as Assert;
7
8/**
9 * @author Wilhelm Zwertvaegher
10 */
11readonly class ReportRequest
12{
13    public function __construct(
14        #[Assert\Email(message: ValidationErrorMessage::INVALID_EMAIL)]
15        #[Assert\NoSuspiciousCharacters]
16        private string $senderEmail,
17        #[Assert\NotBlank(
18            message: ValidationErrorMessage::FIELD_CANNOT_BE_EMPTY,
19        )]
20        #[Assert\Regex(
21            pattern: '/<[^>]+>/',
22            message: ValidationErrorMessage::FIELD_CANNOT_CONTAIN_HTML,
23            match: false
24        )]
25        private string $reason,
26        #[Assert\NotBlank(message: ValidationErrorMessage::FIELD_CANNOT_BE_EMPTY)]
27        private int $nickId,
28    ) {
29    }
30
31    public function getSenderEmail(): string
32    {
33        return $this->senderEmail;
34    }
35
36    public function getReason(): string
37    {
38        return $this->reason;
39    }
40
41    public function getNickId(): int
42    {
43        return $this->nickId;
44    }