SetProxyInitializer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
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 17
ccs 7
cts 7
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\LazyLoadingGhost\MethodGenerator;
6
7
use Laminas\Code\Generator\ParameterGenerator;
8
use Laminas\Code\Generator\PropertyGenerator;
9
use ProxyManager\Generator\MethodGenerator;
10
11
/**
12
 * Implementation for {@see \ProxyManager\Proxy\LazyLoadingInterface::setProxyInitializer}
13
 * for lazy loading value holder objects
14
 */
15
class SetProxyInitializer extends MethodGenerator
16
{
17
    /**
18
     * Constructor
19
     */
20
    public function __construct(PropertyGenerator $initializerProperty)
21
    {
22 1
        parent::__construct(
23
            'setProxyInitializer',
24 1
            [(new ParameterGenerator('initializer', 'Closure'))->setDefaultValue(null)],
25 1
            self::FLAG_PUBLIC,
26 1
            '$this->' . $initializerProperty->getName() . ' = $initializer;'
27 1
        );
28 1
29
        $this->setReturnType('void');
30 1
    }
31
}
32