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

UrlBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrlForLocationYearWeek() 0 5 1
A formatWeekNumber() 0 3 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
}