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

CustomType::closureToPHP()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 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