Skip to content

[Backport #2020 to 5.x] fix: remove redundant is_array() check in Serializer#2021

Closed
github-actions[bot] wants to merge 1 commit into
5.xfrom
backport-2020-to-5.x
Closed

[Backport #2020 to 5.x] fix: remove redundant is_array() check in Serializer#2021
github-actions[bot] wants to merge 1 commit into
5.xfrom
backport-2020-to-5.x

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated backport of #2020 to branch 5.x.

Do not modify this pull request.

Summary

  • PHPStan reported is_array() on $declaration always evaluates to true in Serializer::doDeserializeProperty()
  • Root cause: after checking is_string($declaration) with a separate if, the subsequent is_array() checks were redundant since the type union is string|array<string>
  • Restructured to use if/elseif branching so the string case is handled first and the array branches follow naturally without needing explicit is_array() guards

Test plan

  • composer analyse — 0 errors
  • composer test — 1037 tests pass
  • CS Fixer clean
  • Rector clean

🤖 Generated with Claude Code

@DerManoMann DerManoMann deleted the backport-2020-to-5.x branch June 12, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant