public static function before(IdentityInterface $identity, bool $cookieBased, int $duration): self
    {
        return new static(static::BEFORE, $identity, $cookieBased, $duration);
    }
public static function before(IdentityInterface $identity, bool $cookieBased, int $duration): self
    {
        return new static(static::BEFORE, $identity, $cookieBased, $duration);
    }
public static function before ( IdentityInterface $ identity , bool $ cookieBased , int $ duration ) : self { return new static ( static :: BEFORE , $ identity , $ cookieBased , $ duration ) ; }
Creates BEFORE event with result.
@param IdentityInterface $identity the user object this event is fired on.
@param bool $cookieBased whether the login is cookie-based.
@param int $duration number of seconds that the user can remain logged-in.
@return self created event
Creates BEFORE event with result .