Completed
Pull Request — master (#1510)
by
unknown
18:08
created

CustomType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A closureToPHP() 0 9 1
1
<?php
2
3
namespace Doctrine\ODM\MongoDB\Types;
4
5
class CustomType extends Type
6
{
7
    /**
8
     * @return string Redirects to the method convertToPHPValue from child class
9
     */
10 1
    final public function closureToPHP()
11
    {
12 1
        $fqcn = get_class($this);
13
14 1
        return sprintf('
15
            $reflection = new \ReflectionClass("%s");
16
            $type = $reflection->newInstanceWithoutConstructor();
17 1
            $return = $type->convertToPHPValue($value);', $fqcn);
18
    }
19
}
20