Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
ContactRequest
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
3
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
 getContent
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 ContactRequest
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 $content,
26    ) {
27    }
28
29    public function getSenderEmail(): string
30    {
31        return $this->senderEmail;
32    }
33
34    public function getContent(): string
35    {
36        return $this->content;
37    }
38}

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.

ContactRequest->__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 $content,
26    ) {
27    }
ContactRequest->getContent
36        return $this->content;
37    }
ContactRequest->getSenderEmail
31        return $this->senderEmail;
32    }
{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 ContactRequest
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 $content,
26    ) {
27    }
28
29    public function getSenderEmail(): string
30    {
31        return $this->senderEmail;
32    }
33
34    public function getContent(): string
35    {
36        return $this->content;
37    }