| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
namespace Symfony\Component\Serializer\Context\Encoder; |
| 13 |
|
| 14 |
use Symfony\Component\Serializer\Context\ContextBuilderInterface; |
| 15 |
use Symfony\Component\Serializer\Context\ContextBuilderTrait; |
| 16 |
use Symfony\Component\Serializer\Encoder\YamlEncoder; |
| 17 |
use Symfony\Component\Yaml\Yaml; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
final class YamlEncoderContextBuilder implements ContextBuilderInterface |
| 29 |
{ |
| 30 |
use ContextBuilderTrait; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
public function withInlineThreshold(?int $inlineThreshold): static |
| 36 |
{ |
| 37 |
return $this->with(YamlEncoder::YAML_INLINE, $inlineThreshold); |
| 38 |
} |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
public function withIndentLevel(?int $indentLevel): static |
| 48 |
{ |
| 49 |
return $this->with(YamlEncoder::YAML_INDENT, $indentLevel); |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
public function withFlags(?int $flags): static |
| 58 |
{ |
| 59 |
return $this->with(YamlEncoder::YAML_FLAGS, $flags); |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
public function withPreservedEmptyObjects(?bool $preserveEmptyObjects): static |
| 66 |
{ |
| 67 |
return $this->with(YamlEncoder::PRESERVE_EMPTY_OBJECTS, $preserveEmptyObjects); |
| 68 |
} |
| 69 |
} |