Skip to content

Commit e15de17

Browse files
authored
feat(error): deprecate E_USER_ERROR in PHP 8.4
Refs: #476
1 parent 1f64eb8 commit e15de17

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

.lefthook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pre-commit:
22
parallel: true
33
jobs:
44
- name: fmt
5-
run: rustfmt {staged_files}
5+
run: rustfmt --edition 2021 {staged_files}
66
glob: "*.rs"
77
stage_fixed: true
88
- name: clippy

src/embed/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ mod tests {
287287
#[test]
288288
fn test_eval_bailout() {
289289
Embed::run(|| {
290+
// TODO: For PHP 8.5, this needs to be replaced, as `E_USER_ERROR` is deprecated.
291+
// Currently, this seems to still be the best way to trigger a bailout.
290292
let result = Embed::eval("trigger_error(\"Fatal error\", E_USER_ERROR);");
291293

292294
assert!(result.is_err());

src/flags.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ bitflags! {
308308
/// Compile warning
309309
const CompileWarning = E_COMPILE_WARNING;
310310
/// User error
311+
#[cfg_attr(php84, deprecated = "`E_USER_ERROR` is deprecated since PHP 8.4. Throw an exception instead.")]
311312
const UserError = E_USER_ERROR;
312313
/// User warning
313314
const UserWarning = E_USER_WARNING;

0 commit comments

Comments
 (0)