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

Adds Stringable interface to all classes containing __toString() method. #620

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

Cbrad24
Copy link
Contributor

@Cbrad24 Cbrad24 commented Jul 12, 2023

Since this project now requires a minimum PHP version of 8.1, PHP 8.0 introduced a new interface called Stringable which we are able to explicitly implement.

As the excerpt from the linked docs states above, although any class implementing __toString() will automatically gain the Stringable interface, it can and should be declared explicitly (presumably for future versions of PHP, and IDE help etc).

This PR implements Stringable to all classes implementing the __toString() method.

Copy link
Member

@stevebauman stevebauman left a comment

Choose a reason for hiding this comment

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

Thanks @Cbrad24!

@stevebauman stevebauman merged commit 8978581 into DirectoryTree:master Jul 17, 2023
6 checks passed
@Cbrad24 Cbrad24 deleted the stringable branch July 17, 2023 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants