Debian Codegraph @

lib/3rdParty/composer/symfony/serializer/Context/Normalizer/DateIntervalNormalizerContextBuilder.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\DateIntervalNormalizer;
17
18 /**
19 * A helper providing autocompletion for available DateIntervalNormalizer options.
20 *
21 * @author Mathias Arlaud <[email protected]>
22 */
23 final class DateIntervalNormalizerContextBuilder implements ContextBuilderInterface
24 {
25 use ContextBuilderTrait;
26
27 /**
28 * Configures the format of the interval.
29 *
30 * @see https://php.net/manual/en/dateinterval.format.php
31 */
32 public function withFormat(?string $format): static
33 {
34 return $this->with(DateIntervalNormalizer::FORMAT_KEY, $format);
35 }
36 }