driftingly / rector-laravel

Rector upgrades rules for Laravel
http://getrector.org
MIT License
500 stars 49 forks source link

Adds AppEnvironmentComparisonToParameterRector rule #139

Closed peterfox closed 11 months ago

peterfox commented 11 months ago

Creates the following rule:

AppEnvironmentComparisonToParameterRector

Replace $app->environment() === 'local' with $app->environment('local'])

-$app->environment() === 'production';
+$app->environment('production');

This rule will handle scenarios such as if the Facade is used or the Application contract.