Documentation

TypedReference extends Reference
in package

Represents a PHP type-hinted service reference.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

Properties

$attributes  : array<string|int, mixed>
$name  : string|null
$type  : string

Methods

__construct()  : mixed
__toString()  : string
getAttributes()  : array<string|int, mixed>
getInvalidBehavior()  : int
Returns the behavior to be used when the service does not exist.
getName()  : string|null
getType()  : string

Properties

Methods

__construct()

public __construct(string $id, string $type[, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE ][, string|null $name = null ][, array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
$id : string

The service identifier

$type : string

The PHP type of the identified service

$invalidBehavior : int = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE

The behavior when the service does not exist

$name : string|null = null

The name of the argument targeting the service

$attributes : array<string|int, mixed> = []

The attributes to be used

__toString()

public __toString() : string
Return values
string

getAttributes()

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

getInvalidBehavior()

Returns the behavior to be used when the service does not exist.

public getInvalidBehavior() : int
Return values
int

getName()

public getName() : string|null
Return values
string|null

        
On this page

Search results