Passed
Push — main ( c5d93b...c2e6dd )
by Alejandro
08:35 queued 06:32
created

Component::flowButton()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace NotificationChannels\WhatsApp;
4
5
class Component
6
{
7
    /**
8
     * Currency code as defined in ISO 4217.
9
     */
10 1
    public static function currency(float $amount, string $code = 'EUR'): Component\Currency
11
    {
12 1
        return new Component\Currency($amount, $code);
13
    }
14
15 1
    public static function dateTime(\DateTimeImmutable $dateTime, string $format = 'Y-m-d H:i:s'): Component\DateTime
16
    {
17 1
        return new Component\DateTime($dateTime, $format);
18
    }
19
20 1
    public static function document(string $link): Component\Document
21
    {
22 1
        return new Component\Document($link);
23
    }
24
25 1
    public static function image(string $link): Component\Image
26
    {
27 1
        return new Component\Image($link);
28
    }
29
30 1
    public static function text(string $text): Component\Text
31
    {
32 1
        return new Component\Text($text);
33
    }
34
35 1
    public static function video(string $link): Component\Video
36
    {
37 1
        return new Component\Video($link);
38
    }
39
40 1
    public static function urlButton(array $urls): Component\UrlButton
41
    {
42 1
        return new Component\UrlButton($urls);
43
    }
44
45 1
    public static function quickReplyButton(array $payloads): Component\QuickReplyButton
46
    {
47 1
        return new Component\QuickReplyButton($payloads);
48
    }
49
50 1
    public static function flowButton(string $token, array $data): Component\FlowButton
51
    {
52 1
        return new Component\FlowButton($token, $data);
53
    }
54
}
55