From aabb0a8bd751e7d95adbd9059f404b4c6cdb004c Mon Sep 17 00:00:00 2001 From: Alexandre Quercia Date: Sat, 20 Jun 2020 22:29:38 +0200 Subject: [PATCH] [Lime] Fix backward compatibility break for handle_exception signature Throwables were introduced since PHP 7. http://php.net/manual/en/class.throwable.php Now `lime_test::handle_exception()` method works properly with any `Exception` and `Error` instances. This fix the backward compatibility breaking changes introduce on: 5ea8d656 exception_handler signature changed in php7 --- lib/vendor/lime/lime.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/vendor/lime/lime.php b/lib/vendor/lime/lime.php index 53fdd0dd1..b365a40bf 100644 --- a/lib/vendor/lime/lime.php +++ b/lib/vendor/lime/lime.php @@ -587,7 +587,14 @@ public function handle_error($code, $message, $file, $line, $context) $this->error($type.': '.$message, $file, $line, $trace); } - public function handle_exception(Throwable $exception) + /** + * Handles exception. + * + * @param Exception|Throwable $exception + * + * @return bool + */ + public function handle_exception($exception) { $this->error(get_class($exception).': '.$exception->getMessage(), $exception->getFile(), $exception->getLine(), $exception->getTrace());