Year   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A now() 0 7 1
1
<?php
2
3
namespace ValueObjects\DateTime;
4
5
use ValueObjects\Number\Integer;
6
7
class Year extends Integer
8
{
9
    /**
10
     * Returns the current year.
11
     *
12
     * @return Year
13
     */
14 4
    public static function now()
15
    {
16 4
        $now  = new \DateTime('now');
17 4
        $year = \intval($now->format('Y'));
18
19 4
        return new static($year);
20
    }
21
}
22