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

MetadataFactory::hasMetadataFor()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
cc 2
nc 2
nop 1
crap 6
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\Exception\NoSuchMetadataException;
9
use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface;
10
11
/**
12
 * @author Timur Murtukov <[email protected]>
13
 */
14
class MetadataFactory implements MetadataFactoryInterface
15
{
16
    private $metadataPool;
17
18 1
    public function __construct()
19
    {
20 1
        $this->metadataPool = [];
21 1
    }
22
23 1
    public function getMetadataFor($object)
24
    {
25 1
        if ($object instanceof ValidationNode) {
26 1
            return $this->metadataPool[$object->getName()];
27
        }
28
29
        throw new NoSuchMetadataException();
30
    }
31
32
    public function hasMetadataFor($object)
33
    {
34
        if ($object instanceof ValidationNode) {
35
            return isset($this->metadataPool[$object->getName()]);
36
        }
37
38
        return false;
39
    }
40
41 1
    public function addMetadata(ObjectMetadata $metadata): void
42
    {
43 1
        $this->metadataPool[$metadata->getClassName()] = $metadata;
44 1
    }
45
}
46