Having a Phabricator task increases the chance of someone noticing the issue, and back-linking it from an already-existing TODO item makes sense. Change-Id: I62d532099c0ad905bf536bcbea21b365b84faba4
29 lines
666 B
PHP
29 lines
666 B
PHP
<?php
|
|
|
|
namespace MediaWiki\User\Registration;
|
|
|
|
use MediaWiki\User\UserFactory;
|
|
use MediaWiki\User\UserIdentity;
|
|
|
|
class LocalUserRegistrationProvider implements IUserRegistrationProvider {
|
|
|
|
public const TYPE = 'local';
|
|
|
|
private UserFactory $userFactory;
|
|
|
|
/**
|
|
* @param UserFactory $userFactory
|
|
*/
|
|
public function __construct( UserFactory $userFactory ) {
|
|
$this->userFactory = $userFactory;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function fetchRegistration( UserIdentity $user ) {
|
|
// TODO: Factor this out from User::getRegistration to this method (T352871)
|
|
$user = $this->userFactory->newFromUserIdentity( $user );
|
|
return $user->getRegistration();
|
|
}
|
|
}
|