Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function getTableData(string $tableName, bool $sort = false) |
||
40 | { |
||
41 | if (array_key_exists($tableName, $this->dataSource)) { |
||
42 | if ($sort) { |
||
43 | return $this->sortData($this->dataSource[$tableName]); |
||
44 | } else { |
||
45 | return $this->dataSource[$tableName]; |
||
46 | } |
||
47 | } else { |
||
48 | throw new \Exception(sprintf( |
||
49 | 'Table "%s" does not exists', |
||
50 | $tableName |
||
51 | )); |
||
52 | } |
||
53 | } |
||
54 | |||
74 |