Spaces:
Runtime error
Runtime error
Download symfony/serializer/Attribute/MaxDepth.php from Alcazard/vibe-coding-api: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/Alcazard/vibe-coding-api/resolve/main/symfony/serializer/Attribute/MaxDepth.php
- Command line
-
hf download hf://spaces/Alcazard/vibe-coding-api/symfony/serializer/Attribute/MaxDepth.php
-
curl -L -o MaxDepth.php https://huggingface.co/spaces/Alcazard/vibe-coding-api/resolve/main/symfony/serializer/Attribute/MaxDepth.php
1.16 kB
| /* | |
| * This file is part of the Symfony package. | |
| * | |
| * (c) Fabien Potencier <fabien@symfony.com> | |
| * | |
| * For the full copyright and license information, please view the LICENSE | |
| * file that was distributed with this source code. | |
| */ | |
| namespace Symfony\Component\Serializer\Attribute; | |
| use Symfony\Component\Serializer\Exception\InvalidArgumentException; | |
| /** | |
| * Annotation class for @MaxDepth(). | |
| * | |
| * @Annotation | |
| * @NamedArgumentConstructor | |
| * @Target({"PROPERTY", "METHOD"}) | |
| * | |
| * @author Kévin Dunglas <dunglas@gmail.com> | |
| */ | |
| (\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY) | |
| class MaxDepth | |
| { | |
| public function __construct(private readonly int $maxDepth) | |
| { | |
| if ($maxDepth <= 0) { | |
| throw new InvalidArgumentException(\sprintf('Parameter given to "%s" must be a positive integer.', static::class)); | |
| } | |
| } | |
| /** | |
| * @return int | |
| */ | |
| public function getMaxDepth() | |
| { | |
| return $this->maxDepth; | |
| } | |
| } | |
| if (!class_exists(\Symfony\Component\Serializer\Annotation\MaxDepth::class, false)) { | |
| class_alias(MaxDepth::class, \Symfony\Component\Serializer\Annotation\MaxDepth::class); | |
| } | |