aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-symfony-console/src/helper
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe-symfony-console/src/helper')
-rw-r--r--crates/shirabe-symfony-console/src/helper/helper.rs10
-rw-r--r--crates/shirabe-symfony-console/src/helper/progress_bar.rs4
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/shirabe-symfony-console/src/helper/helper.rs b/crates/shirabe-symfony-console/src/helper/helper.rs
index 4f0447f3..21f20d34 100644
--- a/crates/shirabe-symfony-console/src/helper/helper.rs
+++ b/crates/shirabe-symfony-console/src/helper/helper.rs
@@ -2,7 +2,7 @@
use crate::formatter::OutputFormatterInterface;
use crate::helper::HelperSet;
-use shirabe_php_shim::php_regex;
+use shirabe_php_shim::{php_regex, preg_match, preg_replace};
use shirabe_symfony_string::unicode_string::UnicodeString;
/// Helper is the base class for all helper classes.
@@ -40,7 +40,7 @@ impl Helper {
/// Returns the width of a string, using mb_strwidth if it is available.
/// The width is how many characters positions the string will use.
pub fn width(string: &str) -> i64 {
- if shirabe_php_shim::preg_match(php_regex!("//u"), string, &mut Vec::new()) {
+ if preg_match(php_regex!("//u"), string, &mut Vec::new()) {
return UnicodeString::new(string).width(false);
}
@@ -56,7 +56,7 @@ impl Helper {
/// Returns the length of a string, using mb_strlen if it is available.
/// The length is related to how many bytes the string will use.
pub fn length(string: &str) -> i64 {
- if shirabe_php_shim::preg_match(php_regex!("//u"), string, &mut Vec::new()) {
+ if preg_match(php_regex!("//u"), string, &mut Vec::new()) {
return UnicodeString::new(string).length();
}
@@ -148,9 +148,9 @@ impl Helper {
// remove <...> formatting
let string = formatter.format(Some(string)).unwrap().unwrap_or_default();
// remove already formatted characters
- let string = shirabe_php_shim::preg_replace(php_regex!("/\u{1b}\\[[^m]*m/"), "", &string);
+ let string = preg_replace(php_regex!("/\u{1b}\\[[^m]*m/"), "", &string);
// remove terminal hyperlinks
- let string = shirabe_php_shim::preg_replace(
+ let string = preg_replace(
php_regex!("/\u{1b}]8;[^;]*;[^\u{1b}]*\u{1b}\\\\/"),
"",
&string,
diff --git a/crates/shirabe-symfony-console/src/helper/progress_bar.rs b/crates/shirabe-symfony-console/src/helper/progress_bar.rs
index dea1c3ad..1158c507 100644
--- a/crates/shirabe-symfony-console/src/helper/progress_bar.rs
+++ b/crates/shirabe-symfony-console/src/helper/progress_bar.rs
@@ -9,7 +9,7 @@ use crate::output::OutputInterface;
use crate::output::output_interface;
use crate::terminal::Terminal;
use indexmap::IndexMap;
-use shirabe_php_shim::CaptureKey;
+use shirabe_php_shim::{CaptureKey, preg_replace_callback};
pub const FORMAT_VERBOSE: &str = "verbose";
pub const FORMAT_VERY_VERBOSE: &str = "very_verbose";
@@ -831,6 +831,6 @@ impl ProgressBar {
})
};
- shirabe_php_shim::preg_replace_callback(regex, callback, &format)
+ preg_replace_callback(regex, callback, &format)
}
}