Conditions | 5 |
Paths | 9 |
Total Lines | 23 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 5 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 3 | public function indexAction(): void |
|
23 | { |
||
24 | // By default we show overall activity |
||
25 | 3 | $item = null; |
|
26 | 3 | $this->view->title = $this->view->translate('Overall activity'); |
|
27 | |||
28 | // Try to show user's activity |
||
29 | 3 | if ($this->getRequest()->getParam('user')) { |
|
30 | 1 | $item = UserMapper::find($this->getRequest()->getParam('user')); |
|
31 | 1 | if ($item) { |
|
|
|||
32 | 1 | $this->view->title = $this->view->translate('Activity for %s', [$item->nickname]); |
|
33 | } |
||
34 | } |
||
35 | |||
36 | // Try to show movie's activity |
||
37 | 3 | if ($this->getRequest()->getParam('movie')) { |
|
38 | 1 | $item = MovieMapper::find($this->getRequest()->getParam('movie')); |
|
39 | 1 | if ($item) { |
|
40 | 1 | $this->view->title = $this->view->translate('Activity for %s', [$item->getTitle()]); |
|
41 | } |
||
42 | } |
||
43 | |||
44 | 3 | $this->view->activity = $this->_helper->createPaginator(StatusMapper::getActivityQuery($item)); |
|
45 | 3 | } |
|
47 |