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

Completed
Pull Request — master (#536)
by
unknown
20:27
created

ObjectMetadata::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
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
/**
13
 * @author Timur Murtukov <[email protected]>
14
 */
15
class ObjectMetadata extends ClassMetadata
16
{
17 1
    public function __construct(ValidationNode $object)
18
    {
19 1
        parent::__construct($object->getName());
20 1
    }
21
22 1
    public function addPropertyConstraint($property, Constraint $constraint)
23
    {
24 1
        if (!isset($this->properties[$property])) {
25 1
            $this->properties[$property] = new PropertyMetadata($property);
26
27 1
            $this->addPropertyMetadata($this->properties[$property]);
28
        }
29
30 1
        $constraint->addImplicitGroupName($this->getDefaultGroup());
31
32 1
        $this->properties[$property]->addConstraint($constraint);
33
34 1
        return $this;
35
    }
36
37 1
    private function addPropertyMetadata(PropertyMetadataInterface $metadata)
38
    {
39 1
        $property = $metadata->getPropertyName();
40
41 1
        $this->members[$property][] = $metadata;
42 1
    }
43
}
44