ClosureReferenceConfigurator example


function env(string $name): EnvConfigurator
{
    return new EnvConfigurator($name);
}

/** * Creates a closure service reference. */
function service_closure(string $serviceId): ClosureReferenceConfigurator
{
    return new ClosureReferenceConfigurator($serviceId);
}

/** * Creates a closure. */
function closure(string|array|ReferenceConfigurator|Expression $callable): InlineServiceConfigurator
{
    return (new InlineServiceConfigurator(new Definition('Closure')))
        ->factory(['Closure', 'fromCallable'])
        ->args([$callable]);
}

function env(string $name): EnvConfigurator
{
    return new EnvConfigurator($name);
}

/** * Creates a closure service reference. */
function service_closure(string $serviceId): ClosureReferenceConfigurator
{
    return new ClosureReferenceConfigurator($serviceId);
}

/** * Creates a closure. */
function closure(string|array|ReferenceConfigurator|Expression $callable): InlineServiceConfigurator
{
    return (new InlineServiceConfigurator(new Definition('Closure')))
        ->factory(['Closure', 'fromCallable'])
        ->args([$callable]);
}
Home | Imprint | This part of the site doesn't use cookies.