Skip to content

[5.x] Fix conflict between TypeHintSniff and Slevomat null position sniff#429

Merged
dereuromark merged 1 commit into5.xfrom
fix-void-null-type-order-conflict-5x
Mar 14, 2026
Merged

[5.x] Fix conflict between TypeHintSniff and Slevomat null position sniff#429
dereuromark merged 1 commit into5.xfrom
fix-void-null-type-order-conflict-5x

Conversation

@dereuromark
Copy link
Member

Summary

  • Remove nullPosition="last" property from DNFTypeHintFormat sniff

This fixes the conflict where CakePHP's TypeHintSniff expects void to be last in union types (e.g., int|null|void), but Slevomat's nullPosition="last" enforced null as last position (expecting int|void|null).

Backport of #427 for 5.x branch.

Fixes #426

This fixes the conflict where CakePHP's TypeHintSniff expects void to be
last in union types (e.g., int|null|void), but Slevomat's nullPosition=last
enforced null as last position (expecting int|void|null).

Backport of 6.x fix. Fixes #426
@dereuromark dereuromark added this to the 5.x milestone Mar 14, 2026
@dereuromark dereuromark merged commit 8b9d178 into 5.x Mar 14, 2026
6 checks passed
@dereuromark dereuromark deleted the fix-void-null-type-order-conflict-5x branch March 14, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent definition of typehint return types

2 participants