ObjectConstructor::construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 5
dl 0
loc 10
ccs 0
cts 3
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace CCT\Kong\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