Debian Codegraph @

lib/3rdParty/composer/symfony/serializer/Context/Normalizer/BackedEnumNormalizerContextBuilder.php

raw symbols SCIP
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Serializer\Context\Normalizer;
13
14 use Symfony\Component\Serializer\Context\ContextBuilderInterface;
15 use Symfony\Component\Serializer\Context\ContextBuilderTrait;
16 use Symfony\Component\Serializer\Normalizer\BackedEnumNormalizer;
17
18 /**
19 * A helper providing autocompletion for available BackedEnumNormalizer options.
20 *
21 * @author Nicolas PHILIPPE <[email protected]>
22 */
23 final class BackedEnumNormalizerContextBuilder implements ContextBuilderInterface
24 {
25 use ContextBuilderTrait;
26
27 /**
28 * Configures if invalid values are allowed in denormalization.
29 * They will be denormalized into `null` values.
30 */
31 public function withAllowInvalidValues(bool $allowInvalidValues): static
32 {
33 return $this->with(BackedEnumNormalizer::ALLOW_INVALID_VALUES, $allowInvalidValues);
34 }
35 }