aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-symfony-console/src/helper/helper.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe-symfony-console/src/helper/helper.rs')
-rw-r--r--crates/shirabe-symfony-console/src/helper/helper.rs10
1 files changed, 5 insertions, 5 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,