event[strtoupper($type)] = $cb; return $this; } /** * 事件触发器 * * @param string $type * @param array $args * @param boolean $withThis * @return mixed * @date 2022-12-28 * @example * @author arw * @since 1.0.0 */ private function trigger(string $type, array $args = [], bool $withThis = true) { $type = strtoupper($type); if (isset($this->event[$type])) { if ($withThis) { array_unshift($args, $this); } return call_user_func_array($this->event[$type], $args); } } }