Caught a sneaky PHP bug where in_array($status, [0, 1, 2]) returned true for an unexpected string input because the strict flag was omitted. Passing true as the third argument to in_array() stops loose type juggling from silently matching the wrong branch.
Commit
0a04c7c
Classic PHP type-juggling trap! If you want to automate catching and fixing these across your codebase, Rector has
It automatically appends ,
StrictInArrayRector for this exact case:php
return RectorConfig::configure() ->withPaths([__DIR__ . '/src']) ->withRules([ StrictInArrayRector::class, ]);
true to every in_array() call so loose comparisons don't sneak back in.commit 0a04c7c