Skip to content

PHP 7.4: new RemovedOrphanedParent sniff#818

Merged
wimg merged 1 commit intomasterfrom
php-7.4/deprecated-parent-in-class-without-parent
Jun 16, 2019
Merged

PHP 7.4: new RemovedOrphanedParent sniff#818
wimg merged 1 commit intomasterfrom
php-7.4/deprecated-parent-in-class-without-parent

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Jun 14, 2019

  • 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:

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)
@wimg wimg merged commit b8db795 into master Jun 16, 2019
@delete-merged-branch delete-merged-branch bot deleted the php-7.4/deprecated-parent-in-class-without-parent branch June 16, 2019 13:15
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