MediaWiki master
UserIdentityUtils.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\User;
4
6
14 private TempUserConfig $tempUserConfig;
15
21 public function __construct( TempUserConfig $tempUserConfig ) {
22 $this->tempUserConfig = $tempUserConfig;
23 }
24
31 public function isTemp( UserIdentity $user ) {
32 return $this->tempUserConfig->isTempName( $user->getName() );
33 }
34
41 public function isNamed( UserIdentity $user ) {
42 return $user->isRegistered()
43 && !$this->tempUserConfig->isTempName( $user->getName() );
44 }
45}
Convenience functions for interpreting UserIdentity objects using additional services or config.
isNamed(UserIdentity $user)
Is the user a normal non-temporary registered user?
__construct(TempUserConfig $tempUserConfig)
isTemp(UserIdentity $user)
Is the user a temporary user?
Interface for temporary user creation config and name matching.
Interface for objects representing user identity.
isRegistered()
This must be equivalent to getId() != 0 and is provided for code readability.
Utility class for bot passwords.