Run Rector on your code to see what it can do for you:
class Test { function method() { - $prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler, $signalingException) { + set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler, $signalingException) { if ($file === __FILE__) { throw $signalingException; }
Applied Rules:
Not a change you expect?
rector.php