Use finally instead of try-catch-throw
authorLucas Werkmeister <lucas.werkmeister@wikimedia.de>
Tue, 26 Mar 2019 13:13:51 +0000 (14:13 +0100)
committerLucas Werkmeister <lucas.werkmeister@wikimedia.de>
Tue, 26 Mar 2019 13:13:51 +0000 (14:13 +0100)
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

index 2cbe67c..a4225a1 100644 (file)
@@ -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;
                        }
                }