SerializerUtils   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMetadataFactory() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GoetasWebservices\SoapServices\Metadata;
6
7
use JMS\Serializer\Serializer;
8
use Metadata\MetadataFactory;
9
10
class SerializerUtils
11
{
12
    /**
13
     * Get metadata factory from serializer, with any JMS Serializer version.
14
     */
15
    public static function getMetadataFactory(Serializer $serializer): MetadataFactory
16
    {
17
        $reflectionProperty = new \ReflectionProperty(Serializer::class, 'factory');
18
        $reflectionProperty->setAccessible(true);
19
20
        return $reflectionProperty->getValue($serializer);
21
    }
22
}
23