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 |
| SuggestionRequest | |
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 | |||
| getSenderEmail | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getLabel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Dto\Request; |
| 4 | |
| 5 | use App\Exception\ValidationErrorMessage; |
| 6 | use Symfony\Component\Validator\Constraints as Assert; |
| 7 | |
| 8 | /** |
| 9 | * @author Wilhelm Zwertvaegher |
| 10 | */ |
| 11 | readonly class SuggestionRequest |
| 12 | { |
| 13 | public function __construct( |
| 14 | #[Assert\Email(message: ValidationErrorMessage::INVALID_EMAIL)] |
| 15 | #[Assert\NoSuspiciousCharacters] |
| 16 | private ?string $senderEmail, |
| 17 | #[Assert\NotBlank(message: ValidationErrorMessage::FIELD_CANNOT_BE_EMPTY)] |
| 18 | #[Assert\Regex( |
| 19 | pattern: '/<[^>]+>/', |
| 20 | message: ValidationErrorMessage::FIELD_CANNOT_CONTAIN_HTML, |
| 21 | match: false |
| 22 | )] |
| 23 | private string $label) |
| 24 | { |
| 25 | } |
| 26 | |
| 27 | public function getSenderEmail(): ?string |
| 28 | { |
| 29 | return $this->senderEmail; |
| 30 | } |
| 31 | |
| 32 | public function getLabel(): string |
| 33 | { |
| 34 | return $this->label; |
| 35 | } |
| 36 | } |