Closed peterfox closed 9 months ago
I thought it would be a nice addition to be able to automatically convert simply if statements that are used to throw an exception.
Example code:
-if ($condition) { - throw new Exception(); -} -if (!$condition) { - throw new Exception(); -} +throw_if($condition, new Exception()); +throw_unless($condition, new Exception());
Changes
Why
I thought it would be a nice addition to be able to automatically convert simply if statements that are used to throw an exception.
Example code: