Skip to content
New issue

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

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

Already on GitHub? # to your account

Use PhpDocParser for property parsing #680

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Use PhpDocParser for property parsing #680

merged 1 commit into from
Oct 9, 2024

Conversation

hrach
Copy link
Member

@hrach hrach commented Oct 9, 2024

This is the first part for #521: adoption of PHPStan's PhpDocParser.
For 5.0 I do not plan to introduce any more parsing features, but this should at least provide some validation consistency.

New behavior:

  • [new] When the type is not simple enough -> exception
  • [new] Understands (parser as a simple array) array shapes
  • [new] Understands (parses as a simple object) object shapes
  • Supports union & intersection types
  • Parser all previously supported types
  • Prases nullability in both forms (?, |null)
  • Removes support for scalar type (BC break!)

@hrach
Copy link
Member Author

hrach commented Oct 9, 2024

cc @mabar

@hrach hrach added this to the v5.0 milestone Oct 9, 2024
@hrach hrach enabled auto-merge October 9, 2024 22:34
@hrach hrach merged commit f83c99e into main Oct 9, 2024
8 checks passed
@hrach hrach deleted the phpdoc-parser branch October 9, 2024 22:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant