Completed
Push — master ( 12c461...346425 )
by Jan Philip
03:11
created

UrlBuilder::getUrlForLocationYearWeek()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
crap 1
1
<?php
2
3
namespace JPBernius\FMeat\Utilities;
4
5
use JPBernius\FMeat\Configurations\Urls;
6
7
class UrlBuilder
8
{
9 3
    public function getUrlForLocationYearWeek(string $location, int $year, int $weekNumber)
10
    {
11 3
        $formattedWeekNumber = $this->formatWeekNumber($weekNumber);
12 3
        return sprintf(Urls::API_URL, $location, $year, $formattedWeekNumber);
13
    }
14
15 3
    private function formatWeekNumber(int $weekNumber): string {
16 3
        return sprintf('%02d', $weekNumber);
17
    }
18
}