PocketMine-MP
5.24.1 git-9d6a0cc7385976fb350f6f919ecc5580b508a783
Loading...
Searching...
No Matches
ErrorTypeToStringMap.php
1
<?php
2
3
/*
4
* PocketMine Standard PHP Library
5
* Copyright (C) 2019 PocketMine Team <https://github.com/pmmp/PocketMine-SPL>
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU Lesser General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*/
17
18
declare(strict_types=1);
19
20
namespace
pocketmine\errorhandler;
21
22
final
class
ErrorTypeToStringMap
{
23
private
const
ERROR_STRINGS = [
24
0 =>
"EXCEPTION"
,
25
E_ERROR =>
"E_ERROR"
,
26
E_WARNING =>
"E_WARNING"
,
27
E_PARSE =>
"E_PARSE"
,
28
E_NOTICE =>
"E_NOTICE"
,
29
E_CORE_ERROR =>
"E_CORE_ERROR"
,
30
E_CORE_WARNING =>
"E_CORE_WARNING"
,
31
E_COMPILE_ERROR =>
"E_COMPILE_ERROR"
,
32
E_COMPILE_WARNING =>
"E_COMPILE_WARNING"
,
33
E_USER_ERROR =>
"E_USER_ERROR"
,
34
E_USER_WARNING =>
"E_USER_WARNING"
,
35
E_USER_NOTICE =>
"E_USER_NOTICE"
,
36
E_STRICT =>
"E_STRICT"
,
37
E_RECOVERABLE_ERROR =>
"E_RECOVERABLE_ERROR"
,
38
E_DEPRECATED =>
"E_DEPRECATED"
,
39
E_USER_DEPRECATED =>
"E_USER_DEPRECATED"
40
];
41
42
private
function
__construct(){
43
44
}
45
51
public
static
function
get
(
int
$errorType) : string{
52
if(!isset(self::ERROR_STRINGS[$errorType])){
53
throw
new \InvalidArgumentException(
"Invalid error type $errorType"
);
54
}
55
56
return
self::ERROR_STRINGS[$errorType];
57
}
58
}
pocketmine\errorhandler\ErrorTypeToStringMap
Definition
ErrorTypeToStringMap.php:22
vendor
pocketmine
errorhandler
src
ErrorTypeToStringMap.php
Generated by
1.12.0