58 if ( $user && $user->isAnon() && !User::isUsableName( $user->getName() ) ) {
75 return new self(
null,
true );
85 $user = User::newFromId( $id );
89 if ( $user->isAnon() ) {
90 throw new \InvalidArgumentException(
'Invalid ID' );
103 $user = User::newFromName( $name,
'usable' );
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,...
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