WanderRuntime::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Twig;
4
5
use App\Entity\Wander;
6
use Twig\Extension\RuntimeExtensionInterface;
7
8
class WanderRuntime implements RuntimeExtensionInterface
9
{
10
    /** @var string */
11
    private $imgUrl;
12
13
    /** @var string */
14
    private $fileType;
15
16
    public function __construct(string $sectorImgUrl, string $sectorImgUrlFileType)
17
    {
18
        $this->imgUrl = $sectorImgUrl; // e.g. '/images/sectors/'
19
        $this->fileType = $sectorImgUrlFileType;
20
    }
21
22
    public function sectorImgUrl(Wander $wander): string
23
    {
24
        // TODO: Maybe default to an unknown image?
25
        return $this->imgUrl . $wander->getSector() . '.' . $this->fileType;
26
    }
27
}