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:
@@ -146,7 +146,7 @@ class UniversalLanguageSelectorHooks {
|
||||
* @param OutputPage $out
|
||||
* @return void
|
||||
*/
|
||||
protected static function handleSetLang( OutputPage $out ) {
|
||||
protected static function handleSetLang( OutputPage $out ): void {
|
||||
$languageToSet = self::getSetLang( $out );
|
||||
|
||||
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' );
|
||||
if ( $setLangCode && Language::isSupportedLanguage( $setLangCode ) ) {
|
||||
return $setLangCode;
|
||||
|
||||
Reference in New Issue
Block a user