| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public static function protectDatas(string $datas): string |
||
| 24 | { |
||
| 25 | $dbModule = \BFW\Application::getInstance() |
||
| 26 | ->getModuleList() |
||
| 27 | ->getModuleByName('bfw-sql') |
||
| 28 | ; |
||
| 29 | |||
| 30 | if (count($dbModule->listBases) === 0) { |
||
| 31 | throw new Exception( |
||
| 32 | 'No database connected to protect data', |
||
| 33 | self::ERR_NO_DATABASE_CONNECTED |
||
| 34 | ); |
||
| 35 | } |
||
| 36 | |||
| 37 | return reset($dbModule->listBases)->protect($datas); |
||
| 38 | } |
||
| 40 |