Copied!

A helper providing autocompletion for available YamlEncoder options.

Note that the "indentation" setting is not offered in this builder because it can only be set during the construction of the YamlEncoder, but not per call.

CloneableFinalInstantiable
Methods
public toArray() : array
 
  • return array<string,mixed>
public withContext(Symfony\Component\Serializer\Context\ContextBuilderInterface|array $context) : static
 
  • param \ContextBuilderInterface|array<string,mixed> $context
public withFlags(?int $flags) : static
 

Configures \Symfony\Component\Yaml\Dumper::dump flags bitmask.

  • see \Symfony\Component\Yaml\Yaml
public withIndentLevel(?int $indentLevel) : static
 

Configures the indentation level.

Must be positive.

  • param int<0, max>|null $indentLevel
public withInlineThreshold(?int $inlineThreshold) : static
 

Configures the threshold to switch to inline YAML.

public withPreservedEmptyObjects(?bool $preserveEmptyObjects) : static
 

Configures whether to preserve empty objects "{}" or to convert them to null.

Methods
protected with(string $key, ?mixed $value) : static
Properties
private array $context = []
 
  • var array<string,mixed>
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration