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 ( 2a6b46...0d82f1 )
by joseph
20s queued 14s
created

DomainNameValidator::validate()   A

Complexity

Conditions 5
Paths 3

Size

Total Lines 14
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 6.1384

Importance

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