Date   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 50%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A toString() 0 4 1
A __toString() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace Bigwhoop\Trumpet\Config;
4
5
final class Date
6
{
7
    /** @var \DateTime */
8
    public $date;
9
10
    /** @var string */
11
    public $format = '';
12
13 2
    public function __construct(\DateTime $date, string $format = 'l, F j Y')
14
    {
15 2
        $this->date = $date;
16 2
        $this->format = $format;
17 2
    }
18
19
    public function toString(): string
20
    {
21
        return $this->date->format($this->format);
22
    }
23
24
    public function __toString(): string
25
    {
26
        return $this->toString();
27
    }
28
}
29