Neuron-PHP

Container
in package

CMS Dependency Injection Container

Builds and configures the PSR-11 compliant container for the CMS. Service definitions are loaded from YAML configuration files.

Table of Contents

Properties

$instance  : IContainer|null

Methods

build()  : IContainer
Build and return the DI container
getInstance()  : IContainer|null
Get the container instance
reset()  : void
Reset the container instance (useful for testing)

Properties

Methods

build()

Build and return the DI container

public static build(SettingManager $settings[, string|null $environment = null ]) : IContainer

Loads service definitions from resources/config/services.yaml and optionally from environment-specific override files.

Parameters
$settings : SettingManager

Application settings

$environment : string|null = null

Environment name (testing, production, etc.)

Tags
throws
Exception
Return values
IContainer

reset()

Reset the container instance (useful for testing)

public static reset() : void

        
On this page

Search results