Conversation
…estructAfterConstructorExit` sniff
> If an object constructor exit()s, the object destructor will no longer be
> called. This matches the behavior when the constructor throws.
Notes:
* This sniff will throw an error, even when there is no destructor as a destructor may be declared in a parent class.
We could reduce the potential noise from this sniff a little further by only throwing the error when the class either contains a `__destruct()` method or extends a parent class.
* The name for the sniff feels a bit long. Suggestions for a better/shorter name welcome.
Opinions ?
Refs:
* https://github.com/php/php-src/blob/71bfa5344ab207072f4cd25745d7023096338385/UPGRADING#L200-L201
* php/php-src#5768 (I suspect, but not 100% sure)
* php/php-src@75a04ea
wimg
approved these changes
Aug 18, 2020
Member
Author
|
He @wimg We forgot to discuss the open question in this PR in our call. Opinions ? |
Member
Sorry about that, I missed that. I believe this would be a valuable thing to do yes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes:
👉 We could reduce the potential noise from this sniff a little further by only throwing the error when the class either contains a
__destruct()method or extends a parent class. Should we ?Opinions ?
Refs:
Related to #809