ValueHolderProperty   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 19
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManager\ProxyGenerator\LazyLoadingValueHolder\PropertyGenerator;
6
7
use Laminas\Code\Generator\DocBlockGenerator;
8
use Laminas\Code\Generator\Exception\InvalidArgumentException;
9
use Laminas\Code\Generator\PropertyGenerator;
10
use ProxyManager\Generator\Util\IdentifierSuffixer;
11
use ReflectionClass;
12
13
/**
14
 * Property that contains the wrapped value of a lazy loading proxy
15
 */
16
class ValueHolderProperty extends PropertyGenerator
17
{
18
    /**
19
     * Constructor
20
     *
21
     * @throws InvalidArgumentException
22 1
     */
23
    public function __construct(ReflectionClass $type)
24 1
    {
25
        parent::__construct(IdentifierSuffixer::getIdentifier('valueHolder'));
26 1
27 1
        $docBlock = new DocBlockGenerator();
28 1
29
        $docBlock->setWordWrap(false);
30
        $docBlock->setLongDescription('@var \\' . $type->getName() . '|null wrapped object, if the proxy is initialized');
31
        $this->setDocBlock($docBlock);
32
        $this->setVisibility(self::VISIBILITY_PRIVATE);
33
    }
34
}
35