MagicSleep   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
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 12
ccs 3
cts 3
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\PropertyGenerator;
8
use ProxyManager\Generator\MagicMethodGenerator;
9
use ReflectionClass;
10
use function var_export;
11
12
/**
13
 * Magic `__sleep` for value holder objects
14
 */
15
class MagicSleep extends MagicMethodGenerator
16
{
17
    /**
18
     * Constructor
19
     */
20
    public function __construct(ReflectionClass $originalClass, PropertyGenerator $valueHolderProperty)
21
    {
22 1
        parent::__construct($originalClass, '__sleep');
23
24 1
        $this->setBody('return array(' . var_export($valueHolderProperty->getName(), true) . ');');
25
    }
26
}
27