Merge "docs: Fix typo"
[mediawiki.git] / includes / user / Registration / LocalUserRegistrationProvider.php
blob4cb1b0ec1e5af8c10e18258f865ddc2c2f8eecd1
1 <?php
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;
18 /**
19 * @inheritDoc
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();