Closed caendesilva closed 2 years ago
Hey! I've just posted a PR that brings File::getExtension(): string
method: https://github.com/hydephp/develop/pull/559
I've attached a simple test that check its functionality. Please, let me know if you need some adjustments there.
Hey! I've just posted a PR that brings
File::getExtension(): string
method: #559 I've attached a simple test that check its functionality. Please, let me know if you need some adjustments there.
Merged into master! Thank you for your contribution!
This is a great task for Hacktoberfest beginners! (Some knowledge using PHPUnit may be required)
In the
File
class we have a few helpers that allows developers to write more fluent code, for example$file->getPath()
to get the path. I propose we add a new helper,$path->getExtension()
which usespathinfo($file->path, PATHINFO_EXTENSION)
to return the extension.Here are some ideas for how I would go about implementing this, in case you need some ideas.
File.php
namedgetExtension()
that uses thepathinfo()
function to return the extensionFileTest.php
file, and verify the tests passhydephp/develop
) repositoryIf you're interested in giving this a shot, leave a comment so others know you are working on it. And let me know if you need any help! Good luck!