MutableDatablePostModelTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 30
ccs 0
cts 12
cp 0
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setDate() 0 5 1
A setDateModifiedGmt() 0 5 1
A setDateGmt() 0 5 1
A setDateModified() 0 5 1
1
<?php
2
3
namespace Leonidas\Library\System\Model\Abstracts\Post;
4
5
use DateTimeInterface;
6
use Leonidas\Contracts\System\Model\DatableInterface;
7
8
trait MutableDatablePostModelTrait
9
{
10
    use DatablePostModelTrait;
11
12
    public function setDate(DateTimeInterface $date): self
13
    {
14
        $this->post->post_date = $date->format(DatableInterface::DATE_FORMAT);
15
16
        return $this;
17
    }
18
19
    public function setDateGmt(DateTimeInterface $date): self
20
    {
21
        $this->post->post_date_gmt = $date->format(DatableInterface::DATE_FORMAT);
22
23
        return $this;
24
    }
25
26
    public function setDateModified(DateTimeInterface $date): self
27
    {
28
        $this->post->post_modified = $date->format(DatableInterface::DATE_FORMAT);
29
30
        return $this;
31
    }
32
33
    public function setDateModifiedGmt(DateTimeInterface $date): self
34
    {
35
        $this->post->post_modified_gmt = $date->format(DatableInterface::DATE_FORMAT);
36
37
        return $this;
38
    }
39
}
40