| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function postEditAction($examID) |
||
|
|
|||
| 23 | { |
||
| 24 | $editModel = new ExamEditModel($this->get('dbh')); |
||
| 25 | |||
| 26 | if ($editModel->edit($examID, $_POST)) { |
||
| 27 | $this->redirectWithMessage('/admin/test/edit/'.$examID, 'success', 'Uaktualniono pomyślnie!'); |
||
| 28 | } else { |
||
| 29 | $this->redirectWithMessage('/admin/test/edit/'.$examID, 'warning', 'Coś się zepsuło!'); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | } |
||
| 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: