build: Updating mediawiki/mediawiki-phan-config to 0.9.0

Change-Id: Iaac7b5f78f26a083e8ad2d12f9c9c4a9ed246283
This commit is contained in:
libraryupgrader 2019-12-21 19:18:31 +00:00 committed by Reedy
parent 13c4c41f7b
commit 28c468b1ca
3 changed files with 8 additions and 10 deletions

View file

@ -8,7 +8,7 @@
"mediawiki/mediawiki-codesniffer": "28.0.0",
"jakub-onderka/php-console-highlighter": "0.3.2",
"mediawiki/minus-x": "0.3.2",
"mediawiki/mediawiki-phan-config": "0.8.0"
"mediawiki/mediawiki-phan-config": "0.9.0"
},
"scripts": {
"lint": "parallel-lint . --exclude vendor --exclude node_modules",

View file

@ -33,7 +33,7 @@ class OATHUser {
private $keys;
/**
* @var IModule
* @var ?IModule
*/
private $module;
@ -42,7 +42,7 @@ class OATHUser {
* @param User $user
* @param IAuthKey[] $keys
*/
public function __construct( User $user, $keys = [] ) {
public function __construct( User $user, array $keys = [] ) {
$this->user = $user;
$this->setKeys( $keys );
}
@ -101,12 +101,10 @@ class OATHUser {
*
* @param IAuthKey[] $keys
*/
public function setKeys( $keys = [] ) {
public function setKeys( array $keys = [] ) {
$this->keys = [];
if ( is_array( $keys ) ) {
foreach ( $keys as $key ) {
$this->addKey( $key );
}
foreach ( $keys as $key ) {
$this->addKey( $key );
}
}

View file

@ -76,7 +76,7 @@ class OATHUserRepository {
public function findByUser( User $user ) {
$oathUser = $this->cache->get( $user->getName() );
if ( !$oathUser ) {
$oathUser = new OATHUser( $user, null );
$oathUser = new OATHUser( $user, [] );
$uid = CentralIdLookup::factory()->centralIdFromLocalUser( $user );
$res = $this->getDB( DB_REPLICA )->selectRow(
@ -100,7 +100,7 @@ class OATHUserRepository {
}
$oathUser->setModule( $module );
$decodedData = FormatJson::decode( $res->data, 1 );
$decodedData = FormatJson::decode( $res->data, true );
if ( !isset( $decodedData['keys'] ) && $module->getName() === 'totp' ) {
// Legacy single-key setup
$key = $module->newKey( $decodedData );