Spaces:
Runtime error
Runtime error
Download symfony/dependency-injection/Loader/Configurator/Traits/BindTrait.php from Alcazard/vibe-coding-api: direct link, hf CLI and curl.
- Browser
- Download file 1.57 kB
-
https://huggingface.co/spaces/Alcazard/vibe-coding-api/resolve/main/symfony/dependency-injection/Loader/Configurator/Traits/BindTrait.php
- Command line
-
hf download hf://spaces/Alcazard/vibe-coding-api/symfony/dependency-injection/Loader/Configurator/Traits/BindTrait.php
-
curl -L -o BindTrait.php https://huggingface.co/spaces/Alcazard/vibe-coding-api/resolve/main/symfony/dependency-injection/Loader/Configurator/Traits/BindTrait.php
1.57 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\Loader\Configurator\Traits; | |
| use Symfony\Component\DependencyInjection\Argument\BoundArgument; | |
| use Symfony\Component\DependencyInjection\Loader\Configurator\DefaultsConfigurator; | |
| use Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator; | |
| trait BindTrait | |
| { | |
| /** | |
| * Sets bindings. | |
| * | |
| * Bindings map $named or FQCN arguments to values that should be | |
| * injected in the matching parameters (of the constructor, of methods | |
| * called and of controller actions). | |
| * | |
| * @param string $nameOrFqcn A parameter name with its "$" prefix, or a FQCN | |
| * @param mixed $valueOrRef The value or reference to bind | |
| * | |
| * @return $this | |
| */ | |
| final public function bind(string $nameOrFqcn, mixed $valueOrRef): static | |
| { | |
| $valueOrRef = static::processValue($valueOrRef, true); | |
| $bindings = $this->definition->getBindings(); | |
| $type = $this instanceof DefaultsConfigurator ? BoundArgument::DEFAULTS_BINDING : ($this instanceof InstanceofConfigurator ? BoundArgument::INSTANCEOF_BINDING : BoundArgument::SERVICE_BINDING); | |
| $bindings[$nameOrFqcn] = new BoundArgument($valueOrRef, true, $type, $this->path ?? null); | |
| $this->definition->setBindings($bindings); | |
| return $this; | |
| } | |
| } | |