Skip to content

PHP 7.4: new NewTypedProperties sniff#801

Merged
wimg merged 1 commit intomasterfrom
php-7.4/typed-properties
Jun 20, 2019
Merged

PHP 7.4: new NewTypedProperties sniff#801
wimg merged 1 commit intomasterfrom
php-7.4/typed-properties

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented May 31, 2019

PHP 7.4 will be introducing support for runtime-enforced first-class property type declarations.

Refs:

This PR introduces a new sniff to detect the use of these and report an error if PHP < 7.4 is intended to still be supported.

The PHP 7.4 implementation does not allow for properties with the void or callable type.
If these are detected and PHP 7.4 is supposed to be supported, an error will be thrown as well.

Related #808

@jrfnl jrfnl added this to the 9.x Next milestone May 31, 2019
@jrfnl jrfnl requested a review from wimg May 31, 2019 07:37
@jrfnl jrfnl force-pushed the php-7.4/typed-properties branch 2 times, most recently from e69c7e1 to eea9f2d Compare May 31, 2019 17:16
PHP 7.4 will be introducing support for runtime-enforced first-class property type declarations.

Ref: https://wiki.php.net/rfc/typed_properties_v2

This PR introduces a new sniff to detect the use of these and report an error if PHP < 7.4 is intended to still be supported.

The PHP 7.4 implementation does not allow for properties with the `void` or `callable` type.
If these are detected and PHP 7.4 is supposed to be supported, an error will be thrown as well.

Related:
* squizlabs/PHP_CodeSniffer#2413
@jrfnl jrfnl force-pushed the php-7.4/typed-properties branch from eea9f2d to 6a98aeb Compare May 31, 2019 19:04
@wimg wimg merged commit af1be2e into master Jun 20, 2019
@delete-merged-branch delete-merged-branch bot deleted the php-7.4/typed-properties branch June 20, 2019 18:44
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