Skip to content

feat(php86): add min/max to clamp rector#7942

Open
calebdw wants to merge 2 commits intorectorphp:mainfrom
calebdw:calebdw/push-wnpsxstxqxrs
Open

feat(php86): add min/max to clamp rector#7942
calebdw wants to merge 2 commits intorectorphp:mainfrom
calebdw:calebdw/push-wnpsxstxqxrs

Conversation

@calebdw
Copy link
Copy Markdown
Contributor

@calebdw calebdw commented Mar 28, 2026

Hello!

This adds support for the new PHP 8.6 clamp() function!

-min(100, max(0, $value));
+clamp($value, 0, 100);

Thanks!

@calebdw calebdw force-pushed the calebdw/push-wnpsxstxqxrs branch 2 times, most recently from 1644c9e to 9da5fab Compare March 28, 2026 20:36
@calebdw calebdw changed the title feat: add min/max to clamp rector feat(php86): add min/max to clamp rector Mar 28, 2026
@calebdw calebdw force-pushed the calebdw/push-wnpsxstxqxrs branch 3 times, most recently from b1581cc to 998b600 Compare March 28, 2026 20:40
@samsonasik
Copy link
Copy Markdown
Member

This require downgrade rule first at https://github.com/rectorphp/rector-downgrade-php

@calebdw
Copy link
Copy Markdown
Contributor Author

calebdw commented Mar 28, 2026

@calebdw calebdw force-pushed the calebdw/push-wnpsxstxqxrs branch from 998b600 to d021ef3 Compare March 29, 2026 02:06
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.

2 participants