Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
88.89% |
8 / 9 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| CommentsController | |
85.71% |
6 / 7 |
|
0.00% |
0 / 1 |
2.01 | |
0.00% |
0 / 1 |
| index | |
85.71% |
6 / 7 |
|
0.00% |
0 / 1 |
2.01 | |||
| 1 | <?php |
| 2 | |
| 3 | App::uses('SgfParser', 'Utility'); |
| 4 | App::uses('CommentsRenderer', 'Utility'); |
| 5 | |
| 6 | class CommentsController extends AppController |
| 7 | { |
| 8 | public function index(): mixed |
| 9 | { |
| 10 | $this->set('_title', 'Tsumego Hero - Discuss'); |
| 11 | $this->set('_page', 'discuss'); |
| 12 | if (!Auth::isLoggedIn()) |
| 13 | return $this->redirect('/users/login'); |
| 14 | $this->set('yourComments', new CommentsRenderer("your_comments", Auth::getUserID(), $this->params['url'])); |
| 15 | $this->set('allComments', new CommentsRenderer("all_comments", null, $this->params['url'])); |
| 16 | return null; |
| 17 | } |
| 18 | } |