Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CsvEncoderContextBuilder.php

function CsvEncoderContextBuilder::withEscapeChar

Configures the escape character.

Must be empty or a single character.

Throws

InvalidArgumentException

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\Encoder

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal