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