throw DataAbstractionLayerException::
invalidSerializerField(PasswordField::
class,
$field);
} $this->
validateIfNeeded($field,
$existence,
$data,
$parameters);
$value =
$data->
getValue();
if ($value) { $info =
password_get_info($value);
// if no password algorithm is detected, it might be plain text which needs to be encoded.
// otherwise, passthrough the possibly encoded string
if (!
$info['algo'
]) { $value =
password_hash((string) $value,
$field->
getAlgorithm(),
$field->
getHashOptions());
} } yield $field->
getStorageName() =>
$value;
} public function decode(Field
$field, mixed
$value): ?string
{ return $value;
}