src/Module/Authentication/LocalAuth/LocalAuth.php
public function userDataEncodePassword(&$userData, Password $newPassword)
    {
        $encoderName = $this->config["encoder"];
        $encoder = $this->picoAuth->getContainer()->get($encoderName);

        $userData['pwhash'] = $encoder->encode($newPassword->get());
        $userData['encoder'] = $encoderName;
        if (isset($userData['pwreset'])) {
            unset($userData['pwreset']);
        }
    }
public function userDataEncodePassword(&$userData, Password $newPassword)
    {
        $encoderName = $this->config["encoder"];
        $encoder = $this->picoAuth->getContainer()->get($encoderName);

        $userData['pwhash'] = $encoder->encode($newPassword->get());
        $userData['encoder'] = $encoderName;
        if (isset($userData['pwreset'])) {
            unset($userData['pwreset']);
        }
    }
Fills user-data array with the encoded password

@param array $userData User data array
@param Password $newPassword The password to be encoded