Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | public function editAction($examID) |
||
11 | { |
||
12 | $exam = (new ExamModel($this->get('dbh')))->getInfo($examID); |
||
13 | $questions = (new Questions($this->get('dbh')))->getByExamId($examID); |
||
14 | |||
15 | $this->render('admin-exam-edit', [ |
||
16 | 'title' => 'Edycja testu', |
||
17 | 'exam' => $exam, |
||
18 | 'questions' => $questions, |
||
19 | ]); |
||
20 | } |
||
21 | |||
33 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: