1 | <?php |
||
5 | class WebUrl extends AbstractButton |
||
6 | { |
||
7 | |||
8 | const RATIO_TYPE_COMPACT = 'compact'; |
||
9 | const RATIO_TYPE_TALL = 'tall'; |
||
10 | const RATIO_TYPE_FULL = 'full'; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $title; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $url; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $webviewHeightRatio; |
||
26 | |||
27 | /** |
||
28 | * @var null|bool |
||
29 | */ |
||
30 | protected $messengerExtension; |
||
31 | |||
32 | /** |
||
33 | * @var null|string |
||
34 | */ |
||
35 | protected $fallbackUrl; |
||
36 | |||
37 | /** |
||
38 | * @var null|string |
||
39 | */ |
||
40 | protected $webviewShareButton; |
||
41 | |||
42 | /** |
||
43 | * WebUrl constructor. |
||
44 | * |
||
45 | * @param string $title |
||
46 | * @param string $url |
||
47 | */ |
||
48 | 11 | public function __construct(string $title, string $url) |
|
58 | |||
59 | /** |
||
60 | * @param string $webviewHeightRatio |
||
61 | * @return WebUrl |
||
62 | */ |
||
63 | 8 | public function setWebviewHeightRatio(string $webviewHeightRatio): WebUrl |
|
71 | |||
72 | /** |
||
73 | * @param bool $messengerExtension |
||
74 | * @return WebUrl |
||
75 | */ |
||
76 | 5 | public function setMessengerExtension(bool $messengerExtension): WebUrl |
|
82 | |||
83 | /** |
||
84 | * @param string $fallbackUrl |
||
85 | * @return WebUrl |
||
86 | */ |
||
87 | 4 | public function setFallbackUrl(string $fallbackUrl): WebUrl |
|
95 | |||
96 | 1 | public function setWebviewShareButton(bool $webviewShareButton): WebUrl |
|
104 | |||
105 | /** |
||
106 | * @param string $webviewHeightRatio |
||
107 | * |
||
108 | * @throws \InvalidArgumentException |
||
109 | */ |
||
110 | 8 | private function isValidWebviewHeightRatio(string $webviewHeightRatio) |
|
117 | |||
118 | /** |
||
119 | * @return array |
||
120 | */ |
||
121 | 8 | private function getAllowedRatioType(): array |
|
129 | |||
130 | /** |
||
131 | * @return array |
||
132 | */ |
||
133 | 8 | public function jsonSerialize(): array |
|
147 | } |
||
148 |