CalendarWeek   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 2
cbo 0
dl 0
loc 23
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getYear() 0 4 1
A getWeek() 0 4 1
1
<?php
2
3
namespace JPBernius\FMeat\Entities;
4
5
class CalendarWeek {
6
        /** @var int */
7
        private $yearNumber;
8
9
        /** @var int */
10
        private $weekNumber;
11
12 6
        public function __construct($yearNumber, $weekNumber)
13
        {
14 6
            $this->yearNumber = $yearNumber;
15 6
            $this->weekNumber = $weekNumber;
16 6
        }
17
18 6
        public function getYear(): string
19
        {
20 6
            return strval($this->yearNumber);
21
        }
22
        
23 6
        public function getWeek(): string
24
        {
25 6
            return sprintf('%02d', $this->weekNumber);
26
        }
27
}