Divider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 34
ccs 6
cts 6
cp 1
rs 10
wmc 2

1 Method

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