From 918e225b088bc415fb9a36543c3de600864907d0 Mon Sep 17 00:00:00 2001 From: fabiankohnen Date: Thu, 17 Nov 2022 10:31:17 +0100 Subject: [PATCH] feat: added get Extension and toString method --- src/File.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/File.php b/src/File.php index b0c0650..563e54f 100644 --- a/src/File.php +++ b/src/File.php @@ -66,6 +66,16 @@ public function getBasename(): string return basename($this->filePath); } + public function getExtension(): string + { + return pathinfo($this->getPath(), 'extension'); + } + + public function __toString(): string + { + return $this->getPath(); + } + /** * @return resource */