lithium\net\Message::__construct()
Constructor Adds config values to the public properties when a new object is created.
Parameters
-
array
$config
Available configuration options are:
'scheme'
string: 'tcp''host'
string: 'localhost''port'
integer: null'username'
string: null'password'
string: null'path'
string: null'body'
mixed: null
Returns
voidSource
public function __construct(array $config = []) {
$defaults = [
'scheme' => 'tcp',
'host' => 'localhost',
'port' => null,
'username' => null,
'password' => null,
'path' => null,
'body' => null
];
$config += $defaults;
foreach (array_intersect_key(array_filter($config), $defaults) as $key => $value) {
$this->{$key} = $value;
}
parent::__construct($config);
}