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
Push — master ( 83db66...8ac73c )
by Jérémiah
21:08
created

MetadataFactory::hasMetadataFor()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

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