Total Complexity | 3 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
13 | final class SqliteSessionInit implements EventSubscriber |
||
14 | { |
||
15 | 50 | public function postConnect(ConnectionEventArgs $args) : void |
|
16 | { |
||
17 | 50 | $args->getConnection()->exec('PRAGMA foreign_keys = on'); |
|
18 | |||
19 | 50 | if (! ($args->getDatabasePlatform() instanceof SqlitePlatform)) { |
|
20 | 50 | return; |
|
21 | } |
||
22 | |||
23 | $args->getDatabasePlatform()->enableForeignKeyConstraintsSupport(); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @return string[] |
||
28 | */ |
||
29 | 28 | public function getSubscribedEvents() : array |
|
32 | } |
||
33 | } |
||
34 |