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

final modifier for private method is no longer allowed in PHP8 #147

Merged
merged 3 commits into from
Sep 29, 2020

Conversation

shmurakami
Copy link
Contributor

In PHP8 it occurs this warning.

Private methods cannot be final as they are never overridden by other classes

Caused by this PHP8 change https://wiki.php.net/rfc/inheritance_private_methods

private and final modifiers can't be used both.

src/Enum.php Outdated
@@ -81,7 +81,7 @@ public function __toString(): string
* @throws LogicException Enums are not cloneable
* because instances are implemented as singletons
*/
final private function __clone()
private function __clone()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be final protected then, to prevent overwriting the method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool. final protected is more better. Let me update.

Copy link
Owner

@marc-mabe marc-mabe left a comment

Choose a reason for hiding this comment

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

Thanks for your PR.
I still need to make fix some development deps to make all tests run on 8

@marc-mabe marc-mabe added this to the 4.3.1 milestone Sep 29, 2020
@marc-mabe marc-mabe added the bug label Sep 29, 2020
@marc-mabe marc-mabe merged commit 3a43735 into marc-mabe:master Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants