diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-18 01:57:02 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-18 01:57:02 +0900 |
| commit | fed0a6e7ac361af9b963c1f62411b1a85478230c (patch) | |
| tree | 5cde64a24845c761890fbcbe05e0d702f1ec8df7 /crates/shirabe/src/autoload | |
| parent | e093b2be1c333e67c96aebb0a5291bea9ae3d6db (diff) | |
| download | php-shirabe-fed0a6e7ac361af9b963c1f62411b1a85478230c.tar.gz php-shirabe-fed0a6e7ac361af9b963c1f62411b1a85478230c.tar.zst php-shirabe-fed0a6e7ac361af9b963c1f62411b1a85478230c.zip | |
refactor(preg): add preg_is_match for existence-only call sites
The capture groups were discarded at 162 of the preg_match call sites,
which only tested the Option. They now call preg_is_match, which lets the
regex engine skip capture tracking.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/autoload')
| -rw-r--r-- | crates/shirabe/src/autoload/autoload_generator.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/shirabe/src/autoload/autoload_generator.rs b/crates/shirabe/src/autoload/autoload_generator.rs index d5e1fcba..5f435566 100644 --- a/crates/shirabe/src/autoload/autoload_generator.rs +++ b/crates/shirabe/src/autoload/autoload_generator.rs @@ -26,9 +26,9 @@ use shirabe_class_map_generator::class_map_generator::ClassMapGenerator; use shirabe_php_shim::{ InvalidArgumentException, PhpMixed, PregMatches, array_keys, array_map, array_merge_map, array_merge_recursive, array_shift, array_slice_strs, array_unique, bin2hex, explode, - file_exists, file_get_contents, hash, implode, is_array, ksort, ltrim, php_regex, preg_match, - preg_quote, preg_replace, preg_replace_callback, random_bytes, realpath, str_replace, strlen, - strpos, strtr, substr, substr_count, trim, unlink, var_export, + file_exists, file_get_contents, hash, implode, is_array, ksort, ltrim, php_regex, + preg_is_match, preg_match, preg_quote, preg_replace, preg_replace_callback, random_bytes, + realpath, str_replace, strlen, strpos, strtr, substr, substr_count, trim, unlink, var_export, }; use shirabe_semver::constraint::Bound; use shirabe_symfony_console::formatter::OutputFormatter; @@ -1126,7 +1126,7 @@ return array( } } - if preg_match(php_regex!("{\\.phar([\\\\/]|$)}"), &path).is_some() { + if preg_is_match(php_regex!("{\\.phar([\\\\/]|$)}"), &path) { base_dir = format!("'phar://' . {}", base_dir); } |
