Skip to content

Conversation

jaapio
Copy link
Member

@jaapio jaapio commented Apr 8, 2024

Throw on invalid type definitions and unexpected type definitions. Not all types resolved by phpstan's parser are valid for docblocks, they might in a more complex type system but I do not see how these types would ever apply to param tags.

Throw on invalid type definitions and unexpected type definitions.
Not all types resolved by phpstan's parser are valid for docblocks,
they might in a more complex type system but I do not see how these
types would ever apply to param tags.
@jaapio
Copy link
Member Author

jaapio commented Apr 8, 2024

@williamdes these changes should fix the reported regressions on param tags. It might be that some other regressions are in the other tags, but as we are really scratching the edge cases I think we are kinda safe to except this.

Before the reported type was also off for both cases. Resulting in unexpected types, so I do think it's ok to cover them whenever they pop up.

@jaapio jaapio merged commit 67a55cc into 5.x Apr 8, 2024
@jaapio jaapio deleted the fix/malformed-type-definitions branch April 8, 2024 19:45
@williamdes
Copy link
Contributor

The code looks good

so I do think it's ok to cover them whenever they pop up.

That part I am not sure to understand

@jaapio
Copy link
Member Author

jaapio commented Apr 9, 2024

We do support more types, but not all tags are covered by test completely. So some supported types might not be applicable to the location they are used. The array offset is an example of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants