Passed
Pull Request — main (#22)
by
unknown
09:54
created

FlowButton   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 17
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A subType() 0 3 1
1
<?php
2
3
namespace NotificationChannels\WhatsApp\Component;
4
5
use NotificationChannels\WhatsApp\Component\Component;
6
7
class FlowButton extends Button
8
{
9
10
    public function __construct(?string $token, array $data)
11
    {
12
        $this->parameters[] = [
13
            'type' => 'action',
14
            'action' => [
15
                'flow_token' => $token,
16
                'flow_action_data' => $data
17
            ],
18
        ];
19
    }
20
21
    public function subType(): string
22
    {
23
        return 'flow';
24
    }
25
}
26