W3cubDocs

/Symfony 4.1

ServicesConfigurator

class ServicesConfigurator extends AbstractConfigurator

Constants

FACTORY

Properties

protected $definition from AbstractConfigurator

Methods

__call($method, $args) from AbstractConfigurator
static mixed processValue(mixed $value, bool $allowServices = false)

Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.

from AbstractConfigurator
__construct(ContainerBuilder $container, PhpFileLoader $loader, array $instanceof, string $path = null, int $anonymousCount = 0)
DefaultsConfigurator defaults()

Defines a set of defaults for following service definitions.

InstanceofConfigurator instanceof(string $fqcn)

Defines an instanceof-conditional to be applied to following service definitions.

ServiceConfigurator set(string|null $id, string $class = null)

Registers a service.

AliasConfigurator alias(string $id, string $referencedId)

Creates an alias.

PrototypeConfigurator load(string $namespace, string $resource)

Registers a PSR-4 namespace using a glob pattern.

ServiceConfigurator get(string $id)

Gets an already defined service definition.

ServiceConfigurator __invoke(string $id, string $class = null)

Registers a service.

Details

__call($method, $args)

Parameters

$method
$args

static mixed processValue(mixed $value, bool $allowServices = false)

Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.

Parameters

mixed $value
bool $allowServices whether Definition and Reference are allowed; by default, only scalars and arrays are

Return Value

mixed the value, optionally cast to a Definition/Reference

__construct(ContainerBuilder $container, PhpFileLoader $loader, array $instanceof, string $path = null, int $anonymousCount = 0)

Parameters

ContainerBuilder $container
PhpFileLoader $loader
array $instanceof
string $path
int $anonymousCount

final DefaultsConfigurator defaults()

Defines a set of defaults for following service definitions.

Return Value

DefaultsConfigurator

final InstanceofConfigurator instanceof(string $fqcn)

Defines an instanceof-conditional to be applied to following service definitions.

Parameters

string $fqcn

Return Value

InstanceofConfigurator

final ServiceConfigurator set(string|null $id, string $class = null)

Registers a service.

Parameters

string|null $id The service id, or null to create an anonymous service
string $class The class of the service, or null when $id is also the class name

Return Value

ServiceConfigurator

final AliasConfigurator alias(string $id, string $referencedId)

Creates an alias.

Parameters

string $id
string $referencedId

Return Value

AliasConfigurator

final PrototypeConfigurator load(string $namespace, string $resource)

Registers a PSR-4 namespace using a glob pattern.

Parameters

string $namespace
string $resource

Return Value

PrototypeConfigurator

final ServiceConfigurator get(string $id)

Gets an already defined service definition.

Parameters

string $id

Return Value

ServiceConfigurator

Exceptions

ServiceNotFoundException if the service definition does not exist

final ServiceConfigurator __invoke(string $id, string $class = null)

Registers a service.

Parameters

string $id
string $class

Return Value

ServiceConfigurator