CallObject
Inject the result of a Registry-resolved method call.
Purpose & processing
Obtains the object through the Registry and invokes the configured method; the returned value becomes the property value.
Parameters
| Parameter | Type | Default | Behavior |
|---|---|---|---|
| class | string | Required | Class to resolve through the Registry. |
| method | string | Required | Method to invoke on the resolved object. |
| parameters | array | [] | Arguments passed to the invoked method. |
Example
#[CallObject(MyService::class, 'getTitle', ['home'])]
protected string|null $title = null;Behavior and considerations
- A missing method raises RegistryException; it is not silently converted to null.
- The invoked method itself may return null.
- Existing non-null property values are preserved.
Source
shared/src/Core/Annotation/CallObject.php