- Issue created by @mondrake
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
phpstan-drupal has a stub that defines
FieldItemListInterface
as a generic, so we need to pass the type in the PHPDocs here.See https://github.com/mglaman/phpstan-drupal/blob/main/stubs/Drupal/Core/Fi...
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
TBH I think itโs nonsense to have core lacking appropriate PHPDoc, for drupal-phpstan to write a stub gapfill, and then that gapfill to force back core implementationsโ PHPDocs to be adjustedโฆ
I would suggest to move the definitions in the stub from drupal-php to core as part of this issue.
- ๐บ๐ธUnited States mglaman WI, USA
phpstan-drupal uses a stub provider, so we can fix here and back port anything to phpstan-drupal and use a version check on Drupal to decide if the phpstan-drupal stub should be loaded or not
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
Done #7 for the Drupal core part (I think).
- ๐บ๐ธUnited States smustgrave
Left a comment on the MR but leaving in review for someone more familiar
- ๐บ๐ธUnited States smustgrave
Thanks for the response @mglaman. Moving to NW for rebase.
If you are another contributor eager to jump in, please allow the original poster @mglaman or @mondrake at least 48 hours to respond to feedback first, so they have the opportunity to finish what they started!
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
merged with 11.x, no conflicts. Dunno why GitLab still reports a merge error.
- ๐ฌ๐งUnited Kingdom catch
I'm really not sure about using templates like this. I realise I'm in the minority using vim (and without whatever vim support would take advantage of this, there's probably something somewhere), but don't think I'm the only one. There's also reading docs on api.drupal.org or gitlab which people sometimes do.
- ๐บ๐ธUnited States smustgrave
appears to need a rebase
If you are another contributor eager to jump in, please allow the previous poster at least 48 hours to respond to feedback first, so they have the opportunity to finish what they started!
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
The weirdness here is that this MR is practically just a c/p of (some of) the stubs that are defined in mglaman/phpstan-drupal. The difference is the use of FQCN as per Drupal code standards vs class names and
use
imports.If we don't do this, Drupal core is not compatible with its own PHPStan tooling. Therefore we should remove the stubs from mglaman/phpstan-drupal if we aim at clearing the baseline... fun.
- Status changed to Needs work
30 days ago 4:02pm 3 March 2025