From 22af3c78c66bb80a95be3a07d712a90de349dfb0 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 16 Dec 2013 23:09:21 -0800 Subject: [PATCH] Moved ScopedCallback to /libs * The MWException is now a standard PHP exception type Change-Id: I59e3b435cee32efe84c67766e29976b126384389 --- includes/AutoLoader.php | 2 +- includes/{utils => libs}/ScopedCallback.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename includes/{utils => libs}/ScopedCallback.php (94%) diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 58c8461368..018e150c99 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -686,6 +686,7 @@ $wgAutoloadLocalClasses = array( 'JSParser' => 'includes/libs/jsminplus.php', 'JSToken' => 'includes/libs/jsminplus.php', 'JSTokenizer' => 'includes/libs/jsminplus.php', + 'ScopedCallback' => 'includes/libs/ScopedCallback.php', 'ScopedPHPTimeout' => 'includes/libs/ScopedPHPTimeout.php', 'XmlTypeCheck' => 'includes/libs/XmlTypeCheck.php', @@ -1073,7 +1074,6 @@ $wgAutoloadLocalClasses = array( 'RegexlikeReplacer' => 'includes/utils/StringUtils.php', 'ReplacementArray' => 'includes/utils/StringUtils.php', 'Replacer' => 'includes/utils/StringUtils.php', - 'ScopedCallback' => 'includes/utils/ScopedCallback.php', 'StringUtils' => 'includes/utils/StringUtils.php', 'UIDGenerator' => 'includes/utils/UIDGenerator.php', 'ZipDirectoryReader' => 'includes/utils/ZipDirectoryReader.php', diff --git a/includes/utils/ScopedCallback.php b/includes/libs/ScopedCallback.php similarity index 94% rename from includes/utils/ScopedCallback.php rename to includes/libs/ScopedCallback.php index ef22e0a30d..631b6519fe 100644 --- a/includes/utils/ScopedCallback.php +++ b/includes/libs/ScopedCallback.php @@ -31,11 +31,11 @@ class ScopedCallback { /** * @param callable $callback - * @throws MWException + * @throws Exception */ public function __construct( $callback ) { if ( !is_callable( $callback ) ) { - throw new MWException( "Provided callback is not valid." ); + throw new InvalidArgumentException( "Provided callback is not valid." ); } $this->callback = $callback; } -- 2.20.1