Skip to content

refactor: use array-key as the benevolent union of int|string in array shapes#10396

Open
paulbalandan wants to merge 1 commit into
codeigniter4:developfrom
paulbalandan:array-key
Open

refactor: use array-key as the benevolent union of int|string in array shapes#10396
paulbalandan wants to merge 1 commit into
codeigniter4:developfrom
paulbalandan:array-key

Conversation

@paulbalandan

Copy link
Copy Markdown
Member

Description
Plain array<int|string, ...> is actually different from the nature of PHP array keys, that's why PHPStan uses array-key or (int|string) to mean these kind of unioned types: benevolent unions.

Ref: https://phpstan.org/config-reference#checkbenevolentuniontypes

This PR normalizes to use array-key instead of plain union.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added the refactor Pull requests that refactor code label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Pull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants