| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 2 | public static function create(\PDO $pdo) { |
|
| 23 | /** |
||
| 24 | * Tables |
||
| 25 | */ |
||
| 26 | 2 | $tables = new TableCollection(); |
|
| 27 | |||
| 28 | 2 | foreach ($pdo->query('SHOW TABLES;') as $row) { |
|
| 29 | 2 | $table = TableFactory::create($row[0], $pdo); |
|
| 30 | |||
| 31 | 2 | $tables->add($table); |
|
| 32 | 2 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Initialization |
||
| 36 | */ |
||
| 37 | 2 | $database = new Database($tables); |
|
| 38 | |||
| 39 | 2 | return $database; |
|
| 40 | } |
||
| 41 | } |
||
| 42 |