Skip to content

Commit

Permalink
feat: added get Extension and toString method
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKoehnen committed Nov 17, 2022
1 parent d4abfb3 commit 918e225
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 918e225

Please sign in to comment.