Skip to content

RemovedCallingDestructAfterConstructorExit: improve warning message#1283

Merged
wimg merged 1 commit intodevelopfrom
php-8.0/removeddestructafterconstructorexit-improve-error-msg
Apr 17, 2021
Merged

RemovedCallingDestructAfterConstructorExit: improve warning message#1283
wimg merged 1 commit intodevelopfrom
php-8.0/removeddestructafterconstructorexit-improve-error-msg

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Apr 11, 2021

This sniff can throw an error or a warning depending on whether a destruct() method has been found in the class (error) or not, but the class has a parent class or uses traits (warning).

This improves the message shown for the warning case to make it clearer how to take action on the issue.

It also ensures that the error and the warning each have a unique error code.

Note: as this is a new sniff in PHPCompatibility 10.0.0, the error code change has no consequences.

This sniff can throw an error or a warning depending on whether a `destruct()` method has been found in the class (error) or not, but the class has a parent class or uses traits (warning).

This improves the message shown for the `warning` case to make it clearer how to take action on the issue.

It also ensure that the error and the warning each have a unique error code.
@jrfnl jrfnl added this to the 10.0.0 milestone Apr 11, 2021
@jrfnl jrfnl requested a review from wimg April 11, 2021 21:34
@wimg wimg merged commit ed88be0 into develop Apr 17, 2021
@wimg wimg deleted the php-8.0/removeddestructafterconstructorexit-improve-error-msg branch April 17, 2021 15:28
@jrfnl jrfnl removed PR: quick merge PR only contains relatively simple changes PR: ready for review labels Apr 17, 2021
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