GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 6a4e57...36c412 )
by joseph
26:54
created

DomainNameValidator::validate()   A

Complexity

Conditions 4
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 0
Metric Value
cc 4
eloc 7
nc 2
nop 2
dl 0
loc 10
ccs 0
cts 8
cp 0
crap 20
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Validation\Constraints;
4
5
use Symfony\Component\Validator\Constraint;
6
use Symfony\Component\Validator\ConstraintValidator;
7
8
class DomainNameValidator extends ConstraintValidator
9
{
10
11
    /**
12
     * Checks if the passed value is valid.
13
     *
14
     * @param string     $domainName
15
     * @param Constraint $constraint The constraint for the validation
16
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
17
     */
18
    public function validate($domainName, Constraint $constraint): void
19
    {
20
        if (false === filter_var($domainName, FILTER_VALIDATE_DOMAIN)
21
            || false === \ts\stringContains($domainName, '.')
22
            || false !== \ts\stringContains($domainName, '//')
23
        ) {
24
            $this->context->buildViolation(sprintf(DomainName::MESSAGE, $this->formatValue($domainName)))
25
                          ->setParameter('{{ value }}', $this->formatValue($domainName))
26
                          ->setCode(DomainName::INVALID_DOMAIN_ERROR)
27
                          ->addViolation();
28
        }
29
    }
30
}
31