diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-11 23:28:40 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-11 23:28:40 +0900 |
| commit | 38621c67917fd015f884ea04517791cdc5058c6d (patch) | |
| tree | 03f466e2db22a3bc45e20e4f9694eb371a59b0e1 /crates/shirabe/src/dependency_resolver/problem.rs | |
| parent | 73ab00d3108933c952844b3820f44230c8203807 (diff) | |
| download | php-shirabe-38621c67917fd015f884ea04517791cdc5058c6d.tar.gz php-shirabe-38621c67917fd015f884ea04517791cdc5058c6d.tar.zst php-shirabe-38621c67917fd015f884ea04517791cdc5058c6d.zip | |
chore(php-shim): drop the substring predicate ports
str_contains(), str_starts_with() and str_ends_with() were thin wrappers
over the str methods of the same semantics. Call sites now use
contains()/starts_with()/ends_with() directly.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/dependency_resolver/problem.rs')
| -rw-r--r-- | crates/shirabe/src/dependency_resolver/problem.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/shirabe/src/dependency_resolver/problem.rs b/crates/shirabe/src/dependency_resolver/problem.rs index 9ca4569c..4510b125 100644 --- a/crates/shirabe/src/dependency_resolver/problem.rs +++ b/crates/shirabe/src/dependency_resolver/problem.rs @@ -13,8 +13,8 @@ use indexmap::IndexMap; use shirabe_pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ CmpOp, LogicException, PhpMixed, defined, extension_loaded, implode, loosely_compare, - php_regex, spl_object_hash, sprintf, str_replace, str_starts_with, stripos, strpos, strtolower, - substr, substr_count, version_compare, + php_regex, spl_object_hash, sprintf, str_replace, stripos, strpos, strtolower, substr, + substr_count, version_compare, }; use shirabe_semver::constraint::AnyConstraint; use shirabe_semver::constraint::MultiConstraint; @@ -806,7 +806,7 @@ impl Problem { ); } - if str_starts_with(advisory_id, "PKSA-") { + if advisory_id.starts_with("PKSA-") { return format!( "<href={}>{}</>", OutputFormatter::escape(&format!( @@ -828,7 +828,7 @@ impl Problem { ) .into_iter() .map(|advisory_id: String| { - if str_starts_with(&advisory_id, "PKSA-") { + if advisory_id.starts_with("PKSA-") { return format!( "<href={}>{}</>", OutputFormatter::escape(&format!( @@ -1384,7 +1384,7 @@ impl Problem { if let Some(c) = constraint && c.is_constraint() && c.get_operator() == Some(CmpOp::Eq) - && !str_starts_with(c.get_version(), "dev-") + && !c.get_version().starts_with("dev-") { if !Preg::is_match3( php_regex!(r"{^\d+(?:\.\d+)*$}"), |
