Skip to content

feat: create rector to add names to boolean arguments#7944

Open
calebdw wants to merge 1 commit intorectorphp:mainfrom
calebdw:calebdw/push-muvroqtpsztq
Open

feat: create rector to add names to boolean arguments#7944
calebdw wants to merge 1 commit intorectorphp:mainfrom
calebdw:calebdw/push-muvroqtpsztq

Conversation

@calebdw
Copy link
Copy Markdown
Contributor

@calebdw calebdw commented Mar 29, 2026

Hello!

Please see https://x.com/VotrubaT/status/2037867835469238412 for context.

This adds names to boolean call-site arguments---this increases code quality by making it clear what the value being passed is for:

-in_array($value, $array, true);
+in_array($value, $array, strict: true);

Thanks!

@calebdw calebdw force-pushed the calebdw/push-muvroqtpsztq branch 2 times, most recently from 165c5cd to 3a3f880 Compare March 29, 2026 02:21
@calebdw calebdw force-pushed the calebdw/push-muvroqtpsztq branch from 3a3f880 to c45162e Compare March 30, 2026 01:29
@calebdw calebdw changed the title feat: create rector to add names to boolean and null arguments feat: create rector to add names to boolean arguments Mar 30, 2026
@calebdw calebdw force-pushed the calebdw/push-muvroqtpsztq branch 2 times, most recently from d0eaef1 to b427c6b Compare March 30, 2026 01:35
@calebdw calebdw force-pushed the calebdw/push-muvroqtpsztq branch from b427c6b to ad9d5d6 Compare March 31, 2026 16:27
/**
* @see \Rector\Tests\CodeQuality\Rector\CallLike\AddNameToBooleanArgumentRector\AddNameToBooleanArgumentRectorTest
*/
final class AddNameToBooleanArgumentRector extends AbstractRector
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should implements \Rector\VersionBonding\Contract\MinPhpVersionInterface and on provideMinPhpVersion(), returns \Rector\ValueObject\PhpVersion::PHP_80

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.

3 participants