SongExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PHPDish\DailySongPlugin\Twig;
6
7
use PHPDish\DailySongPlugin\Service\SongManagerInterface;
8
9
class SongExtension extends \Twig_Extension
10
{
11
    /**
12
     * @var SongManagerInterface
13
     */
14
    protected $songManager;
15
16
    public function __construct(SongManagerInterface $songManager)
17
    {
18
        $this->songManager = $songManager;
19
    }
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function getFunctions()
25
    {
26
        return [
27
            new \Twig_SimpleFunction('get_latest_song', [$this->songManager, 'getLatestSong']),
28
        ];
29
    }
30
}