Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'getExtension' method to the File class #559

Merged
merged 1 commit into from
Oct 8, 2022
Merged

Add 'getExtension' method to the File class #559

merged 1 commit into from
Oct 8, 2022

Conversation

chikaldirick
Copy link

@chikaldirick chikaldirick commented Oct 8, 2022

This PR adds getExtension(): string method to the File.php class that by using pathinfo() method under the hood returns extension of a file as a result.
To confirm that everything works as expected I've attached a simple test in FileTest.php file that check few potential use cases.
This should close issue #556

@codecov
Copy link

codecov bot commented Oct 8, 2022

Codecov Report

Merging #559 (33c7b9a) into master (ff88b13) will not change coverage.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##              master      #559   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       972       973    +1     
===========================================
  Files            113       113           
  Lines           2405      2407    +2     
===========================================
+ Hits            2405      2407    +2     
Impacted Files Coverage Δ
packages/framework/src/Models/Support/File.php 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@caendesilva caendesilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fantastic, thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants