Repository navigation
Conversation
Member
|
Buon giorno Daniil!
Could you modify/fix the existing mechanism? |
Author
|
Sure, sorry, hang on |
Member
|
Please see #498 before you continue. |
Map parameters replace the ones generated from the hash notation, and map parameters and templates do not duplicate the ones written in core, like map return types since php-stubs#498. PHPStan doesn't support shapes of generic arrays (array<K, V>{...}), so they become unsealed shapes (array{..., ...<K, V>}), and the string type of args parameters is only removed from the top-level union. Lists of lists of shapes are nested generic arrays. Claude-Session: https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW
danog
force-pushed
the
duplicate-and-invalid-tags
branch
from
October 20, 2026 11:26
c97d7a3 to
ce912e0
Compare
Member
|
The dilemma: our types or core types. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #498 (please merge that first). Only the generator changes; no core tag is removed.
array<K, V>{…}andT[]{…}from hash notations (a parse error in PHPStan, so the tag was ignored) become unsealed shapes that keep core's key and value types, e.g.array{in_footer?: bool, fetchpriority?: 'auto'|'low'|'high', ...<string, string|bool>}. Thestringstripping no longer runs inside<…>, which had turned core'sarray<string, string|bool>intoarray<string, bool>. Nested lists (array[][]) becomearray<int|string, array<array-key, array{…}>>.@phpstan-paramgenerated from a hash notation gives way to the functionMap's param of the same name (add_settings_field,get_categories), and functionMap@phpstan-param/@phpstan-templatetags give way to core's own (stripslashes_from_strings_only), like Preserve existing phpstan-return tags when applying function map #498 does for returns.ofinWP_Dependencies::query's@phpstan-template TStatus, and a@phpstan-returnforWP_Image_Editor::get_output_format(), whose core@returnis invalid.PHPStan parse errors in the stubs go from 8 to 1 (a SimplePie
@internalcomment). Left as is:wpdb::preparedocuments$argstwice in core.https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW