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-symfony-console/src/helper | |
| 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-symfony-console/src/helper')
| -rw-r--r-- | crates/shirabe-symfony-console/src/helper/question_helper.rs | 9 | ||||
| -rw-r--r-- | crates/shirabe-symfony-console/src/helper/table.rs | 4 |
2 files changed, 5 insertions, 8 deletions
diff --git a/crates/shirabe-symfony-console/src/helper/question_helper.rs b/crates/shirabe-symfony-console/src/helper/question_helper.rs index 662edf40..c051fff2 100644 --- a/crates/shirabe-symfony-console/src/helper/question_helper.rs +++ b/crates/shirabe-symfony-console/src/helper/question_helper.rs @@ -557,10 +557,7 @@ impl QuestionHelper { .into_iter() .filter(|m| { ret_for_filter.is_empty() - || shirabe_php_shim::str_starts_with( - &m.to_string(), - &ret_for_filter, - ) + || m.to_string().starts_with(&ret_for_filter) }) .collect(); ofs = -1; @@ -616,7 +613,7 @@ impl QuestionHelper { for value in autocomplete(&ret) { // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if shirabe_php_shim::str_starts_with(&value.to_string(), &temp_ret) { + if value.to_string().starts_with(&temp_ret) { if (num_matches as usize) < matches.len() { matches[num_matches as usize] = value; } else { @@ -660,7 +657,7 @@ impl QuestionHelper { fn most_recently_entered_value(&self, entered: &str) -> String { // Determine the most recent value that the user entered - if !shirabe_php_shim::str_contains(entered, ",") { + if !entered.contains(',') { return entered.to_string(); } diff --git a/crates/shirabe-symfony-console/src/helper/table.rs b/crates/shirabe-symfony-console/src/helper/table.rs index 177e23c0..06743dbf 100644 --- a/crates/shirabe-symfony-console/src/helper/table.rs +++ b/crates/shirabe-symfony-console/src/helper/table.rs @@ -745,7 +745,7 @@ impl Table { if shirabe_php_shim::strstr(&cell_str, "\n").is_none() { continue; } - let eol = if shirabe_php_shim::str_contains(&cell_str, "\r\n") { + let eol = if cell_str.contains("\r\n") { "\r\n" } else { "\n" @@ -846,7 +846,7 @@ impl Table { let cell_str = cell.to_php_string(); let mut lines = vec![cell.clone()]; if shirabe_php_shim::strstr(&cell_str, "\n").is_some() { - let eol = if shirabe_php_shim::str_contains(&cell_str, "\r\n") { + let eol = if cell_str.contains("\r\n") { "\r\n" } else { "\n" |
