GetWrappedValueHolderValue::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManager\ProxyGenerator\ValueHolder\MethodGenerator;
6
7
use Laminas\Code\Generator\Exception\InvalidArgumentException;
8
use Laminas\Code\Generator\PropertyGenerator;
9
use ProxyManager\Generator\MethodGenerator;
10
11
/**
12
 * Implementation for {@see \ProxyManager\Proxy\ValueHolderInterface::getWrappedValueHolderValue}
13
 * for lazy loading value holder objects
14
 */
15
class GetWrappedValueHolderValue extends MethodGenerator
16
{
17
    /**
18
     * Constructor
19
     *
20
     * @throws InvalidArgumentException
21
     */
22
    public function __construct(PropertyGenerator $valueHolderProperty)
23
    {
24 1
        parent::__construct('getWrappedValueHolderValue');
25
        $this->setBody('return $this->' . $valueHolderProperty->getName() . ';');
26 1
        $this->setReturnType('?object');
27 1
    }
28
}
29