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
19:59
created

ObjectMetadata   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 2
b 0
f 0
dl 0
loc 27
ccs 13
cts 13
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addPropertyMetadata() 0 5 1
A addPropertyConstraint() 0 13 2
A __construct() 0 3 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