解析注释
@return array|null
@throws \ErrorException
@throws \sdopx\SdopxException
15898
public function lexComment()
    {
        $source = $this->source;
        if ($source->cursor >= $source->bound) {
            $this->addError("The parser did not find the '{$source->leftDelimiter}*' comment start tag.", $source->cursor);
            return null;
        }
        Rules::reset($source->leftDelimiter, $source->rightDelimiter);
        $ret = $this->find('@' . preg_quote($source->leftDelimiter . '*', '@') . '@', null, true);
        if ($ret == null) {
            $this->addError("The parser did not find the '{$source->leftDelimiter}*' comment start tag.", $source->cursor);
            return null;
        }
        $source->cursor = $ret['end'];
        $ret = $this->find('@' . preg_quote('*' . $source->rightDelimiter, '@') . '@', null, true);
        if ($ret == null) {
            $this->addError("The parser did not find the '*{$source->rightDelimiter}' comment end tag.", $source->cursor);
            return null;
        }
        $source->cursor = $ret['end'];
        return ['map' => null, 'code' => null, 'next' => 'parsHtml'];
    }
319711
public function errorInfo() {
		$error = $this->getError();
		if($error !== false) {
			return array('HY000', $error['code'], $error['message']);
		}
		return array(PDO::ERR_NONE, null, null);
	}
648371
public function fetch()
    {
        
        if ((null !== $this->statement) && $this->statement->fetch()) {
            $row = [];
            foreach ($this->stmt_results as $dbColumnName => $dbColumnValue) {
                $row[$this->stmt_cols[$dbColumnName]] = $dbColumnValue;
            }
            return $row;
        } elseif ($this->result instanceof \mysqli_result) {
            return mysqli_fetch_array($this->result, MYSQLI_ASSOC);
        } else {
            return null;
            
            if (!isset($this->result)) {
                throw new Exception('The database result resource is not currently set.');
            }
        }
    }
488575
public function getJsonResponse()
    {
        $json = json_decode($this->httpResponse);
        if (is_null($json) && json_last_error() != JSON_ERROR_NONE) {
            return null; // decode error
        } else {
            return is_object($json) ? $json : null;
        }
    }
1049581
public function getError() {
        if ($this->error) {
            return $this->translate($this->error);
        }
        if ($this->form->model && is_object($this->form->model) && $this->form->model->hasErrors($this->name)) {
            $errors = $this->form->model->getErrors($this->name);
            foreach ($errors as &$message) {
                $message = $this->translate($message);
            }
            return $errors;
        }
        return null;
    }
702370
public function getErrorMessage()
    {
        if (array_key_exists('error', $this->responseData?: [])) {
            if (is_string($this->responseData['error'])) {
                return json_encode($this->responseData['error']);
            } elseif(array_key_exists('error', $this->responseData['error'])) {
                return json_encode($this->responseData['error']['error']);
            } else {
                return json_encode($this->responseData['error']);
            }
        } else {
            return null;
        }
    }
645701
public function getErrors()
    {
        $errors = array();

        /**
         * @var EntityContainerInterface $entityContainer
         */
        if (!is_null($entityContainer = current($this->getEntityContainerMap()->getAll()))
            && $entityContainer->hasErrors()
        ) {
            $errors = $entityContainer->getErrors();
        }

        return $errors;
    }
