private function encodePassword(User $user)
    {
        $password = $this->encoderFactory
            ->getEncoder($user)
            ->encodePassword($user->getPlainPassword(), $user->getSalt());

        $user->setPassword($password);

        return $password;
    }
private function encodePassword(User $user)
    {
        $password = $this->encoderFactory
            ->getEncoder($user)
            ->encodePassword($user->getPlainPassword(), $user->getSalt());

        $user->setPassword($password);

        return $password;
    }
private function encodePassword ( User $ user ) { $ password = $ this -> encoderFactory -> getEncoder ( $ user ) -> encodePassword ( $ user -> getPlainPassword ( ) , $ user -> getSalt ( ) ) ; $ user -> setPassword ( $ password ) ; return $ password ; }
Encodes the user password and returns it.

@param User $user

@return string - the encoded password
Encodes the user password and returns it .