\EasyWeChat\Support\TraitsPrefixedContainer

Trait PrefixedContainer.

Summary

Methods
Properties
Constants
__construct()
fetch()
__get()
No public properties found
No constants found
No protected methods found
$container
N/A
No private methods found
No private properties found
N/A

Properties

Methods

__construct()

__construct(\Pimple\Container  $container) 

ContainerAccess constructor.

Parameters

\Pimple\Container $container

fetch()

fetch(string  $key, callable|null  $callable = null) : mixed

Fetches from pimple container.

Parameters

string $key
callable|null $callable

Returns

mixed

__get()

__get(string  $key) : mixed

Gets a parameter or an object from pimple container.

Get the class basename of the current class. Convert class basename to snake-case and concatenation with dot notation.

E.g. Class 'EasyWechat', $key foo -> 'easy_wechat.foo'

Parameters

string $key

The unique identifier for the parameter or object

Throws

\InvalidArgumentException

If the identifier is not defined

Returns

mixed —

The value of the parameter or an object