Nexus API Reference

FromService
in package

Read onlyYes
FinalYes
Tags
psalm-api

Inject a service from the PSR-11 container.

#[FromService('logger.audit')] LoggerInterface $log // resolve by container id #[FromService] MyService $service // resolve by type

Works on constructor params and on handler/middleware invocation method params. Requires a ContainerInterface to be supplied to HttpApp::create().

Table of Contents

Properties

$id  : string|null

Methods

__construct()  : mixed

Attributes

#[Attribute]

#[Attribute]

Properties

Methods

__construct()

public __construct([string|null $id = null ]) : mixed
Parameters
$id : string|null = null

        
On this page

Search results