Closed IanDelMar closed 5 months ago
Thank you Ian! Could you please regenerate stubs for the latest tag without adding 6.5?
You know what?!
Thank you Ian! Could you please regenerate stubs for the latest tag without adding 6.5?
Sorry, didn't see this before. Anything you still want me to do?
No. Everything is released.
@IanDelMar Thanks for working on this! Would you mind creating core trac tickets for those two functions?
@swissspidy Feel free to do it on my behalf 🙈
Feel free to do it on my behalf
After all Pascal is our secret connection to WordPress!
wp_get_avif_info()
: The visitor no longer includes additions stemming from@type
, possibly due to incorrect indentation. This should be addressed in the core.wp_enqueue_script_module()
: See towp_get_avif_info()
.
So I just looked into those. Unfortunately, this non-standard phpdoc format for arrays is part of the WordPress coding standards. It's not limited to these two function; just search the code base for @return array {
and you'll find lots of examples. We'll have to work around this or make a proposal for core to change its standards or add @phpstan-*
tags in addition to those 🤷 😞
add
@phpstan-*
tags
Yes. Please have core add ALL of our tags in functionMap.
We'll have to work around this
The visitor is aware of this notation for arrays! However, according to the WordPress coding standards, it should be indented by 4 spaces or a multiple thereof. This is what the visitor is seeking but can't find for these two functions. Therefore, it should be fixed in WP core.
search the code base for
@return array {
and you'll find lots of examples.
And in many of these cases, the phpstan tag is added correctly.
Oh, ok! Let me take another look next week then
Alright, https://core.trac.wordpress.org/changeset/58037 should fix this
Alright, https://core.trac.wordpress.org/changeset/58037 should fix this
These haven't made it into core yet, right?
That‘s in core :) just not in a published release. That will be WP 6.6, due out this summer
This pull request updates the stubs to WordPress 6.5.
Changes to functionMap.php:
WP_List_Table::display_tablenav
andWP_List_Table::pagination
. The visitor now adds these PHPStan tags without relying onfunctionMap.php
.?
) for the return type ofWP_Filesystem_*::dirlist()
in accordance with the description in the documentation.Notes:
WP_Filesystem_*::dirlist()
: There are now two@phpstan-return
, one added by the visitor using@type
and one previously added viafunctionMap.php
. There are two issues: the details provided by the new tag are slightly reduced (seetype
key), which should not be problematic from my perspective. Additionally, the array key is now specified as int|string, which I believe is incorrect; it should be string. Depending on how PHPStan handles duplicate entries, which I'm unsure of but assume to be based on the last entry, I would recommend retaining the PHPStan information fromfunctionMap.php
.WP_Font_Face::generate_and_print()
: The visitor no longer includes additions stemming from@type
. I think this is because we cannot handlearray[][]
. Isarray[][]
a valid syntax?wp_get_avif_info()
: The visitor no longer includes additions stemming from@type
, possibly due to incorrect indentation. This should be addressed in the core.wp_enqueue_script_module()
: See towp_get_avif_info()
.Concerning the idea of ceasing to add additional tags if a tag with the same name is already present (#163):