Skip to content

fix: remove redundant null-coalescing on always-set array offsets in SocialBehavior#1181

Merged
steinkel merged 2 commits into16.next-cake5from
fix/phpstan-social-behavior-null-coalescing
May 7, 2026
Merged

fix: remove redundant null-coalescing on always-set array offsets in SocialBehavior#1181
steinkel merged 2 commits into16.next-cake5from
fix/phpstan-social-behavior-null-coalescing

Conversation

@steinkel
Copy link
Copy Markdown
Member

@steinkel steinkel commented May 7, 2026

Summary

  • Fixes two PHPStan errors in SocialBehavior::_populateUser() that were blocking the CI pipeline on 16.next-cake5
  • $userData['first_name'] (line 208) is always set by both branches of the preceding if/else block — ?? null is redundant
  • $userData['username'] (line 215) is always set earlier in the same block — ?? null is redundant

Test plan

  • CI static analysis / coding standard check passes
  • No functional behaviour change — only removes provably dead null-coalescing fallbacks

steinkel added 2 commits May 7, 2026 12:06
…SocialBehavior

PHPStan flags $userData['first_name'] ?? null and $userData['username'] ?? null
as always-existing keys that cannot be null at those code paths.
…compatibility

ReCaptcha\Response is declared readonly in newer versions, which prevents
PHPUnit from doubling it. Use the public constructor directly instead.
@steinkel steinkel merged commit 6c14994 into 16.next-cake5 May 7, 2026
26 checks passed
@steinkel steinkel deleted the fix/phpstan-social-behavior-null-coalescing branch May 7, 2026 11:19
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