Passed
Push — master ( 6dedbf...e08e26 )
by Anton
01:45
created

RelationReflector::compute()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
namespace Cycle\Schema\Generator;
11
12
use Cycle\Schema\Definition\Entity;
13
use Cycle\Schema\GeneratorInterface;
14
use Cycle\Schema\Registry;
15
16
class RelationReflector implements GeneratorInterface
17
{
18
    /**
19
     * @param Registry $registry
20
     * @param Entity   $entity
21
     */
22
    public function compute(Registry $registry, Entity $entity)
23
    {
24
        foreach ($registry->getRelations($entity) as $relation) {
25
            $relation->render($registry);
26
        }
27
    }
28
}