httpConfig = $commonConfig; $this->init(); } /** * 初始化 */ protected function init() { if ($this->init) { return; } $this->init = true; $this->appId = $this->httpConfig->getConfig('official.appid', ''); $this->secret = $this->httpConfig->getConfig('official.secret', ''); $this->token = $this->httpConfig->getConfig('official.token', ''); $this->aesKey = ($this->httpConfig->getConfig('official.encode', -1) > 0 ? $this->httpConfig->getConfig('official.key', '') : ''); } /** * 获取所有配置 * @return array */ #[ArrayShape([ 'app_id' => "string", 'secret' => "string", 'token' => "string", 'aes_key' => "string", 'response_type' => "string", 'log' => "array", 'http' => "bool[]" ])] #[Pure] public function all(): array { return [ 'app_id' => $this->appId, 'secret' => $this->secret, 'token' => $this->token, 'aes_key' => $this->aesKey, 'response_type' => $this->responseType, 'http' => $this->httpConfig->all() ]; } }