From 0571391b10a48e6d6cbf8abfbe0d2e4a9fc26d0f Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 3 Mar 2022 05:10:57 +0000 Subject: Extend simple file with extension getter Signed-off-by: Christopher Ng --- lib/public/Files/SimpleFS/InMemoryFile.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/public/Files/SimpleFS/InMemoryFile.php') diff --git a/lib/public/Files/SimpleFS/InMemoryFile.php b/lib/public/Files/SimpleFS/InMemoryFile.php index 6020b42d953..4606fe9bd8a 100644 --- a/lib/public/Files/SimpleFS/InMemoryFile.php +++ b/lib/public/Files/SimpleFS/InMemoryFile.php @@ -126,6 +126,13 @@ class InMemoryFile implements ISimpleFile { return $fileInfo->buffer($this->contents); } + /** + * {@inheritDoc} + */ + public function getExtension(): string { + return \pathinfo($this->name, PATHINFO_EXTENSION); + } + /** * Stream reading is unsupported for in memory files. * -- cgit v1.2.3