public function __construct($config = [])
{
$defaults = ['type' => 'normal', 'message' => '', 'parent' => null, 'root' => null, 'log' => null, 'timeout' => 0, 'summary' => null];
$config += $defaults;
$this->_type = $config['type'];
$this->_message = $config['message'];
$this->_parent = $config['parent'];
$this->_root = $this->_parent ? $this->_parent->_root : $this;
$this->_timeout = $config['timeout'];
$this->_backtrace = Debugger::focus($this->backtraceFocus(), Debugger::backtrace(), 1);
$this->_log = $config['log'] ?: new Log(['scope' => $this, 'backtrace' => $this->_backtrace]);
$this->_summary = $config['summary'];
if ($this->_summary) {
return;
}
if ($this->_root->summary()) {
$this->_summary = $this->_root->summary();
} else {
$this->_summary = new Summary();
}
}