149002
public function jsonSerialize()
    {
        return array_filter(
            [
                'enable' => $this->getEnable(),
                'email' => $this->getEmail()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
233732
public function error()
    {
        $this->errors = [
            'code'    => curl_errno($this->curl),
            'message' => curl_error($this->curl)
        ];

        return $this->error();
    }
757899
public function toArray()
    {
        $errorInfo['code'] = $this->getCode();
        $errorInfo['context'] = $this->getContext();
        $errorInfo['message'] = htmlentities($this->getMessage());

        if (config('app.debug', false)) {
            $trace = $this->getTraceAsString();
            $trace = str_replace(["\n", "#"], ["", "<br>"], $trace);
            $traceArray = explode("<br>", $trace);
            $cleanTrace = [];
            foreach ($traceArray as $k => $v) {
                if (!empty($v)) {
                    $cleanTrace[] = $v;
                }
            }
            $errorInfo['trace'] = $cleanTrace;
        }

        return $errorInfo;
    }
562161
public function getErrorView()
    {
        if($this->app->exists(ErrorView::class)) {
            return $this->app->get(ErrorView::class);
        }
        $error_files = (array)$this->app->get(Web::ERROR_VIEWS);
        if (empty($error_files)) {
            $this->app->set(ErrorView::class, null, true);
            return null;
        }
        $view = new ErrorView($this->getViewEngine(), $this->web->debug);
        if (isset($error_files[0])) {
            $view->default_error_file = $error_files[0];
            unset($error_files[0]);
        }
        $view->setLogger($this->web->getLog());
        $view->error_files = $error_files;
        $this->app->set(ErrorView::class, $view, true);

        return $view;
    }
1222784
public function resolveProcess()
    {
        $result = null;
        foreach ($this->match() as $model) {
            if ($model instanceof ReplyRuleKeyword) {
                $processor = $model->rule->processor;
                $route = $processor[0] == '/' ? $processor : '/wechat/' . $model->rule->mid . '/' . $model->rule->processor;
            } elseif (isset($model['route'])) { // 直接返回处理route
                $route = $model['route'];
            } else {
                continue;
            }

            // 转发路由请求 参考: Yii::$app->runAction()
            $parts = Yii::$app->createController($route);
            if (is_array($parts)) {
                list($controller, $actionID) = $parts;

                // 微信请求的处理器必须继承callmez\wechat\components\ProcessController
                if (!($controller instanceof ProcessController)) {
                    throw new InvalidCallException("Wechat process controller must instance of '" . ProcessController::className() . "'");
                }
                // 传入当前公众号和微信请求内容
                $controller->message = $this->message;
                $controller->setWechat($this->getWechat());

                $oldController = Yii::$app->controller;
                $result = $controller->runAction($actionID);
                Yii::$app->controller = $oldController;
            }

            // 如果有数据则跳出循环直接输出. 否则只作为订阅类型继续循环处理
            if ($result !== null) {
                break;
            }
        }


        $module = isset($controller) ? $controller->module->id : 'wechat'; // 处理的模块
        if ($model instanceof ReplyRuleKeyword) {
            $kid = $model->id;
            $rid = $model->rid;
        } else {
            $kid = $rid = 0;
        }
        // 记录请求内容
        MessageHistory::add([
            'wid' => $this->getWechat()->id,
            'rid' => $rid,
            'kid' => $kid,
            'from' => $this->message['FromUserName'],
            'to' => $this->message['ToUserName'],
            'module' => $module,
            'message' => $this->message,
            'type' => MessageHistory::TYPE_REQUEST
        ]);
        // 记录响应内容
        if ($result !== null) {
            // 记录响应内容
            MessageHistory::add([
                'wid' => $this->getWechat()->id,
                'rid' => $rid,
                'kid' => $kid,
                'from' => $this->message['ToUserName'],
                'to' => $this->message['FromUserName'],
                'module' => $module,
                'message' => $result,
                'type' => MessageHistory::TYPE_RESPONSE
            ]);
        }

        return $result;
    }
274218
public function jsonSerialize()
    {
        return array_filter(
            [
                'group_id' => $this->getGroupId(),
                'groups_to_display' => $this->getGroupsToDisplay()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
704783
public function errorInfo()
    {
        if (!$this->_last_error) {
            return null;
        }
        return array($this->_last_error["code"],
                     $this->_last_error["code"],
                     $this->_last_error["message"]);
    }
986041
public function getErrors()
    {
        if (empty( $this->_errors )) {
            $errorList = Array();

            foreach ($this->__get(self::$ERROR) as $error) {
                $errorCode       = $error[self::$ERROR_ERROR_CODE];
                $message         = $error[self::$ERROR_MESSAGE];
                $consumerMessage = $error[self::$ERROR_CONSUMER_MESSAGE];
                $paySysMessage   = $error[self::$ERROR_PAY_SYS_MESSAGE];

                $errorObject = new WirecardCEE_QMore_Error($errorCode, $message);
                $errorObject->setPaySysMessage($paySysMessage);
                $errorObject->setConsumerMessage($consumerMessage);

                array_push($errorList, $errorObject);
            }

            $this->_errors = $errorList;
        }

        return $this->_errors;
    }
1194970
public function getErrorMessage()
    {
        $errorValue = null;
        if ($this->hasError()) {
            $errorValue = (string) $this->xmlElement->errors->error;
        }
        return $errorValue;
    }
418780
public function getErrors(): array
    {
        $error = [];

        foreach ($this->list as $r) {
            $error[$r->getPropertyPath()] = $r->getMessage();
        }

        return $error;
    }