From: Reedy Date: Fri, 29 Jul 2016 00:24:34 +0000 (+0100) Subject: Add/update doc blocks for MWTidy X-Git-Tag: 1.31.0-rc.0~6228 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=c6fc119c0ab66375f9ef1ff9bf0ca27c0ed52c20;p=lhc%2Fweb%2Fwiklou.git Add/update doc blocks for MWTidy Change-Id: I0b87e119048fd993f8bfda25a6c6b744d59804d1 --- diff --git a/includes/parser/MWTidy.php b/includes/parser/MWTidy.php index 46ea77395a..5e5461587b 100644 --- a/includes/parser/MWTidy.php +++ b/includes/parser/MWTidy.php @@ -41,6 +41,7 @@ class MWTidy { * @param string $text HTML input fragment. This should not contain a * or tag. * @return string Corrected HTML output + * @throws MWException */ public static function tidy( $text ) { $driver = self::singleton(); @@ -57,6 +58,7 @@ class MWTidy { * @param string $text * @param string &$errorStr Return the error string * @return bool Whether the HTML is valid + * @throws MWException */ public static function checkErrors( $text, &$errorStr = null ) { $driver = self::singleton(); @@ -71,10 +73,16 @@ class MWTidy { } } + /** + * @return bool + */ public static function isEnabled() { return self::singleton() !== false; } + /** + * @return bool|\MediaWiki\Tidy\TidyDriverBase + */ protected static function singleton() { global $wgUseTidy, $wgTidyInternal, $wgTidyConf, $wgDebugTidy, $wgTidyConfig, $wgTidyBin, $wgTidyOpts; @@ -110,7 +118,8 @@ class MWTidy { * Create a new Tidy driver object from configuration. * @see $wgTidyConfig * @param array $config - * @return TidyDriverBase + * @return bool|\MediaWiki\Tidy\TidyDriverBase + * @throws MWException */ public static function factory( array $config ) { switch ( $config['driver'] ) { @@ -139,7 +148,7 @@ class MWTidy { /** * Set the driver to be used. This is for testing. - * @param TidyDriverBase|false|null $instance + * @param MediaWiki\Tidy\TidyDriverBase|false|null $instance */ public static function setInstance( $instance ) { self::$instance = $instance;