Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: property type declaration support (PHP 7.4+) #58

Merged
merged 6 commits into from
Nov 13, 2019

Conversation

michalbundyra
Copy link
Member

As of PHP 7.4 we can declare property type.

Add support for property types in the following sniff:

  • Commenting\PropertyAnnotation - ensure that type is skipped when detecting the comment before property

  • Commenting\VariableComment - add multiple checks to ensure type declaration is consistent with type provided in PHPDoc (@var tag).
    In case type declaration is provided and PHPDoc does not contain any additional information, @var tag can be omitted.

As of PHP 7.4 we can declare property type.
Add support for property types in the following sniff:
- `Commenting\PropertyAnnotation` - ensure that type is skipped when
  detecting the comment before property
- `Commenting\VariableComment` - add multiple checks to ensure type
  declaration is consistent with type provided in PHPDoc (`@var` tag).
  In case type declaration is provided and PHPDoc does not contain any
  additional information, `@var` tag can be omitted.
@michalbundyra michalbundyra added the enhancement New feature or request label Nov 13, 2019
@michalbundyra michalbundyra added this to the 1.1.0 milestone Nov 13, 2019
Description might not be set and preg_split result will just have one
value if there is comment closing tag after the tag content
On fixing we add the description back only when it was set.
It could be an empty string, so we need then add just a space
- so we have one space before closing comment tag.
michalbundyra added a commit that referenced this pull request Nov 13, 2019
Feature: property type declaration support (PHP 7.4+)
michalbundyra added a commit that referenced this pull request Nov 13, 2019
michalbundyra added a commit that referenced this pull request Nov 13, 2019
@michalbundyra michalbundyra merged commit 41cc9e3 into develop Nov 13, 2019
@michalbundyra michalbundyra deleted the feature/property-type-php7.4 branch November 13, 2019 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant