BenSampoEnumPlugin::getDefinedStaticData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace W2w\Lib\ApieBenSampoEnumPlugin;
4
5
use BenSampo\Enum\Enum;
6
use erasys\OpenApi\Spec\v3\Schema;
7
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
8
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
9
use W2w\Lib\Apie\PluginInterfaces\NormalizerProviderInterface;
10
use W2w\Lib\Apie\PluginInterfaces\SchemaProviderInterface;
11
use W2w\Lib\ApieBenSampoEnumPlugin\Schema\EnumSchemaGenerator;
12
use W2w\Lib\ApieBenSampoEnumPlugin\Normalizers\EnumNormalizer;
13
14
class BenSampoEnumPlugin implements SchemaProviderInterface, NormalizerProviderInterface
15
{
16
    /**
17
     * @return NormalizerInterface[]|DenormalizerInterface[]
18
     */
19
    public function getNormalizers(): array
20
    {
21
        return [new EnumNormalizer()];
22
    }
23
24
    /**
25
     * @return Schema[]
26
     */
27
    public function getDefinedStaticData(): array
28
    {
29
        return [];
30
    }
31
32
    /**
33
     * @return callable[]
34
     */
35
    public function getDynamicSchemaLogic(): array
36
    {
37
        return [
38
            Enum::class => new EnumSchemaGenerator()
39
        ];
40
    }
41
}
42