6
6
7
7
abstract class Dialog
8
8
{
9
-
10
9
/** @var string */
11
10
protected $ title ;
12
11
@@ -15,7 +14,7 @@ abstract class Dialog
15
14
16
15
/** @var string */
17
16
protected $ callbackId ;
18
-
17
+
19
18
/** @var array */
20
19
protected $ elements = [];
21
20
@@ -65,7 +64,7 @@ public function add(string $label, string $name, string $type, array $additional
65
64
public function text (string $ label , string $ name , $ value = null , $ additional = [])
66
65
{
67
66
return $ this ->add ($ label , $ name , 'text ' , array_merge ([
68
- 'value ' => $ value
67
+ 'value ' => $ value,
69
68
], $ additional ));
70
69
}
71
70
@@ -79,7 +78,7 @@ public function text(string $label, string $name, $value = null, $additional = [
79
78
public function textarea (string $ label , string $ name , $ value = null , $ additional = [])
80
79
{
81
80
return $ this ->add ($ label , $ name , 'textarea ' , array_merge ([
82
- 'value ' => $ value
81
+ 'value ' => $ value,
83
82
], $ additional ));
84
83
}
85
84
@@ -94,7 +93,7 @@ public function email(string $label, string $name, $value = null, $additional =
94
93
{
95
94
return $ this ->add ($ label , $ name , 'text ' , array_merge ([
96
95
'subtype ' => 'email ' ,
97
- 'value ' => $ value
96
+ 'value ' => $ value,
98
97
], $ additional ));
99
98
}
100
99
@@ -109,7 +108,7 @@ public function number(string $label, string $name, $value = null, $additional =
109
108
{
110
109
return $ this ->add ($ label , $ name , 'text ' , array_merge ([
111
110
'subtype ' => 'number ' ,
112
- 'value ' => $ value
111
+ 'value ' => $ value,
113
112
], $ additional ));
114
113
}
115
114
@@ -124,7 +123,7 @@ public function tel(string $label, string $name, $value = null, $additional = []
124
123
{
125
124
return $ this ->add ($ label , $ name , 'text ' , array_merge ([
126
125
'subtype ' => 'tel ' ,
127
- 'value ' => $ value
126
+ 'value ' => $ value,
128
127
], $ additional ));
129
128
}
130
129
@@ -139,7 +138,7 @@ public function url(string $label, string $name, $value = null, $additional = []
139
138
{
140
139
return $ this ->add ($ label , $ name , 'text ' , array_merge ([
141
140
'subtype ' => 'url ' ,
142
- 'value ' => $ value
141
+ 'value ' => $ value,
143
142
], $ additional ));
144
143
}
145
144
@@ -151,10 +150,10 @@ public function toArray()
151
150
$ this ->buildForm ();
152
151
153
152
return [
154
- " callback_id " => $ this ->callbackId ,
155
- " title " => $ this ->title ,
156
- " submit_label " => $ this ->submitLabel ,
157
- " elements " => $ this ->elements
153
+ ' callback_id ' => $ this ->callbackId ,
154
+ ' title ' => $ this ->title ,
155
+ ' submit_label ' => $ this ->submitLabel ,
156
+ ' elements ' => $ this ->elements ,
158
157
];
159
158
}
160
159
}
0 commit comments