Completed
Pull Request — master (#1513)
by
unknown
10:21
created

CustomType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

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