Closed peterfox closed 7 months ago
Based on rules from Larastan. These are quite simple little use cases where we can remove the use of a helper when it's not needed.
-value(new Object())->something(); +(new Object())->something();
-with(new Object())->something(); +(new Object())->something();
value() => https://github.com/larastan/larastan/blob/2.x/src/Rules/UselessConstructs/NoUselessValueFunctionCallsRule.php with() => https://github.com/larastan/larastan/blob/2.x/src/Rules/UselessConstructs/NoUselessWithFunctionCallsRule.php
Thanks @peterfox 🙌
Changes
Why
Based on rules from Larastan. These are quite simple little use cases where we can remove the use of a helper when it's not needed.
-with(new Object())->something(); +(new Object())->something();
value() => https://github.com/larastan/larastan/blob/2.x/src/Rules/UselessConstructs/NoUselessValueFunctionCallsRule.php with() => https://github.com/larastan/larastan/blob/2.x/src/Rules/UselessConstructs/NoUselessWithFunctionCallsRule.php