Passed
Branch 3.0.0 (3c68a7)
by Pieter
04:04
created

ValueObjectPlugin   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getNormalizers() 0 4 1
A getDefinedStaticData() 0 3 1
A getDynamicSchemaLogic() 0 5 1
1
<?php
2
3
namespace W2w\Lib\Apie\Plugins\ValueObject;
4
5
use W2w\Lib\Apie\Interfaces\ValueObjectInterface;
6
use W2w\Lib\Apie\PluginInterfaces\NormalizerProviderInterface;
7
use W2w\Lib\Apie\PluginInterfaces\SchemaProviderInterface;
8
use W2w\Lib\Apie\Plugins\ValueObject\Normalizers\ValueObjectNormalizer;
9
10
class ValueObjectPlugin implements NormalizerProviderInterface, SchemaProviderInterface
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15
    public function getNormalizers(): array
16
    {
17
        return [
18
            new ValueObjectNormalizer()
19
        ];
20
    }
21
22
    /**
23
     * {@inheritDoc}
24
     */
25
    public function getDefinedStaticData(): array
26
    {
27
        return [
28
        ];
29
    }
30
31
    /**
32
     * {@inheritDoc}
33
     */
34
    public function getDynamicSchemaLogic(): array
35
    {
36
        return [
37
            ValueObjectInterface::class => function (string $resourceClass) {
38
                return $resourceClass::toSchema();
39
            }
40
        ];
41
    }
42
}
43