function __construct() {
$this->mConverter = new FakeConverter( $this );
// Set the code to the name of the descendant
- if ( get_class( $this ) == 'Language' ) {
+ if ( static::class === 'Language' ) {
$this->mCode = 'en';
} else {
- $this->mCode = str_replace( '_', '-', strtolower( substr( get_class( $this ), 8 ) ) );
+ $this->mCode = str_replace( '_', '-', strtolower( substr( static::class, 8 ) ) );
}
self::getLocalisationCache();
}
* the date preference they're supposed to use, it should be used in
* all children.
*
- *<code>
- * function timeanddate([...], $format = true) {
- * $datePreference = $this->dateFormat($format);
- * [...]
- * }
- *</code>
+ * function timeanddate([...], $format = true) {
+ * $datePreference = $this->dateFormat($format);
+ * [...]
+ * }
*
* @param int|string|bool $usePrefs If true, the user's preference is used
* if false, the site/language default is used
* Get the list of variants supported by this language
* see sample implementation in LanguageZh.php
*
- * @return array An array of language codes
+ * @return string[] An array of language codes
*/
public function getVariants() {
return $this->mConverter->getVariants();