aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/no_proxy_pattern.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-17 04:18:59 +0900
committernsfisis <nsfisis@gmail.com>2026-08-17 04:18:59 +0900
commit704ba2d87733657dea852fa697fc6d23a961a71b (patch)
treefd96f0fb4c2fb334a6480088a4c542bd60603f65 /crates/shirabe/src/util/no_proxy_pattern.rs
parentdc0cc70f6916810f326d6019a4bec90ca2915904 (diff)
downloadphp-shirabe-704ba2d87733657dea852fa697fc6d23a961a71b.tar.gz
php-shirabe-704ba2d87733657dea852fa697fc6d23a961a71b.tar.zst
php-shirabe-704ba2d87733657dea852fa697fc6d23a961a71b.zip
refactor(preg): replace Preg::split*() with shim preg_split*()
preg_split2()'s limit was always -1 and its flags were always either 0 or PREG_SPLIT_DELIM_CAPTURE alone, so both arguments are gone: the shim now exposes preg_split() and preg_split_delim_capture() over a shared preg_split_impl(). That leaves Preg::split()/split4() as bare pass-throughs, so callers use the shim functions directly and the wrappers are dropped along with the now-unreferenced PREG_SPLIT_* constants. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/no_proxy_pattern.rs')
-rw-r--r--crates/shirabe/src/util/no_proxy_pattern.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/shirabe/src/util/no_proxy_pattern.rs b/crates/shirabe/src/util/no_proxy_pattern.rs
index 85e1f472..cd54fa1a 100644
--- a/crates/shirabe/src/util/no_proxy_pattern.rs
+++ b/crates/shirabe/src/util/no_proxy_pattern.rs
@@ -1,10 +1,10 @@
//! ref: composer/src/Composer/Util/NoProxyPattern.php
use indexmap::IndexMap;
-use shirabe_pcre::Preg;
use shirabe_php_shim::{
RuntimeException, array_key_exists, explode, filter_var_int_with_range, filter_var_ip,
- inet_pton, ltrim, parse_url, php_regex, stripos, strlen, strpbrk, strpos, substr, substr_count,
+ inet_pton, ltrim, parse_url, php_regex, preg_split, stripos, strlen, strpbrk, strpos, substr,
+ substr_count,
};
/// Tests URLs against NO_PROXY patterns
@@ -37,7 +37,7 @@ impl NoProxyPattern {
/// @param string $pattern NO_PROXY pattern
pub fn new(pattern: &str) -> Self {
// PHP: Preg::split('{[\s,]+}', $pattern, -1, PREG_SPLIT_NO_EMPTY)
- let host_names = Preg::split(php_regex!(r"{[\s,]+}"), pattern);
+ let host_names = preg_split(php_regex!(r"{[\s,]+}"), pattern);
let noproxy = host_names.is_empty() || host_names[0] == "*";
Self {
host_names,