Skip to content

Commit 6451f85

Browse files
nicumiclepandanicu
authored andcommitted
Refactor Exception codes
1 parent 1b9d33a commit 6451f85

File tree

1 file changed

+40
-43
lines changed

1 file changed

+40
-43
lines changed

src/ExceptionCodes.php

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
5-
63
namespace Firebase\JWT;
74

85
class ExceptionCodes
@@ -17,44 +14,44 @@ class ExceptionCodes
1714
public const INCORRECT_KEY_FOR_ALGORITHM = 8;
1815
public const SIGN_ALGORITHM_NOT_SUPPORTED = 9;
1916
public const KEY_IS_NOT_STRING = 10;
20-
const OPENSSL_CAN_NOT_SIGN_DATA = 11;
21-
const SODIUM_KEY_IS_NOT_STRING = 12;
22-
const SODIUM_EXCEPTION = 13;
23-
const SIGN_GENERAL_EXCEPTION = 14;
24-
const VERIFY_ALGORITHM_NOT_SUPPORTED = 15;
25-
const VERIFY_OPEN_SSL_ERROR = 16;
26-
const VERIFY_SODIUM_NOT_AVAILABLE = 17;
27-
const VERIFY_KEY_MATERIAL_IS_NOT_STRING = 18;
28-
const VERIFY_SODIUM_EXCEPTION = 19;
29-
const VERIFY_KEY_IS_NOT_STRING = 20;
30-
const DECODED_JSON_IS_NULL = 21;
31-
const ENCODED_JSON_IS_NULL = 22;
32-
const INVALID_JSON = 23;
33-
const KID_IS_EMPTY = 24;
34-
const KID_IS_INVALID = 25;
35-
const JSON_ERROR = 26;
36-
37-
const KEY_ID_NOT_FOUND = 27;
38-
const OFFSET_SET_METHOD_NOT_IMPLEMENTED = 28;
39-
const OFFSET_UNSET_METHOD_NOT_IMPLEMENTED = 29;
40-
41-
const JWKS_URI_IS_EMPTY = 30;
42-
43-
const JWK_MISSING_KEYS = 31;
44-
const JWT_KEYS_IS_EMPTY = 32;
45-
const JWT_ALGORITHM_NOT_SUPPORTED = 33;
46-
const JWK_IS_EMPTY = 34;
47-
const JWT_MISSING_KTY_PARAMETER = 35;
48-
const JWT_MISSING_ALG_PARAMETER = 36;
49-
const JWT_RSA_KEYS_NOT_SUPPORTED = 37;
50-
const JWT_RSA_KEYS_MISSING_N_AND_E = 38;
51-
const JWT_OPEN_SSL_ERROR = 39;
52-
const JWK_EC_D_IS_NOT_SET = 40;
53-
const JWT_EC_CRV_IS_EMPTY = 41;
54-
const JWK_UNSUPPORTED_EC_CURVE = 42;
55-
const JWT_X_AND_Y_ARE_EMPTY = 42;
56-
57-
const KEY_MATERIAL_IS_INVALID = 43;
58-
const KEY_MATERIAL_IS_EMPTY = 44;
59-
const KEY_ALGORITHM_IS_EMPTY = 45;
17+
public const OPENSSL_CAN_NOT_SIGN_DATA = 11;
18+
public const SODIUM_KEY_IS_NOT_STRING = 12;
19+
public const SODIUM_EXCEPTION = 13;
20+
public const SIGN_GENERAL_EXCEPTION = 14;
21+
public const VERIFY_ALGORITHM_NOT_SUPPORTED = 15;
22+
public const VERIFY_OPEN_SSL_ERROR = 16;
23+
public const VERIFY_SODIUM_NOT_AVAILABLE = 17;
24+
public const VERIFY_KEY_MATERIAL_IS_NOT_STRING = 18;
25+
public const VERIFY_SODIUM_EXCEPTION = 19;
26+
public const VERIFY_KEY_IS_NOT_STRING = 20;
27+
public const DECODED_JSON_IS_NULL = 21;
28+
public const ENCODED_JSON_IS_NULL = 22;
29+
public const INVALID_JSON = 23;
30+
public const KID_IS_EMPTY = 24;
31+
public const KID_IS_INVALID = 25;
32+
public const JSON_ERROR = 26;
33+
34+
public const KEY_ID_NOT_FOUND = 27;
35+
public const OFFSET_SET_METHOD_NOT_IMPLEMENTED = 28;
36+
public const OFFSET_UNSET_METHOD_NOT_IMPLEMENTED = 29;
37+
38+
public const JWKS_URI_IS_EMPTY = 30;
39+
40+
public const JWK_MISSING_KEYS = 31;
41+
public const JWT_KEYS_IS_EMPTY = 32;
42+
public const JWT_ALGORITHM_NOT_SUPPORTED = 33;
43+
public const JWK_IS_EMPTY = 34;
44+
public const JWT_MISSING_KTY_PARAMETER = 35;
45+
public const JWT_MISSING_ALG_PARAMETER = 36;
46+
public const JWT_RSA_KEYS_NOT_SUPPORTED = 37;
47+
public const JWT_RSA_KEYS_MISSING_N_AND_E = 38;
48+
public const JWT_OPEN_SSL_ERROR = 39;
49+
public const JWK_EC_D_IS_NOT_SET = 40;
50+
public const JWT_EC_CRV_IS_EMPTY = 41;
51+
public const JWK_UNSUPPORTED_EC_CURVE = 42;
52+
public const JWT_X_AND_Y_ARE_EMPTY = 42;
53+
54+
public const KEY_MATERIAL_IS_INVALID = 43;
55+
public const KEY_MATERIAL_IS_EMPTY = 44;
56+
public const KEY_ALGORITHM_IS_EMPTY = 45;
6057
}

0 commit comments

Comments
 (0)