Completed
Push — master ( 3c68a7...9aacf2 )
by Pieter
11:31
created

ReflectionExtractorFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 2
1
<?php
2
3
namespace W2w\Lib\Apie\Plugins\Core\PropertyInfo;
4
5
use ReflectionMethod;
6
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor as SymfonyReflectionExtractor;
7
8
class ReflectionExtractorFactory
9
{
10
    public static function create(): SymfonyReflectionExtractor
11
    {
12
        $method = new ReflectionMethod(SymfonyReflectionExtractor::class, 'isReadable');
13
        $type = $method->getReturnType();
14
        if (null === $type) {
15
            return new ReflectionExtractorSerializer4();
16
        }
17
        return new ReflectionExtractor();
18
    }
19
}
20