Use PHP syntax features from PHP 7.1

* void return type (https://wiki.php.net/rfc/void_return_type)
* Nullable type (https://wiki.php.net/rfc/nullable_types)

The parent change ensures that PHP 7.1+ is required.

This change reverts commit 8eb162020f.

Change-Id: Ifb8fc52f4b161ea89fef2c84e51e4c8f2b648a49
This commit is contained in:
Fomafix
2020-01-18 14:40:02 +01:00
committed by jenkins-bot
parent a0dab26fb1
commit 0a605f40ab

View File

@@ -146,7 +146,7 @@ class UniversalLanguageSelectorHooks {
* @param OutputPage $out * @param OutputPage $out
* @return void * @return void
*/ */
protected static function handleSetLang( OutputPage $out ) { protected static function handleSetLang( OutputPage $out ): void {
$languageToSet = self::getSetLang( $out ); $languageToSet = self::getSetLang( $out );
if ( !$languageToSet ) { if ( !$languageToSet ) {
@@ -471,7 +471,7 @@ class UniversalLanguageSelectorHooks {
} }
} }
private static function getSetLang( OutputPage $out ) { private static function getSetLang( OutputPage $out ): ?string {
$setLangCode = $out->getRequest()->getText( 'setlang' ); $setLangCode = $out->getRequest()->getText( 'setlang' );
if ( $setLangCode && Language::isSupportedLanguage( $setLangCode ) ) { if ( $setLangCode && Language::isSupportedLanguage( $setLangCode ) ) {
return $setLangCode; return $setLangCode;