From: Thiemo Mättig Date: Wed, 16 Apr 2014 14:13:46 +0000 (+0200) Subject: Documentation for page_props getter in ParserOutput X-Git-Tag: 1.31.0-rc.0~15479^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=544a83533002b3640f12a32d30ce50898de45499;p=lhc%2Fweb%2Fwiklou.git Documentation for page_props getter in ParserOutput I would love to make this getter return null instead of false, similar to getExtensionData() in the same class. A property that's not set should be null. Not a boolean. This makes it impossible to have boolean properties. But I can't change this because it's used in extensions with "!== false" and such. Change-Id: I2bc0bed1c58435d791f7a055bac2763a3411bb6f --- diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 931c08832c..b4a1c5dd8c 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -573,6 +573,14 @@ class ParserOutput extends CacheTime { $this->mProperties[$name] = $value; } + /** + * @param string $name The property name to look up. + * + * @return mixed|false The value previously set using setProperty(). False if null or no value + * was set for the given property name. + * + * @note You need to use getProperties() to check for boolean and null properties. + */ public function getProperty( $name ) { return isset( $this->mProperties[$name] ) ? $this->mProperties[$name] : false; } @@ -706,7 +714,7 @@ class ParserOutput extends CacheTime { * * @param string $key The key to look up. * - * @return mixed The value previously set for the given key using setExtensionData( $key ), + * @return mixed|null The value previously set for the given key using setExtensionData() * or null if no value was set for this key. */ public function getExtensionData( $key ) {