/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/Container/Attributes/BindWhen.php
36 строк
816 B
Jamie York
[13.x] Add a `#[BindWhen()]` attribute to conditionally bind into the container (#60862)
23 июл 2026, 18:58
Не верифицирован
23 июл 2026, 18:58
6291d28
Код
Авторство
О чём код?
<?php namespace Illuminate\Container\Attributes; use Attribute; use Closure; #[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] class BindWhen { /** * The concrete class to bind to. * * @var class-string */ public string $concrete; /** * The condition that determines if the binding should apply. * * @var \Closure(\Illuminate\Contracts\Container\Container): bool */ public Closure $condition; /** * Create a new attribute instance. * * @param class-string $concrete * @param \Closure(\Illuminate\Contracts\Container\Container): bool $condition */ public function __construct(string $concrete, Closure $condition) { $this->concrete = $concrete; $this->condition = $condition; } }