ValidCountryValidator::validate()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 2
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 *  Feel free to contact us once you face any issues or want to start
6
 *  another great project.
7
 * You can find more information about us on https://bitbag.io and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace BitBag\SyliusVueStorefrontPlugin\Sylius\Validator\Common;
14
15
use Symfony\Component\Validator\Constraint;
16
use Symfony\Component\Validator\ConstraintValidator;
17
18
final class ValidCountryValidator extends ConstraintValidator
19
{
20
    public function validate($request, Constraint $constraint): void
21
    {
22
        if (($request->country_id === null) && ($request->countryId === null)) {
23
            $this->context->addViolation($constraint->message);
24
        }
25
    }
26
}
27