ArrayServiceProvider

Class
implements ServiceProviderInterface
Read only: Yes Final: Yes

Class ArrayServiceProvider.

Description

A simple implementation of the ServiceProviderInterface that uses plain arrays to define service factories and extensions. This provider is suitable for static configuration and testing scenarios where no dynamic resolution is required.

Factories MUST be defined as an associative array where keys are service IDs and values are callables. Extensions MUST also follow the same format.

Table of Contents

Interfaces

Properties

 : array<string|int, mixed>
 : array<string|int, mixed>

Methods

__construct()

Constructs an ArrayServiceProvider with pre-defined factories and extensions.

 : mixed
 : array<string|int, mixed>
 : array<string|int, mixed>
Properties
Methods

__construct()

Public

Constructs an ArrayServiceProvider with pre-defined factories and extensions.

public __construct([ array<string|int, mixed>  $factories = []][, array<string|int, mixed>  $extensions = []]) : mixed
Parameters
$factories : array<string|int, mixed> = []
$extensions : array<string|int, mixed> = []

getExtensions()

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

getFactories()

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