GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

SerializerBuilder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 7
dl 0
loc 20
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 12 2
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMap\Service\Serializer;
13
14
use Ivory\Serializer\Mapping\Factory\CacheClassMetadataFactory;
15
use Ivory\Serializer\Mapping\Factory\ClassMetadataFactory;
16
use Ivory\Serializer\Mapping\Loader\DirectoryClassMetadataLoader;
17
use Ivory\Serializer\Navigator\Navigator;
18
use Ivory\Serializer\Registry\TypeRegistry;
19
use Ivory\Serializer\Serializer;
20
use Ivory\Serializer\Type\ObjectType;
21
use Ivory\Serializer\Type\Type;
22
use Psr\Cache\CacheItemPoolInterface;
23
24
/**
25
 * @author GeLo <[email protected]>
26
 */
27
class SerializerBuilder
28
{
29
    /**
30
     * @param CacheItemPoolInterface|null $pool
31
     *
32
     * @return Serializer
33
     */
34 1052
    public static function create(CacheItemPoolInterface $pool = null)
35
    {
36 1052
        $classMetadataFactory = new ClassMetadataFactory(new DirectoryClassMetadataLoader(__DIR__));
37
38 1052
        if ($pool !== null) {
39
            $classMetadataFactory = new CacheClassMetadataFactory($classMetadataFactory, $pool);
40
        }
41
42 1052
        return new Serializer(new Navigator(TypeRegistry::create([
43 1052
            Type::OBJECT => new ObjectType($classMetadataFactory),
44 526
        ])));
45
    }
46
}
47