Overflow   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 38
ccs 8
cts 8
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 13 2
1
<?php
2
namespace Maknz\Slack\BlockElement;
3
4
class Overflow extends Options
5
{
6
    /**
7
     * Block type.
8
     *
9
     * @var string
10
     */
11
    protected $type = 'overflow';
12
13
    /**
14
     * Internal attribute to property map.
15
     *
16
     * @var array
17
     */
18
    protected static $availableAttributes = [
19
        'action_id' => 'action_id',
20
        'options'   => 'options',
21
        'confirm'   => 'confirm',
22
    ];
23
24
    /**
25
     * Convert the block to its array representation.
26
     *
27
     * @return array
28
     */
29 1
    public function toArray()
30
    {
31 1
        $data = [
32 1
            'type'      => $this->getType(),
33 1
            'action_id' => $this->getActionId(),
34 1
            'options'   => $this->getOptionsAsArrays(),
35
        ];
36
37 1
        if ($this->getConfirm()) {
38 1
            $data['confirm'] = $this->getConfirm()->toArray();
39
        }
40
41 1
        return $data;
42
    }
43
}
44