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

ChartController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A playerRanking() 0 9 1
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