Documentation

AttributeBasedAutowiring
in package
implements DefinitionSource, Autowiring

Provides DI definitions by reading PHP 8 attributes such as #[Inject] and #[Injectable].

This source automatically includes the reflection source.

Tags
author

Matthieu Napoli matthieu@mnapoli.fr

Table of Contents

Interfaces

DefinitionSource
Source of definitions for entries of the container.
Autowiring
Source of definitions for entries of the container.

Methods

autowire()  : ObjectDefinition|null
Autowire the given definition.
getDefinition()  : ObjectDefinition|null
Returns the DI definition for the entry name.
getDefinitions()  : array<string, Definition>
Autowiring cannot guess all existing definitions.
getMethodInjection()  : MethodInjection|null
getMethodParameter()  : string|null
readInjectableAttribute()  : void
readMethods()  : void
Browse the object's methods looking for annotated methods.
readProperties()  : void
Browse the class properties looking for annotated properties.
readProperty()  : void

Methods

getDefinitions()

Autowiring cannot guess all existing definitions.

public getDefinitions() : array<string, Definition>
Return values
array<string, Definition>

Definitions indexed by their name.

getMethodParameter()

private getMethodParameter(int $parameterIndex, ReflectionParameter $parameter, array<string|int, mixed> $annotationParameters) : string|null
Parameters
$parameterIndex : int
$parameter : ReflectionParameter
$annotationParameters : array<string|int, mixed>
Return values
string|null

Entry name or null if not found.


        
On this page

Search results