ObjectConstructor   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 15
ccs 0
cts 9
cp 0
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A construct() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace CCT\Component\Rest\Helper;
6
7
use JMS\Serializer\Construction\ObjectConstructorInterface;
8
use JMS\Serializer\DeserializationContext;
9
use JMS\Serializer\Metadata\ClassMetadata;
10
use JMS\Serializer\VisitorInterface;
11
12
class ObjectConstructor implements ObjectConstructorInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function construct(
18
        VisitorInterface $visitor,
19
        ClassMetadata $metadata,
20
        $data,
21
        array $type,
22
        DeserializationContext $context
23
    ) {
24
        $className = $metadata->name;
25
26
        return new $className();
27
    }
28
}
29