SongExtension::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
}