Completed
Push — develop ( 1fc957...5b3409 )
by Marek
10:45
created

BookmarkController::indexAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
namespace AppBundle\Controller;
3
4
use AppBundle\Service\BookmarkService;
5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
6
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8
use Symfony\Component\HttpFoundation\Request;
9
10
class BookmarkController extends Controller
11
{
12
    /**
13
     * @return BookmarkService
14
     */
15
    private function getBookmarkService()
16
    {
17
        return $this->get('app.bookmark');
18
    }
19
20
    /**
21
     * @Route("/bookmarks", name="bookmark.index")
22
     * @Method({"GET"})
23
     */
24
    public function indexAction(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        $result = $this->getBookmarkService()->getBookmarksAndCategories($this->getUser()->getId());
27
28
        return $this->render('bookmark/index.html.twig', [
29
            'bookmarks' => $result['bookmarks'],
30
            'categories' => $result['categories'],
31
        ]);
32
    }
33
}
34