方法
来源
类异常扩展了PHPException{ /** *异常的类型 * *@var字符串 */ 受保护的$type; /** *与异常关联的数据 * *@var混合 */ 受保护的$data; /** *创建新异常 * *@param string$message异常消息 *@param string$type异常类型 *@param混合$data关联数据 *@param integer$code异常数字代码,如果适用 */ 公共函数__construct($message,$type,$data=null,$code=0){ 父级::__construct($message,$code); $this->type=$type; $this->data=$data; } /** *喜欢 \异常::getCode() ,但为字符串代码。 * *@codeCoverage忽略 *@return字符串 */ 公共函数getType(){ 返回$this->类型; } /** *提供任何相关数据 * *@codeCoverage忽略 *@返回混合 */ 公共函数getData(){ 返回$this->数据; } }