Passed
Branch 3.0.0 (98e096)
by Pieter
02:47
created

CarbonPlugin   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getNormalizers() 0 5 1
1
<?php
2
namespace W2w\Lib\Apie\Plugins;
3
4
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
5
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
6
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
7
use W2w\Lib\Apie\Normalizers\CarbonNormalizer;
8
use W2w\Lib\Apie\PluginInterfaces\NormalizerProviderInterface;
9
10
class CarbonPlugin implements NormalizerProviderInterface
11
{
12
    /**
13
     * @return NormalizerInterface[]|DenormalizerInterface[]
14
     */
15
    public function getNormalizers(): array
16
    {
17
        return new CarbonNormalizer(
0 ignored issues
show
Bug Best Practice introduced by
The expression return new W2w\Lib\Apie\..._KEY => 'Y-m-d H:i:s')) returns the type W2w\Lib\Apie\Normalizers\CarbonNormalizer which is incompatible with the type-hinted return array.
Loading history...
18
            [
19
                DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s'
20
            ]
21
        );
22
    }
23
}
24