ConfigureTrait
Implements a configure() helper.
Tags
Table of Contents
Methods
- configure() : object
- Configure an object.
Methods
configure()
Configure an object.
public
static configure(string|array<string|int, mixed>|object $config[, class-string|null $assert = null ][, bool $init = true ]) : object
If 'configurable' this will use the 'update()' method. Otherwise it'll set properties directly on the object.
The config is a key-value array, for example:
[
'\\My\\Big\\Class' => [
'foo' => 'bar',
'baz' => 'qux',
]
]
Given a string the 'config' is implicitly an empty array.
Parameters
- $config : string|array<string|int, mixed>|object
-
[ class => config ]
- $assert : class-string|null = null
-
class name to verify
- $init : bool = true
-
whether to initialize the object after creation