GetWrappedValueHolderValue   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 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