Total Complexity | 3 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 20% |
Changes | 0 |
1 | <?php |
||
13 | final class FkExtractor implements ConstraintVisitorInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var ForeignKeyConstraint[] |
||
17 | */ |
||
18 | private $fk = []; |
||
19 | |||
20 | /** |
||
21 | * {@inheritdoc} |
||
22 | */ |
||
23 | public function onForeignKey(ForeignKeyInterface $foreignKey) |
||
24 | { |
||
25 | $this->fk[] = new ForeignKeyConstraint( |
||
26 | $foreignKey->fields(), |
||
27 | $foreignKey->table(), |
||
28 | $foreignKey->referred(), |
||
29 | $foreignKey->name() |
||
30 | ); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Get the doctrine foreign key constraints |
||
35 | * |
||
36 | * @return ForeignKeyConstraint[] |
||
37 | */ |
||
38 | 1068 | public function all() |
|
39 | { |
||
40 | 1068 | return $this->fk; |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function onCheck(CheckInterface $check) |
||
48 | } |
||
49 | } |
||
50 |