Test Failed
Push — master ( 321e41...d641b2 )
by Jan
02:14
created

PayloadGenerator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace DiscordWebhook\Generator;
5
6
use Doctrine\Common\Annotations\AnnotationReader;
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Symfony\Component\Serializer\Encoder\EncoderInterface;
9
use Symfony\Component\Serializer\Encoder\JsonEncoder;
10
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
11
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
12
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
13
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
14
use Symfony\Component\Serializer\Serializer;
15
16
/**
17
 * Class PayloadGenerator
18
 *
19
 * @package DiscordWebhook\Generator
20
 * @author Scrummer <[email protected]>
21
 */
22
class PayloadGenerator
23
{
24
    /**
25
     * @var NormalizerInterface
26
     */
27
    private $normalizer;
28
29
    public function __construct()
30
    {
31
        $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
32
        $this->normalizer = new ObjectNormalizer($classMetadataFactory);
33
    }
34
}
35