Commit ced08bcc authored by Richard Weinhold's avatar Richard Weinhold 🎩

improves runtime-issue handling for flysystem storage

parent 5c41c63f
Pipeline #5416 passed with stages
in 12 seconds
......@@ -59,10 +59,16 @@ class Flysystem extends Storage
public function getMetadata(): array
{
if ($this->metadata === null) {
$this->metadata = $this->flysystem->getMetadata($this->path);
if (false !== $metadata = $this->flysystem->getMetadata($this->path)) {
$this->metadata = $metadata;
} else {
// something went terrible wrong...
return ['type' => null];
}
}
return $this->metadata;
return (array) $this->metadata;
}
/**
......@@ -90,7 +96,8 @@ class Flysystem extends Storage
{
return array_merge(parent::getDetails(), [
'type' => get_class($this->flysystem->getAdapter()),
'path' => $this->path
'path' => $this->path,
'metadata' => $this->getMetadata(),
]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment