Completed
Push — master ( e12b56...1fb17f )
by Anton
01:36
created

RenderRelations   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A compute() 0 8 3
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\Processor;
11
12
use Cycle\Schema\Registry;
13
use Cycle\Schema\Definition\Entity;
14
use Cycle\Schema\ProcessorInterface;
15
16
/**
17
 * Render indexes and foreign keys defined by entity relations.
18
 */
19
class RenderRelations implements ProcessorInterface
20
{
21
    public function compute(Registry $registry, Entity $entity)
22
    {
23
        if (!$registry->hasTable($entity)) {
24
            return;
25
        }
26
27
        foreach ($registry->getRelations($entity) as $name => $relation) {
28
            dump($relation);
29
        }
30
    }
31
}