Documentation

FromCallableConfigurator extends AbstractServiceConfigurator
in package
uses AbstractTrait, AutoconfigureTrait, AutowireTrait, BindTrait, DecorateTrait, DeprecateTrait, LazyTrait, PublicTrait, ShareTrait, TagTrait

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

Constants

FACTORY  = 'services'

Properties

$valuePreProcessor  : callable(mixed, bool): mixed|null
$id  : mixed
$parent  : mixed
$serviceConfigurator  : ServiceConfigurator

Methods

__call()  : mixed
__construct()  : mixed
__destruct()  : mixed
__invoke()  : ServiceConfigurator
Registers a service.
__serialize()  : array<string|int, mixed>
__unserialize()  : void
abstract()  : $this
Whether this definition is abstract, that means it merely serves as a template for other definitions.
alias()  : AliasConfigurator
Creates an alias.
autoconfigure()  : $this
Sets whether or not instanceof conditionals should be prepended with a global set.
autowire()  : $this
Enables/disables autowiring.
bind()  : $this
Sets bindings.
decorate()  : $this
Sets the service that this service is decorating.
deprecate()  : $this
Whether this definition is deprecated, that means it should not be called anymore.
get()  : ServiceConfigurator
Gets an already defined service definition.
lazy()  : $this
Sets the lazy flag of this service.
load()  : PrototypeConfigurator
Registers a PSR-4 namespace using a glob pattern.
private()  : $this
processValue()  : mixed
Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.
public()  : $this
remove()  : ServicesConfigurator
Removes an already defined service definition or alias.
set()  : ServiceConfigurator
Registers a service.
share()  : $this
Sets if the service must be shared or not.
stack()  : AliasConfigurator
Registers a stack of decorator services.
tag()  : $this
Adds a tag for this definition.
validateAttributes()  : void

Constants

Properties

Methods

__call()

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string
$args : array<string|int, mixed>

__serialize()

public __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

__unserialize()

public __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

abstract()

Whether this definition is abstract, that means it merely serves as a template for other definitions.

public final abstract([bool $abstract = true ]) : $this
Parameters
$abstract : bool = true
Return values
$this

autoconfigure()

Sets whether or not instanceof conditionals should be prepended with a global set.

public final autoconfigure([bool $autoconfigured = true ]) : $this
Parameters
$autoconfigured : bool = true
Tags
throws
InvalidArgumentException

when a parent is already set

Return values
$this

autowire()

Enables/disables autowiring.

public final autowire([bool $autowired = true ]) : $this
Parameters
$autowired : bool = true
Return values
$this

bind()

Sets bindings.

public final bind(string $nameOrFqcn, mixed $valueOrRef) : $this

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).

Parameters
$nameOrFqcn : string

A parameter name with its "$" prefix, or an FQCN

$valueOrRef : mixed

The value or reference to bind

Return values
$this

decorate()

Sets the service that this service is decorating.

public final decorate(string|null $id[, string|null $renamedId = null ][, int $priority = 0 ][, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE ]) : $this
Parameters
$id : string|null

The decorated service id, use null to remove decoration

$renamedId : string|null = null
$priority : int = 0
$invalidBehavior : int = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE
Tags
throws
InvalidArgumentException

in case the decorated service id and the new decorated service id are equals

Return values
$this

deprecate()

Whether this definition is deprecated, that means it should not be called anymore.

public final deprecate(string $package, string $version, string $message) : $this
Parameters
$package : string

The name of the composer package that is triggering the deprecation

$version : string

The version of the package that introduced the deprecation

$message : string

The deprecation message to use

Tags
throws
InvalidArgumentException

when the message template is invalid

Return values
$this

lazy()

Sets the lazy flag of this service.

public final lazy([bool|string $lazy = true ]) : $this
Parameters
$lazy : bool|string = true

A FQCN to derivate the lazy proxy from or true to make it extend from the definition's class

Return values
$this

private()

public final private() : $this
Return values
$this

processValue()

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

public static processValue(mixed $value[, bool $allowServices = false ]) : mixed
Parameters
$value : mixed
$allowServices : bool = false

whether Definition and Reference are allowed; by default, only scalars, arrays and enum are

Return values
mixed

the value, optionally cast to a Definition/Reference

public()

public final public() : $this
Return values
$this

share()

Sets if the service must be shared or not.

public final share([bool $shared = true ]) : $this
Parameters
$shared : bool = true
Return values
$this

tag()

Adds a tag for this definition.

public final tag(string $name[, array<string|int, mixed> $attributes = [] ]) : $this
Parameters
$name : string
$attributes : array<string|int, mixed> = []
Return values
$this

validateAttributes()

private validateAttributes(string $tag, array<string|int, mixed> $attributes[, array<string|int, mixed> $path = [] ]) : void
Parameters
$tag : string
$attributes : array<string|int, mixed>
$path : array<string|int, mixed> = []

        
On this page

Search results