public static function fromPlain($aPlainPassword, UserPasswordEncoder $anEncoder, $salt = null)
    {
        if (null === $salt) {
            $salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);
        }
        $encodedPassword = $anEncoder->encode($aPlainPassword, $salt);

        return new self($encodedPassword, $salt);
    }
public static function fromPlain($aPlainPassword, UserPasswordEncoder $anEncoder, $salt = null)
    {
        if (null === $salt) {
            $salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);
        }
        $encodedPassword = $anEncoder->encode($aPlainPassword, $salt);

        return new self($encodedPassword, $salt);
    }
public static function fromPlain ( $ aPlainPassword , UserPasswordEncoder $ anEncoder , $ salt = null ) { if ( null === $ salt ) { $ salt = base_convert ( sha1 ( uniqid ( mt_rand ( ) , true ) ) , 16 , 36 ) ; } $ encodedPassword = $ anEncoder -> encode ( $ aPlainPassword , $ salt ) ; return new self ( $ encodedPassword , $ salt ) ; }
Named static constructor with the given plain password and encoder.

@param string              $aPlainPassword The plain password
@param UserPasswordEncoder $anEncoder      The encoder
@param string|null         $salt           The salt

@return self
Named static constructor with the given plain password and encoder .