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::addPropertyMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 2
c 2
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
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