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

CarbonPlugin::getNormalizers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
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