$flags */ public function __construct( UserIdentity $user, ?string $ip, array $flags ) { $this->user = $user; $this->ip = $ip; $this->flags = $flags; } public function getUser(): UserIdentity { return $this->user; } public function getIP(): ?string { return $this->ip; } /** * Checks whether the given flag applies. * * @param string $flag * * @return bool */ public function is( string $flag ) { return !empty( $this->flags[$flag] ); } }