From 46f79f8eb3293524543c4badfee8b3d3c4629cd1 Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Tue, 26 Mar 2019 14:13:51 +0100 Subject: [PATCH] Use finally instead of try-catch-throw MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When this exception handler was introduced in change Ifbc1db4b82 (commit 9636d44448), MediaWiki still supported PHP 5.3.2, where finally was not available. It was added in PHP 5.5, though, which we’ve required for a while now, so we can simplify this a bit. Change-Id: I7c967fb713de7495739e18ff6c6058a630129fda --- includes/context/RequestContext.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index 2cbe67c525..a4225a1436 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -345,12 +345,8 @@ class RequestContext implements IContextSource, MutableContext { $obj = Language::factory( $code ); $this->lang = $obj; } - - unset( $this->recursion ); - } - catch ( Exception $ex ) { + } finally { unset( $this->recursion ); - throw $ex; } } -- 2.20.1