Passed
Push — master ( c708c9...af9ac4 )
by Bas
39s
created

SoapDateHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 23
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSubscribingMethods() 0 21 2
1
<?php
2
3
namespace DMT\Soap\Serializer;
4
5
use JMS\Serializer\GraphNavigator;
6
use JMS\Serializer\Handler\DateHandler;
7
8
class SoapDateHandler extends DateHandler
9
{
10 17
    public static function getSubscribingMethods()
11
    {
12 17
        $methods = [];
13
14 17
        foreach (['DateTime', 'DateTimeImmutable', 'DateInterval'] as $type) {
15 17
            $methods[] = [
16 17
                'type' => $type,
17 17
                'direction' => GraphNavigator::DIRECTION_DESERIALIZATION,
18 17
                'format' => 'soap',
19 17
                'method' => 'deserialize' . $type . 'FromXml'
20
            ];
21
22 17
            $methods[] = [
23 17
                'type' => $type,
24 17
                'format' => 'soap',
25 17
                'direction' => GraphNavigator::DIRECTION_SERIALIZATION,
26 17
                'method' => 'serialize' . $type,
27
            ];
28
        }
29
30 17
        return $methods;
31
    }
32
}
33