HumHub Documentation (unofficial)

PluginManagerInterface extends ServiceLocatorInterface

Interface for a plugin manager

A plugin manager is a specialized service locator used to create homogeneous objects

Tags
template

InstanceType

Table of Contents

Methods

build()  : mixed
Build a service by its name, using optional options (such services are NEVER cached).
get()  : mixed
Finds an entry of the container by its identifier and returns it.
has()  : bool
Returns true if the container can return an entry for the given identifier.
validate()  : void
Validate an instance

Methods

build()

Build a service by its name, using optional options (such services are NEVER cached).

public build(string|T> $name[, null|array<string|int, mixed> $options = null ]) : mixed
Parameters
$name : string|T>
$options : null|array<string|int, mixed> = null
Tags
template

T of object

psalm-return

($name is class-string<T> ? T : mixed)

throws
ServiceNotFoundException

If no factory/abstract factory could be found to create the instance.

throws
ServiceNotCreatedException

If factory/delegator fails to create the instance.

throws
ContainerExceptionInterface

If any other error occurs.

has()

Returns true if the container can return an entry for the given identifier.

public has(string $id) : bool

Returns false otherwise.

has($id) returning true does not mean that get($id) will not throw an exception. It does however mean that get($id) will not throw a NotFoundExceptionInterface.

Parameters
$id : string

Identifier of the entry to look for.

Return values
bool

        
On this page

Search results