- Issue created by @mstrelan
- ๐ฆ๐บAustralia dpi Perth, Australia
All for this, I find it frustrating that the wider PHP community has adopted in Stan / Psalm / others.
Recently the PHPDoc maintainer said something relevant to this topic:
https://phpc.social/@jaapio/112797821284066042
I'm going to try to reboot the working group for @phpfig's psr-5. Goal is to write down the standards we are already using in @phpstan @phpdoc @phpstorm, @psalm and many others.
I'm looking for people that will help me once in a while to check if I do not write down things that will break these amazing tools.Some projects have been left behind by recent innovation.
We should just allow anything, and let our approved static analyser (PHPStan) validate it. Its not really within the domain of Coding Standards to do validation.
See also, the discussion at #3309010: Support PHPDoc Types in @param @var @return annotations โ
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
Kind of duplicate of #3309010: Support PHPDoc Types in @param @var @return annotations โ .
Badly,badly needed if Drupal will ever try to get to PHPStan level 6+.
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
Added support, Next step - can we get some proposed text before/after in the IS please? thanks!
- ๐ซ๐ทFrance andypost
IS said
If multiple types are possible, separate them by a vertical bar ("|").
but there's DNF types since PHP 8.2 so it needs rewording
- ๐ฆ๐บAustralia mstrelan
@andypost that's the "before" section, we need to rewrite the "after" section. I'm proposing that we leave it mostly empty, and just linking off to phpstan docs.
- ๐ฆ๐บAustralia kim.pepper ๐โโ๏ธ๐ฆ๐บSydney, Australia
Jumping in to give my +1 to this.
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
Tried a stab at the to-be text.
Note that
Always prefix types with the fully-qualified namespace for classes and interfaces (beginning with a backslash). If the class/interface is in the global namespace, prefix by a backslash.
is not what other projects do, and #3360160: Stop using FQCN in PHPDoc annotations โ aims at removing it.
- ๐บ๐ธUnited States dww
Agreed with #3 -- isn't this fully duplicate with #3309010: Support PHPDoc Types in @param @var @return annotations โ ? Can we close this and focus efforts in one place?
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
Honestly now I prefer the turn that this issue has taken, and would rather close #3309010: Support PHPDoc Types in @param @var @return annotations โ as duplicate at this stage.
- ๐ฉ๐ชGermany FeyP
Looks like we already have enough supporters, but fwiw +1 on this one.