PHP 7.4: new RemovedOrphanedParent sniff by jrfnl · Pull Request #818 · PHPCompatibility/PHPCompatibility
Navigation Menu
{{ message }}
PHPCompatibility / PHPCompatibility Public
- Notifications You must be signed in to change notification settings
- Fork 204
Merged
Jun 16, 2019Merged
Conversation
Copy link Copy Markdown
Member
jrfnl
commented
Jun 14, 2019
jrfnl
commented
- Core
Using "parent" inside a class without parent is deprecated, and will throw
a compile-time error in the future. Currently an error will only be
generated if/when the parent is accessed at run-time.
Refs:
- https://github.com/php/php-src/blob/42cc58ff7b2fee1c17a00dc77a4873552ffb577f/UPGRADING#L303
- Warn on "parent" without parent at compile-time php/php-src#3404
- Add compile-time warning on invalid parent use php/php-src#3564
- php/php-src@a9e6667 (originally committed as hard compile time error)
- php/php-src@deb44d4 (reverted back to deprecation error)
Loosely related to #808
I've opted to add this sniff to the Classes category as the use of the parent keyword in a class without parent requires examining the class declaration statement, though it can be argued that it should be in the Keywords category as the focus is on the parent keyword.
> - Core > Using "parent" inside a class without parent is deprecated, and will throw > a compile-time error in the future. Currently an error will only be > generated if/when the parent is accessed at run-time. Refs: * https://github.com/php/php-src/blob/42cc58ff7b2fee1c17a00dc77a4873552ffb577f/UPGRADING#L303 * php/php-src#3404 * php/php-src#3564 * php/php-src@a9e6667 (originally committed as hard compile time error) * php/php-src@deb44d4 (reverted back to deprecation error)
jrfnl
added
Type: enhancement
PR: ready for review
labels
jrfnl
added this to the
9.2.0 milestone
jrfnl
requested a review
from wimg
jrfnl
added
the
PR: high priority
label
wimg approved these changes Jun 16, 2019
wimg
merged commit
b8db795
into
master
delete-merged-branch
bot
deleted the
php-7.4/deprecated-parent-in-class-without-parent
branch
jrfnl
removed
the
PR: ready for review
label
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