75 return new self(
null,
true );
89 if ( $user->isAnon() ) {
90 throw new \InvalidArgumentException(
'Invalid ID' );
105 throw new \InvalidArgumentException(
'Invalid user name' );
125 return $this->user ===
null;
142 return $this->user ===
null ? 0 : $this->user->getId();
150 return $this->user ===
null ? null : $this->user->getName();
158 return $this->user ===
null || $this->user->getId() === 0 ?
'' : $this->user->getToken(
false );
178 if ( $this->user ===
null ) {
182 ( $this->
verified ?
'+' :
'-' ) .
':' .
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static newFromId( $id)
Static factory method for creation from a given user ID.
static isUsableName( $name)
Usernames which fail to pass this function will be blocked from user login and new account registrati...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true