Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Oct 11, 2025

Comparison between 2 just-assigned values clutters code.

This rule inline such constructions, to make lines to the point:

function run()
{
-    $value = 100;
-    $anotherValue = 200;

-    return $value <=> $anotherValue;
+    return 100 <=> 200;
}

Method calls and non-variable assigned are skipped, to keep long lines readable.

@TomasVotruba TomasVotruba merged commit efcd5e9 into main Oct 11, 2025
53 checks passed
@TomasVotruba TomasVotruba deleted the tv-compare-narrow branch October 11, 2025 08:35
@TomasVotruba TomasVotruba mentioned this pull request Oct 11, 2025
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