Repository navigation
Expand file tree
/
Copy pathMessage.php
More file actions
315 lines (270 loc) · 10.2 KB
/
Copy pathMessage.php
File metadata and controls
315 lines (270 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<?php
declare(strict_types=1);
namespace PHPForge\Debug\Exception;
use function sprintf;
/**
* Exception message templates authored by this package.
*
* Use {@see Message::getMessage()} to format a template with `sprintf()` arguments.
*/
enum Message: string
{
/**
* Indicates that the active tab index does not identify a supplied tab.
*
* Format: "The active tab index must identify a supplied tab."
*/
case ACTIVE_TAB_INDEX_INVALID = 'The active tab index must identify a supplied tab.';
/**
* Indicates that the maximum captured body size is not positive.
*
* Format: "The maximum body size must be greater than zero."
*/
case BODY_SIZE_INVALID = 'The maximum body size must be greater than zero.';
/**
* Indicates that a collector ID is registered more than once.
*
* Format: "Duplicate debug collector ID: %s."
*/
case COLLECTOR_ID_DUPLICATE = 'Duplicate debug collector ID: %s.';
/**
* Indicates that a collector ID is empty.
*
* Format: "Debug collector ID must not be empty."
*/
case COLLECTOR_ID_EMPTY = 'Debug collector ID must not be empty.';
/**
* Indicates that the debug data directory cannot be created.
*
* Format: "Unable to create debug data directory: %s"
*/
case DATA_DIRECTORY_CREATE_FAILED = 'Unable to create debug data directory: %s';
/**
* Indicates that permissions cannot be applied to the debug data directory.
*
* Format: "Unable to apply debug data directory mode: %s"
*/
case DATA_DIRECTORY_MODE_FAILED = 'Unable to apply debug data directory mode: %s';
/**
* Indicates that permissions cannot be applied to a debug data file.
*
* Format: "Unable to apply debug data file mode for: %s"
*/
case DATA_FILE_MODE_FAILED = 'Unable to apply debug data file mode for: %s';
/**
* Indicates that a debug data file cannot be read.
*
* Format: "Unable to read debug data file: %s"
*/
case DATA_FILE_READ_FAILED = 'Unable to read debug data file: %s';
/**
* Indicates that a debug data file cannot be removed.
*
* Format: "Unable to remove debug data file: %s"
*/
case DATA_FILE_REMOVE_FAILED = 'Unable to remove debug data file: %s';
/**
* Indicates that a debug data file cannot be replaced.
*
* Format: "Unable to replace debug data file: %s"
*/
case DATA_FILE_REPLACE_FAILED = 'Unable to replace debug data file: %s';
/**
* Indicates that a debug data file cannot be restored during rollback.
*
* Format: "Unable to roll back debug data file: %s"
*/
case DATA_FILE_ROLLBACK_FAILED = 'Unable to roll back debug data file: %s';
/**
* Indicates that the configured debug data path is not a directory.
*
* Format: "Debug data path is not a directory: %s"
*/
case DATA_PATH_NOT_DIRECTORY = 'Debug data path is not a directory: %s';
/**
* Indicates that the configured history size is invalid.
*
* Format: "Invalid debug history size: %s"
*/
case HISTORY_SIZE_INVALID = 'Invalid debug history size: %s';
/**
* Indicates that the debug data lock cannot be acquired.
*
* Format: "Unable to acquire debug data lock: %s"
*/
case LOCK_ACQUIRE_FAILED = 'Unable to acquire debug data lock: %s';
/**
* Indicates that the debug data lock file cannot be opened.
*
* Format: "Unable to open debug data lock file: %s"
*/
case LOCK_FILE_OPEN_FAILED = 'Unable to open debug data lock file: %s';
/**
* Indicates that the persisted debug manifest is empty.
*
* Format: "Debug manifest is empty: %s"
*/
case MANIFEST_EMPTY = 'Debug manifest is empty: %s';
/**
* Indicates a manifest read failure while preserving the original exception.
*
* Format: "Unable to read debug manifest."
*/
case MANIFEST_READ_ERROR = 'Unable to read debug manifest.';
/**
* Indicates that the specified debug manifest cannot be read.
*
* Format: "Unable to read debug manifest: %s"
*/
case MANIFEST_READ_FAILED = 'Unable to read debug manifest: %s';
/**
* Indicates that the N+1 detection threshold is less than two.
*
* Format: "The N+1 threshold must be at least two."
*/
case N_PLUS_ONE_THRESHOLD_INVALID = 'The N+1 threshold must be at least two.';
/**
* Indicates that a panel icon key does not match the accepted icon key shape.
*
* Format: "Debug panel icon key is invalid: "%s"."
*/
case PANEL_ICON_INVALID = 'Debug panel icon key is invalid: "%s".';
/**
* Indicates that a panel ID is registered more than once.
*
* Format: "Duplicate debug panel ID: %s."
*/
case PANEL_ID_DUPLICATE = 'Duplicate debug panel ID: %s.';
/**
* Indicates that a panel ID is empty or carries surrounding whitespace, which is rejected instead of trimmed.
*
* Format: "Debug panel ID must be a non-empty identifier without surrounding whitespace: "%s"."
*/
case PANEL_ID_INVALID = 'Debug panel ID must be a non-empty identifier without surrounding whitespace: "%s".';
/**
* Indicates that a panel option value does not satisfy its expected type.
*
* Format: "Debug panel option '%s' must be %s."
*/
case PANEL_OPTION_TYPE_INVALID = 'Debug panel option \'%s\' must be %s.';
/**
* Indicates that a panel entry carries a key outside the accepted options.
*
* Format: "Unknown debug panel option '%s'. Allowed options: %s."
*/
case PANEL_OPTION_UNKNOWN = 'Unknown debug panel option \'%s\'. Allowed options: %s.';
/**
* Indicates that a panel override targets an ID no provider registered and does not disable it.
*
* Format: "Debug panel override targets an unregistered ID: %s."
*/
case PANEL_OVERRIDE_UNREGISTERED = 'Debug panel override targets an unregistered ID: %s.';
/**
* Indicates that a panel override sets a position on a built-in panel, whose order is fixed.
*
* Format: "Debug panel position must not be set on the built-in panel: %s."
*/
case PANEL_POSITION_BUILT_IN = 'Debug panel position must not be set on the built-in panel: %s.';
/**
* Indicates that a panel title is empty.
*
* Format: "Debug panel title must not be empty."
*/
case PANEL_TITLE_EMPTY = 'Debug panel title must not be empty.';
/**
* Indicates that a registration entry declares a non-boolean `enabled` option.
*
* Format: "Debug registration '%s' option 'enabled' must be a boolean."
*/
case REGISTRATION_ENABLED_INVALID = 'Debug registration \'%s\' option \'enabled\' must be a boolean.';
/**
* Indicates that a registration entry is neither a class string nor an array declaring a `class` string.
*
* Format: "Debug registration '%s' must be a class string or an array declaring a 'class' string."
*/
case REGISTRATION_ENTRY_INVALID
= 'Debug registration \'%s\' must be a class string or an array declaring a \'class\' string.';
/**
* Indicates that a registration key differs from the ID the registered collector or panel declares.
*
* Format: "Debug %s registered as '%s' must match its ID '%s'."
*/
case REGISTRATION_ID_MISMATCH = 'Debug %s registered as \'%s\' must match its ID \'%s\'.';
/**
* Indicates that a route definition field does not satisfy its expected shape.
*
* Format: "Route definition key '%s' must be %s."
*/
case ROUTE_DEFINITION_INVALID = 'Route definition key \'%s\' must be %s.';
/**
* Indicates that a sensitive key pattern is not a valid PCRE pattern.
*
* Format: "Sensitive key pattern "%s" is not a valid PCRE pattern."
*/
case SENSITIVE_KEY_PATTERN_INVALID = 'Sensitive key pattern "%s" is not a valid PCRE pattern.';
/**
* Indicates that a sensitive key prefix is empty.
*
* Format: "Sensitive key prefixes must not be empty."
*/
case SENSITIVE_KEY_PREFIX_EMPTY = 'Sensitive key prefixes must not be empty.';
/**
* Indicates that a sidebar navigation group label is empty.
*
* Format: "Sidebar navigation group labels must not be empty."
*/
case SIDEBAR_GROUP_LABEL_EMPTY = 'Sidebar navigation group labels must not be empty.';
/**
* Indicates that a persisted debug snapshot is empty.
*
* Format: "Debug snapshot is empty: %s"
*/
case SNAPSHOT_EMPTY = 'Debug snapshot is empty: %s';
/**
* Indicates that a debug snapshot cannot be read.
*
* Format: "Unable to read debug snapshot: %s"
*/
case SNAPSHOT_READ_FAILED = 'Unable to read debug snapshot: %s';
/**
* Indicates that a debug snapshot tag is invalid.
*
* Format: "Invalid debug snapshot tag: %s"
*/
case SNAPSHOT_TAG_INVALID = 'Invalid debug snapshot tag: %s';
/**
* Indicates that a snapshot tag does not match its filename.
*
* Format: "Debug snapshot tag does not match its filename: %s"
*/
case SNAPSHOT_TAG_MISMATCH = 'Debug snapshot tag does not match its filename: %s';
/**
* Indicates that a snapshot value violates the expected schema at a payload path.
*
* Format: "Invalid debug snapshot value at '%s': expected %s."
*/
case SNAPSHOT_VALUE_INVALID = 'Invalid debug snapshot value at \'%s\': expected %s.';
/**
* Indicates that a temporary debug data file cannot be written.
*
* Format: "Unable to write temporary debug data file for: %s"
*/
case TEMPORARY_FILE_WRITE_FAILED = 'Unable to write temporary debug data file for: %s';
/**
* Indicates that the storage transaction journal is invalid.
*
* Format: "Invalid debug storage transaction journal: %s"
*/
case TRANSACTION_JOURNAL_INVALID = 'Invalid debug storage transaction journal: %s';
/**
* Formats the message without changing diagnostic argument values.
*
* @param int|string ...$argument Values to insert into the message template.
*
* @return string Formatted exception message.
*/
public function getMessage(int|string ...$argument): string
{
return sprintf($this->value, ...$argument);
}
}