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
21:29
created

ObjectMetadata   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
dl 0
loc 27
rs 10
c 1
b 0
f 0

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