Spaces:
Runtime error
Runtime error
Download symfony/dependency-injection/Argument/ServiceClosureArgument.php from Alcazard/vibe-coding-api: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/Alcazard/vibe-coding-api/resolve/main/symfony/dependency-injection/Argument/ServiceClosureArgument.php
- Command line
-
hf download hf://spaces/Alcazard/vibe-coding-api/symfony/dependency-injection/Argument/ServiceClosureArgument.php
-
curl -L -o ServiceClosureArgument.php https://huggingface.co/spaces/Alcazard/vibe-coding-api/resolve/main/symfony/dependency-injection/Argument/ServiceClosureArgument.php
1.03 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\DependencyInjection\Argument; | |
| use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; | |
| /** | |
| * Represents a service wrapped in a memoizing closure. | |
| * | |
| * @author Nicolas Grekas <p@tchwork.com> | |
| */ | |
| class ServiceClosureArgument implements ArgumentInterface | |
| { | |
| use ArgumentTrait; | |
| private array $values; | |
| public function __construct(mixed $value) | |
| { | |
| $this->values = [$value]; | |
| } | |
| public function getValues(): array | |
| { | |
| return $this->values; | |
| } | |
| public function setValues(array $values): void | |
| { | |
| if ([0] !== array_keys($values)) { | |
| throw new InvalidArgumentException('A ServiceClosureArgument must hold one and only one value.'); | |
| } | |
| $this->values = $values; | |
| } | |
| } | |