-
Notifications
You must be signed in to change notification settings - Fork 2k
docs: fix PHPDoc types in Factories #6751
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
Conversation
Co-authored-by: MGatner <[email protected]>
|
@kenjis it seems like you've made a move to keep PHPDoc tags strictly to the PHPDoc officially supported annotations. I would like us to step back and find consensus on our approach, because this is not something we have held to before. I could see this going either way. If we start using vendor tags, do other vendors miss out on the enhanced types? Or, if we only use the vanilla tags: does PHPDoc or certain vendors fail to parse correctly? If anyone has answers or best practices please share. I will plan to do some research on the subject as well. @codeigniter4/core-team |
|
In my repos, I always strive to use the generally available PHPDoc tags. However, if there's a chance to enhance the type further with specific tags, for example with PHPStan, I will add the phpstan-specific tags. |
3b56fe0 to
34f0867
Compare
|
@paulbalandan Does that mean you never use |
|
I'm seeing three levels here:
The problem seems to be that 1. is clearly defined but 2. and 3. are not. Probably some more research (I haven't done it yet) could help clarify but it is probably a bit of a moving target. We should define explicitly what we want to support product-wise so once we have an idea of 2 versus 3 we can make a policy (unless of course we only want 1 for vanilla tags and everything else is vendored). |
On regular tags like |
|
Intelephense and PHPStorm both support array shapes (I use them a lot at work), and I think VSCode does as well (for sure with Intelephense). |
|
I'm using intelephense for vscode and it cannot recognize array shapes yet. |
|
Now I'm going to have to go test... I'm using Intelephense in BBEdit and I swear it recognizes array shapes but maybe not?? FYI this has been on my list to get set up and try as an alternative to Intelephense: https://github.com/phpactor/phpactor It basically lets you use PHPStan as an LSP! |
|
VS Code deep-assoc-completion seems to support array shapes. |
|
@MGatner Can I merge this? |
MGatner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Please do.
Description
Explain what you have changed, and why.
Checklist: