Component   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

9 Methods

Rating   Name   Duplication   Size   Complexity  
A video() 0 3 1
A text() 0 3 1
A currency() 0 3 1
A image() 0 3 1
A dateTime() 0 3 1
A document() 0 3 1
A quickReplyButton() 0 3 1
A urlButton() 0 3 1
A flowButton() 0 3 1
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, ?string $filename = null): Component\Document
21
    {
22 1
        return new Component\Document($link, $filename);
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