function CsvEncoderContextBuilder::withEscapeChar
Configures the escape character.
Must be empty or a single character.
Throws
Deprecated
since Symfony 7.2, to be removed in 8.0
File
-
vendor/
symfony/ serializer/ Context/ Encoder/ CsvEncoderContextBuilder.php, line 69
Class
- CsvEncoderContextBuilder
- A helper providing autocompletion for available CsvEncoder options.
Namespace
Symfony\Component\Serializer\Context\EncoderCode
public function withEscapeChar(?string $escapeChar) : static {
trigger_deprecation('symfony/serializer', '7.2', 'The "%s" method is deprecated. It will be removed in 8.0.', __METHOD__);
if (null !== $escapeChar && \strlen($escapeChar) > 1) {
throw new InvalidArgumentException(\sprintf('The "%s" escape character must be empty or a single character.', $escapeChar));
}
return $this->with(CsvEncoder::ESCAPE_CHAR_KEY, $escapeChar);
}