@@ -121,21 +121,9 @@ public function asSheet(string $windowId = null): self
121
121
return $ this ;
122
122
}
123
123
124
- public function dataArray (): array
125
- {
126
- return [
127
- 'title ' => $ this ->title ,
128
- 'windowReference ' => $ this ->windowReference ,
129
- 'defaultPath ' => $ this ->defaultPath ,
130
- 'filters ' => $ this ->filters ,
131
- 'buttonLabel ' => $ this ->buttonLabel ,
132
- 'properties ' => array_unique ($ this ->properties ),
133
- ];
134
- }
135
-
136
124
public function open ()
137
125
{
138
- $ result = $ this ->client ->post ('dialog/open ' , $ this ->dataArray ())->json ('result ' );
126
+ $ result = $ this ->client ->post ('dialog/open ' , $ this ->dialogData ())->json ('result ' );
139
127
140
128
if (!in_array ('multiSelections ' , $ this ->properties )) {
141
129
return $ result [0 ] ?? null ;
@@ -146,6 +134,18 @@ public function open()
146
134
147
135
public function save ()
148
136
{
149
- return $ this ->client ->post ('dialog/save ' , $ this ->dataArray ())->json ('result ' );
137
+ return $ this ->client ->post ('dialog/save ' , $ this ->dialogData ())->json ('result ' );
138
+ }
139
+
140
+ public function dialogData (): array
141
+ {
142
+ return [
143
+ 'title ' => $ this ->title ,
144
+ 'windowReference ' => $ this ->windowReference ,
145
+ 'defaultPath ' => $ this ->defaultPath ,
146
+ 'filters ' => $ this ->filters ,
147
+ 'buttonLabel ' => $ this ->buttonLabel ,
148
+ 'properties ' => array_unique ($ this ->properties ),
149
+ ];
150
150
}
151
151
}
0 commit comments