aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/silencer.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-17 02:53:53 +0900
committernsfisis <nsfisis@gmail.com>2026-05-17 02:53:53 +0900
commita1c7e6908a26e10f6e1f23a51721664b5e2d838d (patch)
treec575c76f1b43359ed74913da4c6a2636643f1ba0 /crates/shirabe/src/util/silencer.rs
parent7f606f36fef0c0467c3c0db3d0da33af486dae8a (diff)
downloadphp-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.gz
php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.tar.zst
php-shirabe-a1c7e6908a26e10f6e1f23a51721664b5e2d838d.zip
chore(style): cargo fmt
Diffstat (limited to 'crates/shirabe/src/util/silencer.rs')
-rw-r--r--crates/shirabe/src/util/silencer.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/shirabe/src/util/silencer.rs b/crates/shirabe/src/util/silencer.rs
index 39ec1db..f5ee64d 100644
--- a/crates/shirabe/src/util/silencer.rs
+++ b/crates/shirabe/src/util/silencer.rs
@@ -1,11 +1,11 @@
//! ref: composer/src/Composer/Util/Silencer.php
-use std::sync::Mutex;
use anyhow::Result;
use shirabe_php_shim::{
+ E_DEPRECATED, E_NOTICE, E_USER_DEPRECATED, E_USER_NOTICE, E_USER_WARNING, E_WARNING,
error_reporting,
- E_WARNING, E_NOTICE, E_USER_WARNING, E_USER_NOTICE, E_DEPRECATED, E_USER_DEPRECATED,
};
+use std::sync::Mutex;
static STACK: Mutex<Vec<i64>> = Mutex::new(Vec::new());
@@ -13,7 +13,14 @@ pub struct Silencer;
impl Silencer {
pub fn suppress(mask: Option<i64>) -> i64 {
- let mask = mask.unwrap_or(E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED);
+ let mask = mask.unwrap_or(
+ E_WARNING
+ | E_NOTICE
+ | E_USER_WARNING
+ | E_USER_NOTICE
+ | E_DEPRECATED
+ | E_USER_DEPRECATED,
+ );
let old = error_reporting(None);
STACK.lock().unwrap().push(old);
error_reporting(Some(old & !mask));