Skip to content

Commit a23a5cf

Browse files
committed
Optimization.
1 parent e43fb9c commit a23a5cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/LogWeaver.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,13 @@ private function waitForContentFromDisk(string $path): void
180180
*/
181181
public function log(?string $path = null, bool $wait = false): array
182182
{
183+
$storage = Storage::disk($this->getDisk());
184+
183185
if (is_null($path)) {
184186
$path = sprintf('%s/%s.json', $this->getDirectory(), Str::random(40));
185187
}
186188

187-
$check = Storage::disk($this->getDisk())->put($path, json_encode($this->getValidatedData()));
189+
$check = $storage->put($path, json_encode($this->getValidatedData()));
188190

189191
if ($wait) {
190192
$this->waitForContentFromDisk($path);
@@ -193,7 +195,7 @@ public function log(?string $path = null, bool $wait = false): array
193195
return [
194196
'status' => $check,
195197
'path' => $path,
196-
'url' => $check ? Storage::disk($this->getDisk())->url($path) : null,
198+
'url' => $check ? $storage->url($path) : null,
197199
];
198200
}
199201
}

0 commit comments

Comments
 (0)