• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemsdk / docker-symfony-api / #82

pending completion
#82

push

DKravtsov
Updated composer dependencies, refactoring.

45 of 45 new or added lines in 12 files covered. (100.0%)

1483 of 2844 relevant lines covered (52.14%)

22.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Tool/Application/Validator/Constraints/LanguageValidator.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace App\Tool\Application\Validator\Constraints;
6

7
use App\Tool\Application\Service\LocalizationService;
8
use Symfony\Component\Validator\Constraint;
9
use Symfony\Component\Validator\ConstraintValidator;
10

11
use function in_array;
12

13
/**
14
 * Class LanguageValidator
15
 *
16
 * @package App\Tool
17
 */
18
class LanguageValidator extends ConstraintValidator
19
{
20
    public function __construct(
21
        private readonly LocalizationService $localization,
22
    ) {
23
    }
×
24

25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function validate(mixed $value, Constraint $constraint): void
29
    {
30
        if (in_array($value, $this->localization->getLanguages(), true) !== true) {
×
31
            $this->context
×
32
                ->buildViolation(Language::MESSAGE)
×
33
                ->setParameter('{{ language }}', (string)$value)
×
34
                ->setCode(Language::INVALID_LANGUAGE)
×
35
                ->addViolation();
×
36
        }
37
    }
38
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc