Passed
Push — develop ( e091bc...cf0cee )
by
unknown
01:07
created

ChartController::getChartBreadcrumbs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 11
nc 1
nop 1
dl 0
loc 16
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
namespace VideoGamesRecords\CoreBundle\Controller;
4
5
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
6
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7
use VideoGamesRecords\CoreBundle\Entity\Chart;
8
use Symfony\Component\HttpFoundation\Request;
9
use Symfony\Component\HttpFoundation\JsonResponse;
10
11
/**
12
 * Class ChartController
13
 */
14
class ChartController extends Controller
15
{
16
17
18
    /**
19
     * @param Chart    $chart
20
     * @param Request $request
21
     * @return mixed
22
     */
23
    public function playerRanking(Chart $chart, Request $request)
24
    {
25
        $maxRank = $request->query->get('maxRank', 20);
26
        $idPlayer = $request->query->get('idPlayer', null);
0 ignored issues
show
Unused Code introduced by
The assignment to $idPlayer is dead and can be removed.
Loading history...
27
        $ranking = $this->getDoctrine()
28
            ->getRepository('VideoGamesRecordsCoreBundle:PlayerChart')
29
            ->getRanking($chart, null, $maxRank);
30
31
        return $ranking;
32
    }
33
}
34