8000 refector · Dheia/laravel-NativePHP@aff2080 · GitHub
[go: up one dir, main page]

Skip to content

Commit aff2080

Browse files
committed
refector
1 parent ae1266e commit aff2080

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/Dialog.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,23 @@ public function asSheet(string $windowId = null): self
121121
return $this;
122122
}
123123

124-
public function open()
124+
public function dataArray(): array
125125
{
126-
$result = $this->client->post('dialog/open', [
126+
return [
127127
'title' => $this->title,
128128
'windowReference' => $this->windowReference,
129129
'defaultPath' => $this->defaultPath,
130130
'filters' => $this->filters,
131131
'buttonLabel' => $this->buttonLabel,
132132
'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');
134139

135-
if (! in_array('multiSelections', $this->properties)) {
140+
if (!in_array('multiSelections', $this->properties)) {
136141
return $result[0] ?? null;
137142
}
138143

@@ -141,13 +146,6 @@ public function open()
141146

142147
public function save()
143148
{
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');
152150
}
153151
}

0 commit comments

Comments
 (0)
0