Event   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 5
eloc 6
c 2
b 0
f 1
dl 0
loc 29
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A event_field() 0 3 1
A event_value() 0 3 1
A event_label() 0 3 1
A date() 0 3 1
A today() 0 3 1
1
<?php
2
3
namespace HexMakina\kadro\Models\Abilities;
4
5
use HexMakina\Tempus\Dato;
6
7
trait Event
8
{
9
10
    abstract public function get($prop_name);
11
    abstract public function __toString();
12
13
    public function event_field()
14
    {
15
        return 'occured_on';
16
    }
17
18
    public function event_value()
19
    {
20
        return $this->get($this->event_field());
21
    }
22
23
    public function event_label()
24
    {
25
        return '' . $this;
26
    }
27
28
    public static function today($format = Dato::FORMAT)
29
    {
30
        return Dato::today($format);
31
    }
32
33
    public static function date($date = null, $format = Dato::FORMAT)
34
    {
35
        return Dato::format($date, $format);
36
    }
37
}
38