Exception   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 33
dl 0
loc 82
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay\Exception;
6
7
use Throwable;
8
9
class Exception extends \Exception
10
{
11
    public const UNKNOWN_ERROR = 9999;
12
13
    /*
14
     * 关于参数.
15
     */
16
    public const PARAMS_SHORTCUT_ACTION_INVALID = 9210;
17
18
    public const PARAMS_METHOD_NOT_SUPPORTED = 9211;
19
20
    public const PARAMS_WECHAT_PAPAY_TYPE_NOT_SUPPORTED = 9212;
21
22
    public const PARAMS_WECHAT_URL_MISSING = 9213;
23
24
    public const PARAMS_WECHAT_BODY_MISSING = 9214;
25
26
    public const PARAMS_WECHAT_SERIAL_NOT_FOUND = 9215;
27
28
    public const PARAMS_UNIPAY_URL_MISSING = 9216;
29
30
    public const PARAMS_UNIPAY_BODY_MISSING = 9217;
31
32
    public const PARAMS_NECESSARY_PARAMS_MISSING = 9218;
33
34
    public const PARAMS_PLUGIN_ONLY_SUPPORT_SERVICE_MODE = 9219;
35
36
    public const PARAMS_PLUGIN_ONLY_SUPPORT_NORMAL_MODE = 9220;
37
38
    public const PARAMS_CALLBACK_REQUEST_INVALID = 9221;
39
40
    public const PARAMS_DOUYIN_URL_MISSING = 9222;
41
42
    /**
43
     * 关于响应.
44
     */
45
    public const RESPONSE_CODE_WRONG = 9304;
46
47
    public const RESPONSE_MISSING_NECESSARY_PARAMS = 9305;
48
49
    public const RESPONSE_BUSINESS_CODE_WRONG = 9306;
50
51
    /*
52
     * 关于配置.
53
     */
54
    public const CONFIG_ALIPAY_INVALID = 9401;
55
56
    public const CONFIG_WECHAT_INVALID = 9402;
57
58
    public const CONFIG_UNIPAY_INVALID = 9403;
59
60
    public const CONFIG_JSB_INVALID = 9404;
61
62
    public const CONFIG_DOUYIN_INVALID = 9405;
63
64
    /**
65
     * 关于签名.
66
     */
67
    public const SIGN_ERROR = 9500;
68
69
    public const SIGN_EMPTY = 9501;
70
71
    /**
72
     * 关于加解密.
73
     */
74
    public const DECRYPT_ERROR = 9600;
75
76
    public const DECRYPT_WECHAT_CIPHERTEXT_PARAMS_INVALID = 9601;
77
78
    public const DECRYPT_WECHAT_ENCRYPTED_DATA_INVALID = 9602;
79
80
    public const DECRYPT_WECHAT_DECRYPTED_METHOD_INVALID = 9603;
81
82
    public const DECRYPT_WECHAT_ENCRYPTED_CONTENTS_INVALID = 9604;
83
84
    public mixed $extra;
85
86
    public function __construct(string $message = '未知异常', int $code = self::UNKNOWN_ERROR, mixed $extra = null, ?Throwable $previous = null)
87
    {
88
        $this->extra = $extra;
89
90
        parent::__construct($message, $code, $previous);
91
    }
92
}
93