| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function postComment($id) |
||
| 21 | { |
||
| 22 | $text = isset($_POST["text"]) ? $_POST["text"] : "nothingfound"; |
||
| 23 | |||
| 24 | if ($text == "nothingfound") { |
||
| 25 | return false; |
||
| 26 | } |
||
| 27 | $user = $this->di->get("session")->get("user"); |
||
| 28 | $comment = new Comment($this->di->get("db")); |
||
| 29 | $comment->text = $text; |
||
| 30 | $comment->parentId = $id; |
||
| 31 | $comment->user = $user; |
||
| 32 | $comment->save(); |
||
| 33 | return true; |
||
| 34 | } |
||
| 35 | |||
| 61 |