public function onAddPasswordToHistory($event)
    {
        $password = $event->data;
        $sender = $event->sender;
        /* @var $sender static */
        if (empty($sender->passwordHistoryClass) ||
                !class_exists($sender->passwordHistoryClass) ||
                empty($sender->passwordHashAttribute) ||
                !is_string($sender->passwordHashAttribute)) {
            return false;
        }
        if (empty($password)) {
            $password = ['pass_hash' => $sender->{$sender->passwordHashAttribute}];
        }
        $class = $sender->passwordHistoryClass;
        if (array_key_exists('pass_hash', $password)) {
            return $class::addHash($password['pass_hash'], $sender);
        }
        if (array_key_exists('password', $password)) {
            return $class::add($password['password'], $sender);
        }
        return false;
    }