Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
17 | public function movie(\mQueue\Model\Movie $movie): string |
||
18 | { |
||
19 | $result = $this->view->link($movie); |
||
20 | |||
21 | $user = User::getCurrent(); |
||
22 | if ($user) { |
||
|
|||
23 | $status = $movie->getStatus($user); |
||
24 | $title = $this->view->translate('Your rating is : %s', [$status->getName()]); |
||
25 | } else { |
||
26 | $title = $this->view->translate('You are not logged in'); |
||
27 | } |
||
28 | |||
29 | $movieUrl = $this->view->url(['controller' => 'movie', 'action' => 'view', 'id' => $movie->id], 'singleid', true); |
||
30 | $result .= ' <a title="' . $title . '" href="' . $movieUrl . '">' . $this->view->escape($movie->getTitle()) . '</a>'; |
||
31 | |||
32 | return $result; |
||
33 | } |
||
35 |