EvalMaterializer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A materialize() 0 4 1
1
<?php
2
3
/**
4
 * Spiral Framework. Cycle ProxyFactory
5
 *
6
 * @license MIT
7
 * @author  Valentin V (Vvval)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\ORM\Promise\Materizalizer;
13
14
use Cycle\ORM\Promise\MaterializerInterface;
15
use ReflectionClass;
16
17
use function Cycle\ORM\Promise\trimPHPOpenTag;
18
19
final class EvalMaterializer implements MaterializerInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     * If class already exists - do nothing (prevent from memory leaking)
24
     */
25
    public function materialize(string $code, string $shortClassName, ReflectionClass $reflection): void
26
    {
27
        eval(trimPHPOpenTag($code));
28
    }
29
}
30