Completed
Push — master ( f2324b...cefc4c )
by Daniel
49s
created

DateTimeView   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 28
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getTag() 0 4 1
A getFormatted() 0 4 1
A getDateTime() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\ContentType\Standard\View;
6
7
use Psi\Component\ContentType\View\ViewInterface;
8
9
class DateTimeView implements ViewInterface
10
{
11
    private $dateTime;
12
    private $formatted;
13
    private $tag;
14
15
    public function __construct(string $formatted, \DateTime $dateTime, string $tag = null)
16
    {
17
        $this->formatted = $formatted;
18
        $this->dateTime = $dateTime;
19
        $this->tag = $tag;
20
    }
21
22
    public function getTag(): string
23
    {
24
        return $this->tag;
25
    }
26
27
    public function getFormatted(): string
28
    {
29
        return $this->formatted;
30
    }
31
32
    public function getDateTime(): \DateTime
33
    {
34
        return $this->dateTime;
35
    }
36
}
37