You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tag "@property" has error when both ? and null types are included #3987
Additional context: This becomes an issue in the DPHP library because it specifically uses ? in the PHPDocs to indicate which parameters are considered optional by Discord's API, and therefore may be optional to set in a userland environment when making an API query. It always includes the traditional syntax of type|null but also prepends ? for these cases.
The reason we support ? is because that was the way php indicated nullable parameters before union types became a feature.
Using this for a different purpose doesn't make sense to me. And will only confuse people. Therefore I think this should not be a feature in phpDocumentor to support this.
It's probably better to add this in your description as it will display better in your docs. You could even use a custom tag like @optional in the description. And customized the template for properties to display them in a different way when they have the custom tag.
Activity
jaapio commentedon Oct 21, 2025
The reason we support
?is because that was the way php indicated nullable parameters before union types became a feature.Using this for a different purpose doesn't make sense to me. And will only confuse people. Therefore I think this should not be a feature in phpDocumentor to support this.
It's probably better to add this in your description as it will display better in your docs. You could even use a custom tag like
@optionalin the description. And customized the template for properties to display them in a different way when they have the custom tag.