SongController::getSongAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace PHPDish\DailySongPlugin\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
use Symfony\Component\HttpFoundation\Response;
7
8
class SongController extends Controller
9
{
10
    /**
11
     * 获取最近的一首歌.
12
     *
13
     * @return Response
14
     */
15
    public function getSongAction()
16
    {
17
        $manager = $this->get('phpdish.manager.song');
18
19
        return $this->render('PHPDishDailySongPlugin::_daily_song.html.twig', [
20
            'song' => $manager->getLatestSong(),
21
        ]);
22
    }
23
}
24