CalendarWeek::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 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
}