Timepicker   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setInitialTime() 0 3 1
A getInitialTime() 0 3 1
A getInitialValueField() 0 3 1
A getInitialValueFormat() 0 3 1
1
<?php
2
namespace Maknz\Slack\BlockElement;
3
4
use DateTime;
5
6
class Timepicker extends Temporalpicker
7
{
8
    /**
9
     * Block type.
10
     *
11
     * @var string
12
     */
13
    protected $type = 'timepicker';
14
15
    /**
16
     * Internal attribute to property map.
17
     *
18
     * @var array
19
     */
20
    protected static $availableAttributes = [
21
        'action_id'    => 'action_id',
22
        'placeholder'  => 'placeholder',
23
        'initial_time' => 'initial_value',
24
        'confirm'      => 'confirm',
25
    ];
26
27
    /**
28
     * Get the name of the initial value field.
29
     *
30
     * @return string
31
     */
32 1
    public function getInitialValueField()
33
    {
34 1
        return 'initial_time';
35
    }
36
37
    /**
38
     * Get the initial value format.
39
     *
40
     * @return string
41
     */
42 1
    public function getInitialValueFormat()
43
    {
44 1
        return 'H:i';
45
    }
46
47
    /**
48
     * Get the initial time.
49
     *
50
     * @return \DateTime
51
     */
52 2
    public function getInitialTime()
53
    {
54 2
        return $this->getInitialValue();
55
    }
56
57
    /**
58
     * Set the initial time.
59
     *
60
     * @param \DateTime $initialTime
61
     *
62
     * @return $this
63
     */
64 1
    public function setInitialTime(DateTime $initialTime)
65
    {
66 1
        return $this->setInitialValue($initialTime);
67
    }
68
}
69