3 namespace MediaWiki\User\Registration
;
5 use MediaWiki\User\UserFactory
;
6 use MediaWiki\User\UserIdentity
;
8 class LocalUserRegistrationProvider
implements IUserRegistrationProvider
{
10 public const TYPE
= 'local';
12 private UserFactory
$userFactory;
14 public function __construct( UserFactory
$userFactory ) {
15 $this->userFactory
= $userFactory;
21 public function fetchRegistration( UserIdentity
$user ) {
22 // TODO: Factor this out from User::getRegistration to this method (T352871)
23 $user = $this->userFactory
->newFromUserIdentity( $user );
24 return $user->getRegistration();