Time   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A make() 0 7 1
A military() 0 4 1
1
<?php
2
3
namespace Yajra\DataTables\Html\Editor\Fields;
4
5
class Time extends DateTime
6
{
7
    /**
8
     * Make a new instance of a field.
9
     *
10
     * @param string $name
11
     * @param string $label
12
     * @return static|\Yajra\DataTables\Html\Editor\Fields\File
13
     */
14
    public static function make($name, $label = '')
15
    {
16
        /** @var \Yajra\DataTables\Html\Editor\Fields\Time $field */
17
        $field = parent::make($name, $label);
18
19
        return $field->format('hh:mm a');
20
    }
21
22
    /**
23
     * Set format to military time (24 hrs).
24
     *
25
     * @return $this
26
     */
27
    public function military()
28
    {
29
        return $this->format('HH:mm');
30
    }
31
}
32