Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#536)
by
unknown
17:59 queued 05:58
created

ObjectMetadata::addPropertyConstraint()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 10
cc 2
nc 2
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Validator\Mapping;
6
7
use Overblog\GraphQLBundle\Validator\ValidationNode;
8
use Symfony\Component\Validator\Constraint;
9
use Symfony\Component\Validator\Mapping\ClassMetadata;
10
use Symfony\Component\Validator\Mapping\PropertyMetadataInterface;
11
12
class ObjectMetadata extends ClassMetadata
13
{
14 11
    public function __construct(ValidationNode $object)
15
    {
16 11
        parent::__construct($object->getName());
17 11
    }
18
19 10
    public function addPropertyConstraint($property, Constraint $constraint)
20
    {
21 10
        if (!isset($this->properties[$property])) {
22 10
            $this->properties[$property] = new PropertyMetadata($property);
23
24 10
            $this->addPropertyMetadata($this->properties[$property]);
25
        }
26
27 10
        $constraint->addImplicitGroupName($this->getDefaultGroup());
28
29 10
        $this->properties[$property]->addConstraint($constraint);
30
31 10
        return $this;
32
    }
33
34 10
    private function addPropertyMetadata(PropertyMetadataInterface $metadata): void
35
    {
36 10
        $property = $metadata->getPropertyName();
37
38 10
        $this->members[$property][] = $metadata;
39 10
    }
40
}
41