| Total Complexity | 9 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 |
|
| 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 |
|
| 48 | } |
||
| 49 | |||
| 50 | 1 | public static function flowButton(string $token, array $data): Component\FlowButton |
|
| 55 |