driftingly / rector-laravel

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

Adds the ThrowIFAndThrowUnlessExceptionsToUseClassStringRector rule #180

Closed peterfox closed 7 months ago

peterfox commented 7 months ago

Changes

Why

A nice little rule to change the parameters of throw_if() and throw_unless() to use a class string.

-throw_if($condition, new MyException('custom message'));
+throw_if($condition, MyException::class, 'custom message');