diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 15:08:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 15:08:03 +0900 |
| commit | 748e741f740ac46ec40e42679aba3b07927709c0 (patch) | |
| tree | 31f01831b11613631ba68da047abf1a9aa43f1b0 | |
| parent | 79bcd3a9ce71954ce7b257e5f3ca1c147c0d974a (diff) | |
| download | php-shirabe-748e741f740ac46ec40e42679aba3b07927709c0.tar.gz php-shirabe-748e741f740ac46ec40e42679aba3b07927709c0.tar.zst php-shirabe-748e741f740ac46ec40e42679aba3b07927709c0.zip | |
chore: cargo clippy --fix
72 files changed, 983 insertions, 914 deletions
diff --git a/crates/shirabe-class-map-generator/src/class_map.rs b/crates/shirabe-class-map-generator/src/class_map.rs index 311924b..c397c5c 100644 --- a/crates/shirabe-class-map-generator/src/class_map.rs +++ b/crates/shirabe-class-map-generator/src/class_map.rs @@ -2,9 +2,7 @@ use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::preg::Preg; -use shirabe_php_shim::{ - Countable, InvalidArgumentException, OutOfBoundsException, rtrim, strpos, strtr, -}; +use shirabe_php_shim::{Countable, OutOfBoundsException, rtrim, strpos, strtr}; #[derive(Debug, Clone)] pub struct PsrViolationEntry { @@ -19,6 +17,12 @@ pub struct ClassMap { psr_violations: IndexMap<String, Vec<PsrViolationEntry>>, } +impl Default for ClassMap { + fn default() -> Self { + Self::new() + } +} + impl ClassMap { pub fn new() -> Self { ClassMap { diff --git a/crates/shirabe-class-map-generator/src/class_map_generator.rs b/crates/shirabe-class-map-generator/src/class_map_generator.rs index 608dccb..733915e 100644 --- a/crates/shirabe-class-map-generator/src/class_map_generator.rs +++ b/crates/shirabe-class-map-generator/src/class_map_generator.rs @@ -200,10 +200,10 @@ impl ClassMapGenerator { // if a list of scanned files is given, avoid scanning twice the same file to save cycles and avoid generating warnings // in case a PSR-0/4 declaration follows another more specific one, or a classmap declaration, which covered this file already - if let Some(ref scanned_files) = self.scanned_files { - if scanned_files.contains(&real_path) { - continue; - } + if let Some(ref scanned_files) = self.scanned_files + && scanned_files.contains(&real_path) + { + continue; } // check the realpath of the file against the excluded paths as the path might be a symlink and the excluded path is realpath'd so symlink are resolved @@ -228,10 +228,10 @@ impl ClassMapGenerator { )?; // if no valid class was found in the file then we do not mark it as scanned as it might still be matched by another rule later - if !filtered.is_empty() { - if let Some(ref mut scanned_files) = self.scanned_files { - scanned_files.add(real_path); - } + if !filtered.is_empty() + && let Some(ref mut scanned_files) = self.scanned_files + { + scanned_files.add(real_path); } filtered diff --git a/crates/shirabe-class-map-generator/src/file_list.rs b/crates/shirabe-class-map-generator/src/file_list.rs index 0813f2c..8f0f00f 100644 --- a/crates/shirabe-class-map-generator/src/file_list.rs +++ b/crates/shirabe-class-map-generator/src/file_list.rs @@ -8,6 +8,12 @@ pub struct FileList { pub files: IndexMap<String, bool>, } +impl Default for FileList { + fn default() -> Self { + Self::new() + } +} + impl FileList { pub fn new() -> Self { FileList { diff --git a/crates/shirabe-class-map-generator/src/php_file_cleaner.rs b/crates/shirabe-class-map-generator/src/php_file_cleaner.rs index ec59414..98c8b1d 100644 --- a/crates/shirabe-class-map-generator/src/php_file_cleaner.rs +++ b/crates/shirabe-class-map-generator/src/php_file_cleaner.rs @@ -120,7 +120,7 @@ impl PhpFileCleaner { }; if let Some(entry) = type_entry { let end = self.index + entry.length; - if end <= self.len && &self.contents[self.index..end] == entry.name { + if end <= self.len && self.contents[self.index..end] == entry.name { let offset = if self.index > 0 { self.index - 1 } else { 0 }; let mut r#match: IndexMap<CaptureKey, String> = IndexMap::new(); if Preg::is_match5( diff --git a/crates/shirabe-class-map-generator/src/php_file_parser.rs b/crates/shirabe-class-map-generator/src/php_file_parser.rs index d87db82..95b2997 100644 --- a/crates/shirabe-class-map-generator/src/php_file_parser.rs +++ b/crates/shirabe-class-map-generator/src/php_file_parser.rs @@ -45,17 +45,17 @@ impl PhpFileParser { message, &[shirabe_php_shim::PhpMixed::String(path.to_string())], ); - if let Some(error) = error { - if let Some(err_msg) = error.get("message") { - message = format!( - "{}{}{}{}{}", - message, - PHP_EOL, - "The following message may be helpful:", - PHP_EOL, - err_msg.as_string().unwrap_or("") - ); - } + if let Some(error) = error + && let Some(err_msg) = error.get("message") + { + message = format!( + "{}{}{}{}{}", + message, + PHP_EOL, + "The following message may be helpful:", + PHP_EOL, + err_msg.as_string().unwrap_or("") + ); } return Err(anyhow!(RuntimeException { message, code: 0 })); diff --git a/crates/shirabe-external-packages/src/composer/ca_bundle/ca_bundle.rs b/crates/shirabe-external-packages/src/composer/ca_bundle/ca_bundle.rs index 4a980c6..a0db297 100644 --- a/crates/shirabe-external-packages/src/composer/ca_bundle/ca_bundle.rs +++ b/crates/shirabe-external-packages/src/composer/ca_bundle/ca_bundle.rs @@ -8,11 +8,11 @@ impl CaBundle { todo!() } - pub fn get_system_ca_root_bundle_path(logger: Option<&dyn LoggerInterface>) -> String { + pub fn get_system_ca_root_bundle_path(_logger: Option<&dyn LoggerInterface>) -> String { todo!() } - pub fn validate_ca_file(ca_file: &str, logger: Option<&dyn LoggerInterface>) -> bool { + pub fn validate_ca_file(_ca_file: &str, _logger: Option<&dyn LoggerInterface>) -> bool { todo!() } diff --git a/crates/shirabe-external-packages/src/composer/metadata_minifier/metadata_minifier.rs b/crates/shirabe-external-packages/src/composer/metadata_minifier/metadata_minifier.rs index f886197..8861936 100644 --- a/crates/shirabe-external-packages/src/composer/metadata_minifier/metadata_minifier.rs +++ b/crates/shirabe-external-packages/src/composer/metadata_minifier/metadata_minifier.rs @@ -5,11 +5,11 @@ use shirabe_php_shim::PhpMixed; pub struct MetadataMinifier; impl MetadataMinifier { - pub fn expand(minified_data: IndexMap<String, PhpMixed>) -> IndexMap<String, PhpMixed> { + pub fn expand(_minified_data: IndexMap<String, PhpMixed>) -> IndexMap<String, PhpMixed> { todo!() } - pub fn minify(packages: IndexMap<String, PhpMixed>) -> IndexMap<String, PhpMixed> { + pub fn minify(_packages: IndexMap<String, PhpMixed>) -> IndexMap<String, PhpMixed> { todo!() } } diff --git a/crates/shirabe-external-packages/src/composer/pcre/preg.rs b/crates/shirabe-external-packages/src/composer/pcre/preg.rs index 3dd8b4f..9c39d42 100644 --- a/crates/shirabe-external-packages/src/composer/pcre/preg.rs +++ b/crates/shirabe-external-packages/src/composer/pcre/preg.rs @@ -2,518 +2,518 @@ pub struct Preg; impl Preg { - pub fn r#match(pattern: &str, subject: &str) -> anyhow::Result<bool> { + pub fn r#match(_pattern: &str, _subject: &str) -> anyhow::Result<bool> { todo!() } pub fn match3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, ) -> anyhow::Result<bool> { todo!() } pub fn match4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _flags: i64, ) -> anyhow::Result<bool> { todo!() } pub fn match5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<bool> { todo!() } - pub fn match_strict_groups(pattern: &str, subject: &str) -> anyhow::Result<bool> { + pub fn match_strict_groups(_pattern: &str, _subject: &str) -> anyhow::Result<bool> { todo!() } pub fn match_strict_groups3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, ) -> anyhow::Result<bool> { todo!() } pub fn match_strict_groups4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _flags: i64, ) -> anyhow::Result<bool> { todo!() } pub fn match_strict_groups5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<bool> { todo!() } - pub fn match_with_offsets(pattern: &str, subject: &str) -> anyhow::Result<bool> { + pub fn match_with_offsets(_pattern: &str, _subject: &str) -> anyhow::Result<bool> { todo!() } pub fn match_with_offsets3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, ) -> anyhow::Result<bool> { todo!() } pub fn match_with_offsets4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, + _flags: i64, ) -> anyhow::Result<bool> { todo!() } pub fn match_with_offsets5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<bool> { todo!() } - pub fn match_all(pattern: &str, subject: &str) -> anyhow::Result<usize> { + pub fn match_all(_pattern: &str, _subject: &str) -> anyhow::Result<usize> { todo!() } pub fn match_all3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, ) -> anyhow::Result<usize> { todo!() } pub fn match_all4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _flags: i64, ) -> anyhow::Result<usize> { todo!() } pub fn match_all5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<usize> { todo!() } - pub fn match_all_strict_groups(pattern: &str, subject: &str) -> anyhow::Result<usize> { + pub fn match_all_strict_groups(_pattern: &str, _subject: &str) -> anyhow::Result<usize> { todo!() } pub fn match_all_strict_groups3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, ) -> anyhow::Result<usize> { todo!() } pub fn match_all_strict_groups4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _flags: i64, ) -> anyhow::Result<usize> { todo!() } pub fn match_all_strict_groups5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<usize> { todo!() } - pub fn match_all_with_offsets(pattern: &str, subject: &str) -> anyhow::Result<usize> { + pub fn match_all_with_offsets(_pattern: &str, _subject: &str) -> anyhow::Result<usize> { todo!() } pub fn match_all_with_offsets3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, ) -> anyhow::Result<usize> { todo!() } pub fn match_all_with_offsets4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, + _flags: i64, ) -> anyhow::Result<usize> { todo!() } pub fn match_all_with_offsets5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<usize> { todo!() } - pub fn replace(pattern: &str, replacement: &str, subject: &str) -> anyhow::Result<String> { + pub fn replace(_pattern: &str, _replacement: &str, _subject: &str) -> anyhow::Result<String> { todo!() } pub fn replace4( - pattern: &str, - replacement: &str, - subject: &str, - limit: i64, + _pattern: &str, + _replacement: &str, + _subject: &str, + _limit: i64, ) -> anyhow::Result<String> { todo!() } pub fn replace5( - pattern: &str, - replacement: &str, - subject: &str, - limit: i64, - count: &mut usize, + _pattern: &str, + _replacement: &str, + _subject: &str, + _limit: i64, + _count: &mut usize, ) -> anyhow::Result<String> { todo!() } pub fn replace_callback<F: Fn(&indexmap::IndexMap<CaptureKey, String>) -> String>( - pattern: &str, - replacement: F, - subject: &str, + _pattern: &str, + _replacement: F, + _subject: &str, ) -> anyhow::Result<String> { todo!() } pub fn replace_callback4<F: Fn(&indexmap::IndexMap<CaptureKey, String>) -> String>( - pattern: &str, - replacement: F, - subject: &str, - limit: i64, + _pattern: &str, + _replacement: F, + _subject: &str, + _limit: i64, ) -> anyhow::Result<String> { todo!() } pub fn replace_callback5<F: Fn(&indexmap::IndexMap<CaptureKey, String>) -> String>( - pattern: &str, - replacement: F, - subject: &str, - limit: i64, - count: &mut usize, + _pattern: &str, + _replacement: F, + _subject: &str, + _limit: i64, + _count: &mut usize, ) -> anyhow::Result<String> { todo!() } pub fn replace_callback6<F: Fn(&indexmap::IndexMap<CaptureKey, String>) -> String>( - pattern: &str, - replacement: F, - subject: &str, - limit: i64, - count: Option<&mut usize>, - flags: i64, + _pattern: &str, + _replacement: F, + _subject: &str, + _limit: i64, + _count: Option<&mut usize>, + _flags: i64, ) -> anyhow::Result<String> { todo!() } pub fn replace_callback_array( - pattern: &indexmap::IndexMap<String, String>, - subject: &str, + _pattern: &indexmap::IndexMap<String, String>, + _subject: &str, ) -> anyhow::Result<String> { todo!() } pub fn replace_callback_array3( - pattern: &indexmap::IndexMap<String, String>, - subject: &str, - limit: i64, + _pattern: &indexmap::IndexMap<String, String>, + _subject: &str, + _limit: i64, ) -> anyhow::Result<String> { todo!() } pub fn replace_callback_array4( - pattern: &indexmap::IndexMap<String, String>, - subject: &str, - limit: i64, - count: &mut usize, + _pattern: &indexmap::IndexMap<String, String>, + _subject: &str, + _limit: i64, + _count: &mut usize, ) -> anyhow::Result<String> { todo!() } pub fn replace_callback_array5( - pattern: &indexmap::IndexMap<String, String>, - subject: &str, - limit: i64, - count: Option<&mut usize>, - flags: i64, + _pattern: &indexmap::IndexMap<String, String>, + _subject: &str, + _limit: i64, + _count: Option<&mut usize>, + _flags: i64, ) -> anyhow::Result<String> { todo!() } - pub fn split(pattern: &str, subject: &str) -> anyhow::Result<Vec<String>> { + pub fn split(_pattern: &str, _subject: &str) -> anyhow::Result<Vec<String>> { todo!() } - pub fn split3(pattern: &str, subject: &str, limit: i64) -> anyhow::Result<Vec<String>> { + pub fn split3(_pattern: &str, _subject: &str, _limit: i64) -> anyhow::Result<Vec<String>> { todo!() } pub fn split4( - pattern: &str, - subject: &str, - limit: i64, - flags: i64, + _pattern: &str, + _subject: &str, + _limit: i64, + _flags: i64, ) -> anyhow::Result<Vec<String>> { todo!() } pub fn split_with_offsets( - pattern: &str, - subject: &str, + _pattern: &str, + _subject: &str, ) -> anyhow::Result<Vec<(String, usize)>> { todo!() } pub fn split_with_offsets3( - pattern: &str, - subject: &str, - limit: i64, + _pattern: &str, + _subject: &str, + _limit: i64, ) -> anyhow::Result<Vec<(String, usize)>> { todo!() } pub fn split_with_offsets4( - pattern: &str, - subject: &str, - limit: i64, - flags: i64, + _pattern: &str, + _subject: &str, + _limit: i64, + _flags: i64, ) -> anyhow::Result<Vec<(String, usize)>> { todo!() } - pub fn grep(pattern: &str, array: &[&str]) -> anyhow::Result<Vec<String>> { + pub fn grep(_pattern: &str, _array: &[&str]) -> anyhow::Result<Vec<String>> { todo!() } - pub fn grep3(pattern: &str, array: &[&str], flags: i64) -> anyhow::Result<Vec<String>> { + pub fn grep3(_pattern: &str, _array: &[&str], _flags: i64) -> anyhow::Result<Vec<String>> { todo!() } - pub fn is_match(pattern: &str, subject: &str) -> anyhow::Result<bool> { + pub fn is_match(_pattern: &str, _subject: &str) -> anyhow::Result<bool> { todo!() } pub fn is_match3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, ) -> anyhow::Result<bool> { todo!() } pub fn is_match4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _flags: i64, ) -> anyhow::Result<bool> { todo!() } pub fn is_match5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<bool> { todo!() } - pub fn is_match_strict_groups(pattern: &str, subject: &str) -> anyhow::Result<bool> { + pub fn is_match_strict_groups(_pattern: &str, _subject: &str) -> anyhow::Result<bool> { todo!() } pub fn is_match_strict_groups3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_strict_groups4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _flags: i64, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_strict_groups5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, String>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<bool> { todo!() } - pub fn is_match_with_offsets(pattern: &str, subject: &str) -> anyhow::Result<bool> { + pub fn is_match_with_offsets(_pattern: &str, _subject: &str) -> anyhow::Result<bool> { todo!() } pub fn is_match_with_offsets3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_with_offsets4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, + _flags: i64, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_with_offsets5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, (String, usize)>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<bool> { todo!() } - pub fn is_match_all(pattern: &str, subject: &str) -> anyhow::Result<bool> { + pub fn is_match_all(_pattern: &str, _subject: &str) -> anyhow::Result<bool> { todo!() } pub fn is_match_all3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_all4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _flags: i64, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_all5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<bool> { todo!() } - pub fn is_match_all_strict_groups(pattern: &str, subject: &str) -> anyhow::Result<bool> { + pub fn is_match_all_strict_groups(_pattern: &str, _subject: &str) -> anyhow::Result<bool> { todo!() } pub fn is_match_all_strict_groups3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_all_strict_groups4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _flags: i64, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_all_strict_groups5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<String>>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<bool> { todo!() } - pub fn is_match_all_with_offsets(pattern: &str, subject: &str) -> anyhow::Result<bool> { + pub fn is_match_all_with_offsets(_pattern: &str, _subject: &str) -> anyhow::Result<bool> { todo!() } pub fn is_match_all_with_offsets3( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_all_with_offsets4( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, - flags: i64, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, + _flags: i64, ) -> anyhow::Result<bool> { todo!() } pub fn is_match_all_with_offsets5( - pattern: &str, - subject: &str, - matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, - flags: i64, - offset: usize, + _pattern: &str, + _subject: &str, + _matches: Option<&mut indexmap::IndexMap<CaptureKey, Vec<(String, usize)>>>, + _flags: i64, + _offset: usize, ) -> anyhow::Result<bool> { todo!() } diff --git a/crates/shirabe-external-packages/src/composer/semver/compiling_matcher.rs b/crates/shirabe-external-packages/src/composer/semver/compiling_matcher.rs index dea5475..5a8f09d 100644 --- a/crates/shirabe-external-packages/src/composer/semver/compiling_matcher.rs +++ b/crates/shirabe-external-packages/src/composer/semver/compiling_matcher.rs @@ -1,18 +1,16 @@ -use shirabe_php_shim::PhpMixed; - #[derive(Debug)] pub struct CompilingMatcher; impl CompilingMatcher { - pub fn r#match(constraint: &dyn std::any::Any, package: &dyn std::any::Any) -> bool { + pub fn r#match(_constraint: &dyn std::any::Any, _package: &dyn std::any::Any) -> bool { todo!() } - pub fn matches(constraint: &dyn std::any::Any, operator: &str, version: &str) -> bool { + pub fn matches(_constraint: &dyn std::any::Any, _operator: &str, _version: &str) -> bool { todo!() } - pub fn match_(constraint: &dyn std::any::Any, operator: &str, version: &str) -> bool { + pub fn match_(_constraint: &dyn std::any::Any, _operator: &str, _version: &str) -> bool { todo!() } diff --git a/crates/shirabe-external-packages/src/composer/semver/intervals.rs b/crates/shirabe-external-packages/src/composer/semver/intervals.rs index 957436d..d0a736c 100644 --- a/crates/shirabe-external-packages/src/composer/semver/intervals.rs +++ b/crates/shirabe-external-packages/src/composer/semver/intervals.rs @@ -5,21 +5,21 @@ pub struct Intervals; impl Intervals { pub fn is_subset_of( - constraint_a: &dyn std::any::Any, - constraint_b: &dyn std::any::Any, + _constraint_a: &dyn std::any::Any, + _constraint_b: &dyn std::any::Any, ) -> anyhow::Result<bool> { todo!() } - pub fn compact_constraint(constraint: &dyn std::any::Any) -> Box<dyn std::any::Any> { + pub fn compact_constraint(_constraint: &dyn std::any::Any) -> Box<dyn std::any::Any> { todo!() } - pub fn compact(constraint: &dyn std::any::Any) -> Box<dyn std::any::Any> { + pub fn compact(_constraint: &dyn std::any::Any) -> Box<dyn std::any::Any> { todo!() } - pub fn get(constraint: &dyn std::any::Any) -> anyhow::Result<PhpMixed> { + pub fn get(_constraint: &dyn std::any::Any) -> anyhow::Result<PhpMixed> { todo!() } diff --git a/crates/shirabe-external-packages/src/composer/semver/semver.rs b/crates/shirabe-external-packages/src/composer/semver/semver.rs index f467c2c..fe370d8 100644 --- a/crates/shirabe-external-packages/src/composer/semver/semver.rs +++ b/crates/shirabe-external-packages/src/composer/semver/semver.rs @@ -2,15 +2,15 @@ pub struct Semver; impl Semver { - pub fn sort(versions: Vec<String>) -> anyhow::Result<Vec<String>> { + pub fn sort(_versions: Vec<String>) -> anyhow::Result<Vec<String>> { todo!() } - pub fn rsort(versions: Vec<String>) -> Vec<String> { + pub fn rsort(_versions: Vec<String>) -> Vec<String> { todo!() } - pub fn satisfies(version: &str, constraint: &str) -> bool { + pub fn satisfies(_version: &str, _constraint: &str) -> bool { todo!() } } diff --git a/crates/shirabe-external-packages/src/composer/spdx_licenses/spdx_licenses.rs b/crates/shirabe-external-packages/src/composer/spdx_licenses/spdx_licenses.rs index 95640c9..684e73b 100644 --- a/crates/shirabe-external-packages/src/composer/spdx_licenses/spdx_licenses.rs +++ b/crates/shirabe-external-packages/src/composer/spdx_licenses/spdx_licenses.rs @@ -3,16 +3,22 @@ use shirabe_php_shim::PhpMixed; #[derive(Debug)] pub struct SpdxLicenses; +impl Default for SpdxLicenses { + fn default() -> Self { + Self::new() + } +} + impl SpdxLicenses { pub fn new() -> Self { todo!() } - pub fn validate(&self, license: &str) -> bool { + pub fn validate(&self, _license: &str) -> bool { todo!() } - pub fn get_license_by_identifier(&self, identifier: &str) -> Option<PhpMixed> { + pub fn get_license_by_identifier(&self, _identifier: &str) -> Option<PhpMixed> { todo!() } diff --git a/crates/shirabe-external-packages/src/composer/util/composer_mirror.rs b/crates/shirabe-external-packages/src/composer/util/composer_mirror.rs index 21d0fdf..66e363c 100644 --- a/crates/shirabe-external-packages/src/composer/util/composer_mirror.rs +++ b/crates/shirabe-external-packages/src/composer/util/composer_mirror.rs @@ -3,21 +3,31 @@ pub struct ComposerMirror; impl ComposerMirror { pub fn process_url( - mirror: &str, - package_name: &str, - version: &str, - reference: Option<&str>, - url: &str, - custom_filename: Option<&str>, + _mirror: &str, + _package_name: &str, + _version: &str, + _reference: Option<&str>, + _url: &str, + _custom_filename: Option<&str>, ) -> String { todo!() } - pub fn process_git_url(mirror: &str, package_name: &str, url: &str, extension: &str) -> String { + pub fn process_git_url( + _mirror: &str, + _package_name: &str, + _url: &str, + _extension: &str, + ) -> String { todo!() } - pub fn process_hg_url(mirror: &str, package_name: &str, url: &str, extension: &str) -> String { + pub fn process_hg_url( + _mirror: &str, + _package_name: &str, + _url: &str, + _extension: &str, + ) -> String { todo!() } } diff --git a/crates/shirabe-external-packages/src/json_schema/validator.rs b/crates/shirabe-external-packages/src/json_schema/validator.rs index aad230b..48d5528 100644 --- a/crates/shirabe-external-packages/src/json_schema/validator.rs +++ b/crates/shirabe-external-packages/src/json_schema/validator.rs @@ -3,12 +3,18 @@ use shirabe_php_shim::PhpMixed; #[derive(Debug)] pub struct Validator; +impl Default for Validator { + fn default() -> Self { + Self::new() + } +} + impl Validator { pub fn new() -> Self { todo!() } - pub fn check(&mut self, data: &PhpMixed, schema: &PhpMixed) -> anyhow::Result<()> { + pub fn check(&mut self, _data: &PhpMixed, _schema: &PhpMixed) -> anyhow::Result<()> { todo!() } diff --git a/crates/shirabe-external-packages/src/psr/log/logger_interface.rs b/crates/shirabe-external-packages/src/psr/log/logger_interface.rs index 730bfe5..1d61db6 100644 --- a/crates/shirabe-external-packages/src/psr/log/logger_interface.rs +++ b/crates/shirabe-external-packages/src/psr/log/logger_interface.rs @@ -1,5 +1,3 @@ -use shirabe_php_shim::PhpMixed; - pub trait LoggerInterface { fn emergency(&self, message: &str, context: &[(&str, &str)]); fn alert(&self, message: &str, context: &[(&str, &str)]); diff --git a/crates/shirabe-external-packages/src/react/promise/mod.rs b/crates/shirabe-external-packages/src/react/promise/mod.rs index 9961b99..146c2f1 100644 --- a/crates/shirabe-external-packages/src/react/promise/mod.rs +++ b/crates/shirabe-external-packages/src/react/promise/mod.rs @@ -4,10 +4,10 @@ pub mod promise_interface; use self::promise::Promise; use shirabe_php_shim::PhpMixed; -pub fn resolve(value: Option<PhpMixed>) -> Promise { +pub fn resolve(_value: Option<PhpMixed>) -> Promise { todo!() } -pub fn all(promises: Vec<Promise>) -> Promise { +pub fn all(_promises: Vec<Promise>) -> Promise { todo!() } diff --git a/crates/shirabe-external-packages/src/react/promise/promise.rs b/crates/shirabe-external-packages/src/react/promise/promise.rs index 756a58a..96fa3ed 100644 --- a/crates/shirabe-external-packages/src/react/promise/promise.rs +++ b/crates/shirabe-external-packages/src/react/promise/promise.rs @@ -5,14 +5,14 @@ pub struct Promise; impl Promise { pub fn new( - resolver: Box< + _resolver: Box< dyn FnOnce(Box<dyn FnOnce(Option<PhpMixed>)>, Box<dyn FnOnce(Option<PhpMixed>)>), >, ) -> Self { todo!() } - pub fn then<F, G>(self, on_fulfilled: Option<F>, on_rejected: Option<G>) -> Self + pub fn then<F, G>(self, _on_fulfilled: Option<F>, _on_rejected: Option<G>) -> Self where F: FnOnce(Option<PhpMixed>) -> Option<PhpMixed>, G: FnOnce(Option<PhpMixed>) -> Option<PhpMixed>, diff --git a/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs b/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs index 6deb13c..31f64df 100644 --- a/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs +++ b/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs @@ -3,6 +3,12 @@ use shirabe_php_shim::PhpMixed; #[derive(Debug)] pub struct JsonParser; +impl Default for JsonParser { + fn default() -> Self { + Self::new() + } +} + impl JsonParser { pub const DETECT_KEY_CONFLICTS: u32 = 1; @@ -10,7 +16,7 @@ impl JsonParser { todo!() } - pub fn parse(&self, json: &str, flags: u32) -> anyhow::Result<PhpMixed> { + pub fn parse(&self, _json: &str, _flags: u32) -> anyhow::Result<PhpMixed> { todo!() } } diff --git a/crates/shirabe-external-packages/src/seld/phar_utils/linter.rs b/crates/shirabe-external-packages/src/seld/phar_utils/linter.rs index d879c7d..27238d3 100644 --- a/crates/shirabe-external-packages/src/seld/phar_utils/linter.rs +++ b/crates/shirabe-external-packages/src/seld/phar_utils/linter.rs @@ -2,7 +2,7 @@ pub struct Linter; impl Linter { - pub fn lint(file: &str, php_versions: &[String]) -> anyhow::Result<()> { + pub fn lint(_file: &str, _php_versions: &[String]) -> anyhow::Result<()> { todo!() } } diff --git a/crates/shirabe-external-packages/src/seld/phar_utils/timestamps.rs b/crates/shirabe-external-packages/src/seld/phar_utils/timestamps.rs index d2e1be9..0a25389 100644 --- a/crates/shirabe-external-packages/src/seld/phar_utils/timestamps.rs +++ b/crates/shirabe-external-packages/src/seld/phar_utils/timestamps.rs @@ -4,15 +4,15 @@ pub struct Timestamps { } impl Timestamps { - pub fn new(file: &str) -> Self { + pub fn new(_file: &str) -> Self { todo!() } - pub fn update_timestamps(&mut self, date: &str) -> anyhow::Result<()> { + pub fn update_timestamps(&mut self, _date: &str) -> anyhow::Result<()> { todo!() } - pub fn save(&self, file: &str, format: i64) -> anyhow::Result<()> { + pub fn save(&self, _file: &str, _format: i64) -> anyhow::Result<()> { todo!() } } diff --git a/crates/shirabe-external-packages/src/seld/signal/signal_handler.rs b/crates/shirabe-external-packages/src/seld/signal/signal_handler.rs index 04aae27..3c53066 100644 --- a/crates/shirabe-external-packages/src/seld/signal/signal_handler.rs +++ b/crates/shirabe-external-packages/src/seld/signal/signal_handler.rs @@ -6,7 +6,7 @@ impl SignalHandler { pub const SIGTERM: &'static str = "SIGTERM"; pub const SIGHUP: &'static str = "SIGHUP"; - pub fn create(signals: Vec<String>, callback: Box<dyn Fn(String, &SignalHandler)>) -> Self { + pub fn create(_signals: Vec<String>, _callback: Box<dyn Fn(String, &SignalHandler)>) -> Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/application.rs b/crates/shirabe-external-packages/src/symfony/component/console/application.rs index f9495bb..bc64521 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/application.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/application.rs @@ -6,19 +6,19 @@ use shirabe_php_shim::PhpMixed; pub struct Application; impl Application { - pub fn new(name: &str, version: &str) -> Self { + pub fn new(_name: &str, _version: &str) -> Self { todo!() } pub fn run( &mut self, - input: Option<&mut dyn InputInterface>, - output: Option<&mut dyn OutputInterface>, + _input: Option<&mut dyn InputInterface>, + _output: Option<&mut dyn OutputInterface>, ) -> anyhow::Result<i64> { todo!() } - pub fn set_name(&mut self, name: &str) { + pub fn set_name(&mut self, _name: &str) { todo!() } @@ -26,7 +26,7 @@ impl Application { todo!() } - pub fn set_version(&mut self, version: &str) { + pub fn set_version(&mut self, _version: &str) { todo!() } @@ -34,19 +34,19 @@ impl Application { todo!() } - pub fn add(&mut self, command: PhpMixed) -> Option<PhpMixed> { + pub fn add(&mut self, _command: PhpMixed) -> Option<PhpMixed> { todo!() } - pub fn get(&self, name: &str) -> anyhow::Result<PhpMixed> { + pub fn get(&self, _name: &str) -> anyhow::Result<PhpMixed> { todo!() } - pub fn set_auto_exit(&mut self, auto_exit: bool) { + pub fn set_auto_exit(&mut self, _auto_exit: bool) { todo!() } - pub fn set_catch_exceptions(&mut self, catch_exceptions: bool) { + pub fn set_catch_exceptions(&mut self, _catch_exceptions: bool) { todo!() } @@ -54,7 +54,7 @@ impl Application { todo!() } - pub fn set_helper_set(&mut self, helper_set: PhpMixed) { + pub fn set_helper_set(&mut self, _helper_set: PhpMixed) { todo!() } @@ -66,11 +66,11 @@ impl Application { todo!() } - pub fn find(&self, name: &str) -> anyhow::Result<PhpMixed> { + pub fn find(&self, _name: &str) -> anyhow::Result<PhpMixed> { todo!() } - pub fn all(&self, namespace: Option<&str>) -> Vec<PhpMixed> { + pub fn all(&self, _namespace: Option<&str>) -> Vec<PhpMixed> { todo!() } @@ -80,8 +80,8 @@ impl Application { pub fn set_default_command( &mut self, - command_name: &str, - is_single_command: bool, + _command_name: &str, + _is_single_command: bool, ) -> &mut Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs b/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs index 3c18be5..34d1941 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/command/command.rs @@ -7,11 +7,11 @@ use shirabe_php_shim::PhpMixed; pub struct Command; impl Command { - pub fn new(name: Option<&str>) -> Self { + pub fn new(_name: Option<&str>) -> Self { todo!() } - pub fn set_name(&mut self, name: &str) -> &mut Self { + pub fn set_name(&mut self, _name: &str) -> &mut Self { todo!() } @@ -19,7 +19,7 @@ impl Command { todo!() } - pub fn set_description(&mut self, description: &str) -> &mut Self { + pub fn set_description(&mut self, _description: &str) -> &mut Self { todo!() } @@ -27,11 +27,11 @@ impl Command { todo!() } - pub fn set_help(&mut self, help: &str) -> &mut Self { + pub fn set_help(&mut self, _help: &str) -> &mut Self { todo!() } - pub fn set_definition(&mut self, definition: PhpMixed) -> &mut Self { + pub fn set_definition(&mut self, _definition: PhpMixed) -> &mut Self { todo!() } @@ -41,26 +41,26 @@ impl Command { pub fn add_argument( &mut self, - name: &str, - mode: Option<i64>, - description: &str, - default: PhpMixed, + _name: &str, + _mode: Option<i64>, + _description: &str, + _default: PhpMixed, ) -> &mut Self { todo!() } pub fn add_option( &mut self, - name: &str, - shortcut: Option<&str>, - mode: Option<i64>, - description: &str, - default: PhpMixed, + _name: &str, + _shortcut: Option<&str>, + _mode: Option<i64>, + _description: &str, + _default: PhpMixed, ) -> &mut Self { todo!() } - pub fn set_aliases(&mut self, aliases: &[String]) -> &mut Self { + pub fn set_aliases(&mut self, _aliases: &[String]) -> &mut Self { todo!() } @@ -68,7 +68,7 @@ impl Command { todo!() } - pub fn set_hidden(&mut self, hidden: bool) -> &mut Self { + pub fn set_hidden(&mut self, _hidden: bool) -> &mut Self { todo!() } @@ -78,13 +78,13 @@ impl Command { pub fn run( &mut self, - input: &mut dyn InputInterface, - output: &mut dyn OutputInterface, + _input: &mut dyn InputInterface, + _output: &mut dyn OutputInterface, ) -> anyhow::Result<i64> { todo!() } - pub fn get_helper(&self, name: &str) -> PhpMixed { + pub fn get_helper(&self, _name: &str) -> PhpMixed { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs index a4b3d3e..1203ec8 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_input.rs @@ -1,5 +1,3 @@ -use shirabe_php_shim::PhpMixed; - #[derive(Debug)] pub struct CompletionInput; @@ -16,11 +14,11 @@ impl CompletionInput { todo!() } - pub fn must_suggest_option_values_for(&self, name: &str) -> bool { + pub fn must_suggest_option_values_for(&self, _name: &str) -> bool { todo!() } - pub fn must_suggest_argument_values_for(&self, name: &str) -> bool { + pub fn must_suggest_argument_values_for(&self, _name: &str) -> bool { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs index 709cdcd..7dae1fc 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/completion/completion_suggestions.rs @@ -4,11 +4,11 @@ use shirabe_php_shim::PhpMixed; pub struct CompletionSuggestions; impl CompletionSuggestions { - pub fn suggest_values(&mut self, values: Vec<PhpMixed>) { + pub fn suggest_values(&mut self, _values: Vec<PhpMixed>) { todo!() } - pub fn suggest_value(&mut self, value: PhpMixed) { + pub fn suggest_value(&mut self, _value: PhpMixed) { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs index b698d92..d1b9a1e 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter.rs @@ -2,11 +2,11 @@ pub struct OutputFormatter; impl OutputFormatter { - pub fn new(decorated: bool) -> Self { + pub fn new(_decorated: bool) -> Self { todo!() } - pub fn format(&self, message: &str) -> String { + pub fn format(&self, _message: &str) -> String { todo!() } @@ -14,22 +14,22 @@ impl OutputFormatter { todo!() } - pub fn set_decorated(&mut self, decorated: bool) { + pub fn set_decorated(&mut self, _decorated: bool) { todo!() } - pub fn escape(text: &str) -> String { + pub fn escape(_text: &str) -> String { todo!() } - pub fn escape_trailing_backslash(text: &str) -> String { + pub fn escape_trailing_backslash(_text: &str) -> String { todo!() } pub fn set_style( &mut self, - name: &str, - style: crate::symfony::component::console::formatter::output_formatter_style::OutputFormatterStyle, + _name: &str, + _style: crate::symfony::component::console::formatter::output_formatter_style::OutputFormatterStyle, ) { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs index c82cf35..6299157 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/formatter/output_formatter_style.rs @@ -3,9 +3,9 @@ pub struct OutputFormatterStyle; impl OutputFormatterStyle { pub fn new( - foreground: Option<&str>, - background: Option<&str>, - options: Option<Vec<String>>, + _foreground: Option<&str>, + _background: Option<&str>, + _options: Option<Vec<String>>, ) -> Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs index eb19ea7..656828e 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/formatter_helper.rs @@ -2,11 +2,11 @@ pub struct FormatterHelper; impl FormatterHelper { - pub fn format_section(&self, section: &str, message: &str, style: &str) -> String { + pub fn format_section(&self, _section: &str, _message: &str, _style: &str) -> String { todo!() } - pub fn format_block(&self, messages: &[&str], style: &str, large: bool) -> String { + pub fn format_block(&self, _messages: &[&str], _style: &str, _large: bool) -> String { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs index 9448310..f8b2e24 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/helper_set.rs @@ -4,19 +4,19 @@ use shirabe_php_shim::PhpMixed; pub struct HelperSet; impl HelperSet { - pub fn new(helpers: Vec<PhpMixed>) -> Self { + pub fn new(_helpers: Vec<PhpMixed>) -> Self { todo!() } - pub fn get(&self, name: &str) -> Option<PhpMixed> { + pub fn get(&self, _name: &str) -> Option<PhpMixed> { todo!() } - pub fn set(&mut self, helper: PhpMixed, alias: Option<&str>) { + pub fn set(&mut self, _helper: PhpMixed, _alias: Option<&str>) { todo!() } - pub fn has(&self, name: &str) -> bool { + pub fn has(&self, _name: &str) -> bool { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs index 22ca089..64835bb 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/progress_bar.rs @@ -4,15 +4,15 @@ use crate::symfony::component::console::output::output_interface::OutputInterfac pub struct ProgressBar; impl ProgressBar { - pub fn new(output: &dyn OutputInterface, max: i64) -> Self { + pub fn new(_output: &dyn OutputInterface, _max: i64) -> Self { todo!() } - pub fn start(&mut self, max: Option<i64>) { + pub fn start(&mut self, _max: Option<i64>) { todo!() } - pub fn advance(&mut self, step: i64) { + pub fn advance(&mut self, _step: i64) { todo!() } @@ -20,7 +20,7 @@ impl ProgressBar { todo!() } - pub fn set_format(&mut self, format: &str) { + pub fn set_format(&mut self, _format: &str) { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs index 2f2acf8..705cb9a 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/question_helper.rs @@ -9,9 +9,9 @@ pub struct QuestionHelper; impl QuestionHelper { pub fn ask( &self, - input: &mut dyn InputInterface, - output: &mut dyn OutputInterface, - question: &Question, + _input: &mut dyn InputInterface, + _output: &mut dyn OutputInterface, + _question: &Question, ) -> Option<PhpMixed> { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs index c24a19e..ba01e07 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/table.rs @@ -5,19 +5,19 @@ use shirabe_php_shim::PhpMixed; pub struct Table; impl Table { - pub fn new(output: &dyn OutputInterface) -> Self { + pub fn new(_output: &dyn OutputInterface) -> Self { todo!() } - pub fn set_headers(&mut self, headers: Vec<PhpMixed>) -> &mut Self { + pub fn set_headers(&mut self, _headers: Vec<PhpMixed>) -> &mut Self { todo!() } - pub fn set_rows(&mut self, rows: Vec<PhpMixed>) -> &mut Self { + pub fn set_rows(&mut self, _rows: Vec<PhpMixed>) -> &mut Self { todo!() } - pub fn add_row(&mut self, row: PhpMixed) -> &mut Self { + pub fn add_row(&mut self, _row: PhpMixed) -> &mut Self { todo!() } @@ -25,11 +25,11 @@ impl Table { todo!() } - pub fn set_style(&mut self, style: &str) -> &mut Self { + pub fn set_style(&mut self, _style: &str) -> &mut Self { todo!() } - pub fn set_column_widths(&mut self, widths: Vec<i64>) -> &mut Self { + pub fn set_column_widths(&mut self, _widths: Vec<i64>) -> &mut Self { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs b/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs index 7b4b2e2..22ac013 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/helper/table_separator.rs @@ -1,6 +1,12 @@ #[derive(Debug)] pub struct TableSeparator; +impl Default for TableSeparator { + fn default() -> Self { + Self::new() + } +} + impl TableSeparator { pub fn new() -> Self { todo!() diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs index b09762c..83f487b 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/array_input.rs @@ -8,8 +8,8 @@ pub struct ArrayInput; impl ArrayInput { pub fn new( - parameters: IndexMap<String, PhpMixed>, - definition: Option<InputDefinition>, + _parameters: IndexMap<String, PhpMixed>, + _definition: Option<InputDefinition>, ) -> Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/input_definition.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/input_definition.rs index 7a46004..74839fc 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/input/input_definition.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/input_definition.rs @@ -4,27 +4,27 @@ use shirabe_php_shim::PhpMixed; pub struct InputDefinition; impl InputDefinition { - pub fn new(definition: Vec<PhpMixed>) -> Self { + pub fn new(_definition: Vec<PhpMixed>) -> Self { todo!() } - pub fn add_argument(&mut self, argument: PhpMixed) { + pub fn add_argument(&mut self, _argument: PhpMixed) { todo!() } - pub fn add_option(&mut self, option: PhpMixed) { + pub fn add_option(&mut self, _option: PhpMixed) { todo!() } - pub fn has_option(&self, name: &str) -> bool { + pub fn has_option(&self, _name: &str) -> bool { todo!() } - pub fn get_option(&self, name: &str) -> anyhow::Result<PhpMixed> { + pub fn get_option(&self, _name: &str) -> anyhow::Result<PhpMixed> { todo!() } - pub fn has_argument(&self, name: &str) -> bool { + pub fn has_argument(&self, _name: &str) -> bool { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/input_option.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/input_option.rs index 9c188ba..673ca07 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/input/input_option.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/input_option.rs @@ -11,11 +11,11 @@ impl InputOption { pub const VALUE_NEGATABLE: i64 = 16; pub fn new( - name: &str, - shortcut: Option<&str>, - mode: Option<i64>, - description: &str, - default: PhpMixed, + _name: &str, + _shortcut: Option<&str>, + _mode: Option<i64>, + _description: &str, + _default: PhpMixed, ) -> Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs b/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs index 248782d..5baaede 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/input/string_input.rs @@ -7,7 +7,7 @@ use shirabe_php_shim::PhpMixed; pub struct StringInput; impl StringInput { - pub fn new(input: &str) -> Self { + pub fn new(_input: &str) -> Self { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs index 150c8ae..73c5c46 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/output/console_output.rs @@ -1,5 +1,4 @@ use crate::symfony::component::console::formatter::output_formatter::OutputFormatter; -use crate::symfony::component::console::output::console_output_interface::ConsoleOutputInterface; use crate::symfony::component::console::output::output_interface::OutputInterface; #[derive(Debug)] @@ -7,9 +6,9 @@ pub struct ConsoleOutput; impl ConsoleOutput { pub fn new( - verbosity: i64, - decorated: Option<bool>, - formatter: Option<OutputFormatter>, + _verbosity: i64, + _decorated: Option<bool>, + _formatter: Option<OutputFormatter>, ) -> Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs b/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs index e134de2..0544ffd 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/question/choice_question.rs @@ -5,15 +5,15 @@ use shirabe_php_shim::PhpMixed; pub struct ChoiceQuestion(pub Question); impl ChoiceQuestion { - pub fn new(question: &str, choices: Vec<PhpMixed>, default: Option<PhpMixed>) -> Self { + pub fn new(_question: &str, _choices: Vec<PhpMixed>, _default: Option<PhpMixed>) -> Self { todo!() } - pub fn set_multiselect(&mut self, multiselect: bool) { + pub fn set_multiselect(&mut self, _multiselect: bool) { todo!() } - pub fn set_error_message(&mut self, error_message: &str) { + pub fn set_error_message(&mut self, _error_message: &str) { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs b/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs index d749fce..c83bbcd 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/question/question.rs @@ -4,26 +4,26 @@ use shirabe_php_shim::PhpMixed; pub struct Question; impl Question { - pub fn new(question: &str, default: Option<PhpMixed>) -> Self { + pub fn new(_question: &str, _default: Option<PhpMixed>) -> Self { todo!() } pub fn set_validator( &mut self, - validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, + _validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, ) { todo!() } - pub fn set_max_attempts(&mut self, attempts: Option<i64>) { + pub fn set_max_attempts(&mut self, _attempts: Option<i64>) { todo!() } - pub fn set_hidden(&mut self, hidden: bool) { + pub fn set_hidden(&mut self, _hidden: bool) { todo!() } - pub fn set_hidden_fallback(&mut self, fallback: bool) { + pub fn set_hidden_fallback(&mut self, _fallback: bool) { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs b/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs index cce75db..9273477 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/single_command_application.rs @@ -1,24 +1,28 @@ -use shirabe_php_shim::PhpMixed; - #[derive(Debug)] pub struct SingleCommandApplication; +impl Default for SingleCommandApplication { + fn default() -> Self { + Self::new() + } +} + impl SingleCommandApplication { pub fn new() -> Self { todo!() } - pub fn set_name(&mut self, name: &str) -> &mut Self { + pub fn set_name(&mut self, _name: &str) -> &mut Self { todo!() } - pub fn set_version(&mut self, version: &str) -> &mut Self { + pub fn set_version(&mut self, _version: &str) -> &mut Self { todo!() } pub fn set_code( &mut self, - code: Box<dyn Fn(&dyn std::any::Any, &dyn std::any::Any) -> i64>, + _code: Box<dyn Fn(&dyn std::any::Any, &dyn std::any::Any) -> i64>, ) -> &mut Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs b/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs index f960a50..251d71e 100644 --- a/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs +++ b/crates/shirabe-external-packages/src/symfony/component/console/terminal.rs @@ -1,6 +1,12 @@ #[derive(Debug)] pub struct Terminal; +impl Default for Terminal { + fn default() -> Self { + Self::new() + } +} + impl Terminal { pub fn new() -> Self { todo!() diff --git a/crates/shirabe-external-packages/src/symfony/component/filesystem/filesystem.rs b/crates/shirabe-external-packages/src/symfony/component/filesystem/filesystem.rs index ef48c3d..522309e 100644 --- a/crates/shirabe-external-packages/src/symfony/component/filesystem/filesystem.rs +++ b/crates/shirabe-external-packages/src/symfony/component/filesystem/filesystem.rs @@ -3,6 +3,12 @@ use shirabe_php_shim::PhpMixed; #[derive(Debug, Clone)] pub struct Filesystem; +impl Default for Filesystem { + fn default() -> Self { + Self::new() + } +} + impl Filesystem { pub fn new() -> Self { todo!() @@ -10,117 +16,122 @@ impl Filesystem { pub fn copy( &self, - origin_file: &str, - target_file: &str, - override_file: bool, + _origin_file: &str, + _target_file: &str, + _override_file: bool, ) -> anyhow::Result<()> { todo!() } - pub fn mkdir(&self, dirs: PhpMixed, mode: u32) -> anyhow::Result<()> { + pub fn mkdir(&self, _dirs: PhpMixed, _mode: u32) -> anyhow::Result<()> { todo!() } - pub fn exists(&self, files: PhpMixed) -> bool { + pub fn exists(&self, _files: PhpMixed) -> bool { todo!() } pub fn touch( &self, - files: PhpMixed, - time: Option<i64>, - atime: Option<i64>, + _files: PhpMixed, + _time: Option<i64>, + _atime: Option<i64>, ) -> anyhow::Result<()> { todo!() } - pub fn remove(&self, files: PhpMixed) -> anyhow::Result<()> { + pub fn remove(&self, _files: PhpMixed) -> anyhow::Result<()> { todo!() } pub fn chmod( &self, - files: PhpMixed, - mode: u32, - umask: u32, - recursive: bool, + _files: PhpMixed, + _mode: u32, + _umask: u32, + _recursive: bool, ) -> anyhow::Result<()> { todo!() } - pub fn chown(&self, files: PhpMixed, user: PhpMixed, recursive: bool) -> anyhow::Result<()> { + pub fn chown(&self, _files: PhpMixed, _user: PhpMixed, _recursive: bool) -> anyhow::Result<()> { todo!() } - pub fn chgrp(&self, files: PhpMixed, group: PhpMixed, recursive: bool) -> anyhow::Result<()> { + pub fn chgrp( + &self, + _files: PhpMixed, + _group: PhpMixed, + _recursive: bool, + ) -> anyhow::Result<()> { todo!() } - pub fn rename(&self, origin: &str, target: &str, override_file: bool) -> anyhow::Result<()> { + pub fn rename(&self, _origin: &str, _target: &str, _override_file: bool) -> anyhow::Result<()> { todo!() } pub fn symlink( &self, - origin_dir: &str, - target_dir: &str, - copy_on_windows: bool, + _origin_dir: &str, + _target_dir: &str, + _copy_on_windows: bool, ) -> anyhow::Result<()> { todo!() } - pub fn hard_link(&self, origin_file: &str, target_files: PhpMixed) -> anyhow::Result<()> { + pub fn hard_link(&self, _origin_file: &str, _target_files: PhpMixed) -> anyhow::Result<()> { todo!() } - pub fn read_link(&self, path: &str) -> String { + pub fn read_link(&self, _path: &str) -> String { todo!() } - pub fn make_path_relative(&self, end_path: &str, start_path: &str) -> String { + pub fn make_path_relative(&self, _end_path: &str, _start_path: &str) -> String { todo!() } pub fn mirror( &self, - origin_dir: &str, - target_dir: &str, - iterator: Option<PhpMixed>, - options: &indexmap::IndexMap<String, PhpMixed>, + _origin_dir: &str, + _target_dir: &str, + _iterator: Option<PhpMixed>, + _options: &indexmap::IndexMap<String, PhpMixed>, ) -> anyhow::Result<()> { todo!() } - pub fn is_absolute_path(&self, file: &str) -> bool { + pub fn is_absolute_path(&self, _file: &str) -> bool { todo!() } - pub fn dump_file(&self, filename: &str, content: &str) -> anyhow::Result<()> { + pub fn dump_file(&self, _filename: &str, _content: &str) -> anyhow::Result<()> { todo!() } - pub fn append_to_file(&self, filename: &str, content: &str) -> anyhow::Result<()> { + pub fn append_to_file(&self, _filename: &str, _content: &str) -> anyhow::Result<()> { todo!() } - pub fn temp_nam(&self, dir: &str, prefix: &str) -> anyhow::Result<String> { + pub fn temp_nam(&self, _dir: &str, _prefix: &str) -> anyhow::Result<String> { todo!() } // Static-style helper methods used in the ported codebase - pub fn is_readable(path: &str) -> bool { + pub fn is_readable(_path: &str) -> bool { todo!() } - pub fn is_local_path(path: &str) -> bool { + pub fn is_local_path(_path: &str) -> bool { todo!() } - pub fn trim_trailing_slash(path: &str) -> String { + pub fn trim_trailing_slash(_path: &str) -> String { todo!() } - pub fn get_platform_path(path: &str) -> String { + pub fn get_platform_path(_path: &str) -> String { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/finder/finder.rs b/crates/shirabe-external-packages/src/symfony/component/finder/finder.rs index 4a19b0f..ae95aeb 100644 --- a/crates/shirabe-external-packages/src/symfony/component/finder/finder.rs +++ b/crates/shirabe-external-packages/src/symfony/component/finder/finder.rs @@ -3,6 +3,12 @@ use crate::symfony::component::finder::spl_file_info::SplFileInfo; #[derive(Debug)] pub struct Finder; +impl Default for Finder { + fn default() -> Self { + Self::new() + } +} + impl Finder { pub fn new() -> Self { todo!() @@ -20,11 +26,11 @@ impl Finder { todo!() } - pub fn depth(&mut self, level: i64) -> &mut Self { + pub fn depth(&mut self, _level: i64) -> &mut Self { todo!() } - pub fn r#in(&mut self, dirs: &str) -> &mut Self { + pub fn r#in(&mut self, _dirs: &str) -> &mut Self { todo!() } @@ -32,23 +38,23 @@ impl Finder { todo!() } - pub fn exclude(&mut self, exclude: &[String]) -> &mut Self { + pub fn exclude(&mut self, _exclude: &[String]) -> &mut Self { todo!() } - pub fn ignore_vcs(&mut self, ignore_vcs: bool) -> &mut Self { + pub fn ignore_vcs(&mut self, _ignore_vcs: bool) -> &mut Self { todo!() } - pub fn ignore_dot_files(&mut self, ignore_dot_files: bool) -> &mut Self { + pub fn ignore_dot_files(&mut self, _ignore_dot_files: bool) -> &mut Self { todo!() } - pub fn not_name(&mut self, pattern: &str) -> &mut Self { + pub fn not_name(&mut self, _pattern: &str) -> &mut Self { todo!() } - pub fn name(&mut self, pattern: &str) -> &mut Self { + pub fn name(&mut self, _pattern: &str) -> &mut Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/finder/glob.rs b/crates/shirabe-external-packages/src/symfony/component/finder/glob.rs index d6aadd2..08ab6df 100644 --- a/crates/shirabe-external-packages/src/symfony/component/finder/glob.rs +++ b/crates/shirabe-external-packages/src/symfony/component/finder/glob.rs @@ -2,7 +2,11 @@ pub struct Glob; impl Glob { - pub fn to_regex(glob: &str, strict_leading_dot: bool, strict_wildcard_slash: bool) -> String { + pub fn to_regex( + _glob: &str, + _strict_leading_dot: bool, + _strict_wildcard_slash: bool, + ) -> String { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/finder/spl_file_info.rs b/crates/shirabe-external-packages/src/symfony/component/finder/spl_file_info.rs index fa37718..31a0e50 100644 --- a/crates/shirabe-external-packages/src/symfony/component/finder/spl_file_info.rs +++ b/crates/shirabe-external-packages/src/symfony/component/finder/spl_file_info.rs @@ -2,7 +2,7 @@ pub struct SplFileInfo; impl SplFileInfo { - pub fn new(path: &str) -> Self { + pub fn new(_path: &str) -> Self { todo!() } @@ -18,7 +18,7 @@ impl SplFileInfo { todo!() } - pub fn get_basename(&self, suffix: Option<&str>) -> String { + pub fn get_basename(&self, _suffix: Option<&str>) -> String { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs b/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs index 9aa5a8b..ae8e5dc 100644 --- a/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs +++ b/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs @@ -1,16 +1,22 @@ #[derive(Debug)] pub struct ExecutableFinder; +impl Default for ExecutableFinder { + fn default() -> Self { + Self::new() + } +} + impl ExecutableFinder { pub fn new() -> Self { todo!() } - pub fn add_suffix(&mut self, suffix: &str) { + pub fn add_suffix(&mut self, _suffix: &str) { todo!() } - pub fn find(&self, name: &str, default: Option<&str>, dirs: &[String]) -> Option<String> { + pub fn find(&self, _name: &str, _default: Option<&str>, _dirs: &[String]) -> Option<String> { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs b/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs index be99e8c..0346d10 100644 --- a/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs +++ b/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs @@ -1,12 +1,18 @@ #[derive(Debug)] pub struct PhpExecutableFinder; +impl Default for PhpExecutableFinder { + fn default() -> Self { + Self::new() + } +} + impl PhpExecutableFinder { pub fn new() -> Self { todo!() } - pub fn find(&self, include_args: bool) -> Option<String> { + pub fn find(&self, _include_args: bool) -> Option<String> { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/component/process/process.rs b/crates/shirabe-external-packages/src/symfony/component/process/process.rs index c955790..d0cc249 100644 --- a/crates/shirabe-external-packages/src/symfony/component/process/process.rs +++ b/crates/shirabe-external-packages/src/symfony/component/process/process.rs @@ -1,5 +1,4 @@ use indexmap::IndexMap; -use shirabe_php_shim::PhpMixed; #[derive(Debug)] pub struct Process; @@ -9,57 +8,57 @@ impl Process { pub const OUT: &'static str = "out"; pub fn new( - command: Vec<String>, - cwd: Option<String>, - env: Option<IndexMap<String, String>>, - input: Option<String>, - timeout: Option<f64>, + _command: Vec<String>, + _cwd: Option<String>, + _env: Option<IndexMap<String, String>>, + _input: Option<String>, + _timeout: Option<f64>, ) -> Self { todo!() } pub fn from_shell_commandline( - command: &str, - cwd: Option<&str>, - env: Option<IndexMap<String, String>>, - input: Option<String>, - timeout: Option<f64>, + _command: &str, + _cwd: Option<&str>, + _env: Option<IndexMap<String, String>>, + _input: Option<String>, + _timeout: Option<f64>, ) -> Self { todo!() } - pub fn set_timeout(&mut self, timeout: Option<f64>) -> &mut Self { + pub fn set_timeout(&mut self, _timeout: Option<f64>) -> &mut Self { todo!() } - pub fn set_env(&mut self, env: IndexMap<String, String>) -> &mut Self { + pub fn set_env(&mut self, _env: IndexMap<String, String>) -> &mut Self { todo!() } - pub fn set_input(&mut self, input: Option<String>) -> &mut Self { + pub fn set_input(&mut self, _input: Option<String>) -> &mut Self { todo!() } - pub fn run(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) -> i64 { + pub fn run(&mut self, _callback: Option<Box<dyn FnMut(&str, &str)>>) -> i64 { todo!() } pub fn must_run( &mut self, - callback: Option<Box<dyn FnMut(&str, &str)>>, + _callback: Option<Box<dyn FnMut(&str, &str)>>, ) -> anyhow::Result<&mut Self> { todo!() } - pub fn start(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) { + pub fn start(&mut self, _callback: Option<Box<dyn FnMut(&str, &str)>>) { todo!() } - pub fn wait(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) -> i64 { + pub fn wait(&mut self, _callback: Option<Box<dyn FnMut(&str, &str)>>) -> i64 { todo!() } - pub fn stop(&mut self, timeout: f64, signal: Option<i64>) -> Option<i64> { + pub fn stop(&mut self, _timeout: f64, _signal: Option<i64>) -> Option<i64> { todo!() } @@ -107,7 +106,7 @@ impl Process { todo!() } - pub fn set_working_directory(&mut self, cwd: &str) -> &mut Self { + pub fn set_working_directory(&mut self, _cwd: &str) -> &mut Self { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/console/completion/completion_input.rs b/crates/shirabe-external-packages/src/symfony/console/completion/completion_input.rs index a4b3d3e..1203ec8 100644 --- a/crates/shirabe-external-packages/src/symfony/console/completion/completion_input.rs +++ b/crates/shirabe-external-packages/src/symfony/console/completion/completion_input.rs @@ -1,5 +1,3 @@ -use shirabe_php_shim::PhpMixed; - #[derive(Debug)] pub struct CompletionInput; @@ -16,11 +14,11 @@ impl CompletionInput { todo!() } - pub fn must_suggest_option_values_for(&self, name: &str) -> bool { + pub fn must_suggest_option_values_for(&self, _name: &str) -> bool { todo!() } - pub fn must_suggest_argument_values_for(&self, name: &str) -> bool { + pub fn must_suggest_argument_values_for(&self, _name: &str) -> bool { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/console/completion/completion_suggestions.rs b/crates/shirabe-external-packages/src/symfony/console/completion/completion_suggestions.rs index 709cdcd..7dae1fc 100644 --- a/crates/shirabe-external-packages/src/symfony/console/completion/completion_suggestions.rs +++ b/crates/shirabe-external-packages/src/symfony/console/completion/completion_suggestions.rs @@ -4,11 +4,11 @@ use shirabe_php_shim::PhpMixed; pub struct CompletionSuggestions; impl CompletionSuggestions { - pub fn suggest_values(&mut self, values: Vec<PhpMixed>) { + pub fn suggest_values(&mut self, _values: Vec<PhpMixed>) { todo!() } - pub fn suggest_value(&mut self, value: PhpMixed) { + pub fn suggest_value(&mut self, _value: PhpMixed) { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/console/completion/suggestion.rs b/crates/shirabe-external-packages/src/symfony/console/completion/suggestion.rs index 1d6d0f0..666e474 100644 --- a/crates/shirabe-external-packages/src/symfony/console/completion/suggestion.rs +++ b/crates/shirabe-external-packages/src/symfony/console/completion/suggestion.rs @@ -2,7 +2,7 @@ pub struct Suggestion; impl Suggestion { - pub fn new(value: String, description: Option<String>) -> Self { + pub fn new(_value: String, _description: Option<String>) -> Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs index 03c622b..5eb2f93 100644 --- a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs +++ b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter.rs @@ -2,11 +2,11 @@ pub struct OutputFormatter; impl OutputFormatter { - pub fn new(decorated: bool) -> Self { + pub fn new(_decorated: bool) -> Self { todo!() } - pub fn format(&self, message: &str) -> String { + pub fn format(&self, _message: &str) -> String { todo!() } @@ -14,11 +14,11 @@ impl OutputFormatter { todo!() } - pub fn set_decorated(&mut self, decorated: bool) { + pub fn set_decorated(&mut self, _decorated: bool) { todo!() } - pub fn escape(text: &str) -> String { + pub fn escape(_text: &str) -> String { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs index c82cf35..6299157 100644 --- a/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs +++ b/crates/shirabe-external-packages/src/symfony/console/formatter/output_formatter_style.rs @@ -3,9 +3,9 @@ pub struct OutputFormatterStyle; impl OutputFormatterStyle { pub fn new( - foreground: Option<&str>, - background: Option<&str>, - options: Option<Vec<String>>, + _foreground: Option<&str>, + _background: Option<&str>, + _options: Option<Vec<String>>, ) -> Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/helper_set.rs b/crates/shirabe-external-packages/src/symfony/console/helper/helper_set.rs index 9448310..f8b2e24 100644 --- a/crates/shirabe-external-packages/src/symfony/console/helper/helper_set.rs +++ b/crates/shirabe-external-packages/src/symfony/console/helper/helper_set.rs @@ -4,19 +4,19 @@ use shirabe_php_shim::PhpMixed; pub struct HelperSet; impl HelperSet { - pub fn new(helpers: Vec<PhpMixed>) -> Self { + pub fn new(_helpers: Vec<PhpMixed>) -> Self { todo!() } - pub fn get(&self, name: &str) -> Option<PhpMixed> { + pub fn get(&self, _name: &str) -> Option<PhpMixed> { todo!() } - pub fn set(&mut self, helper: PhpMixed, alias: Option<&str>) { + pub fn set(&mut self, _helper: PhpMixed, _alias: Option<&str>) { todo!() } - pub fn has(&self, name: &str) -> bool { + pub fn has(&self, _name: &str) -> bool { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/question_helper.rs b/crates/shirabe-external-packages/src/symfony/console/helper/question_helper.rs index 3a2bd5b..c7d55be 100644 --- a/crates/shirabe-external-packages/src/symfony/console/helper/question_helper.rs +++ b/crates/shirabe-external-packages/src/symfony/console/helper/question_helper.rs @@ -6,9 +6,9 @@ pub struct QuestionHelper; impl QuestionHelper { pub fn ask( &self, - input: &mut dyn std::any::Any, - output: &mut dyn std::any::Any, - question: &dyn std::any::Any, + _input: &mut dyn std::any::Any, + _output: &mut dyn std::any::Any, + _question: &dyn std::any::Any, ) -> Option<PhpMixed> { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/console/helper/table.rs b/crates/shirabe-external-packages/src/symfony/console/helper/table.rs index 2a8848d..f5e7e0c 100644 --- a/crates/shirabe-external-packages/src/symfony/console/helper/table.rs +++ b/crates/shirabe-external-packages/src/symfony/console/helper/table.rs @@ -4,19 +4,19 @@ use shirabe_php_shim::PhpMixed; pub struct Table; impl Table { - pub fn new(output: &dyn std::any::Any) -> Self { + pub fn new(_output: &dyn std::any::Any) -> Self { todo!() } - pub fn set_headers(&mut self, headers: Vec<PhpMixed>) -> &mut Self { + pub fn set_headers(&mut self, _headers: Vec<PhpMixed>) -> &mut Self { todo!() } - pub fn set_rows(&mut self, rows: Vec<PhpMixed>) -> &mut Self { + pub fn set_rows(&mut self, _rows: Vec<PhpMixed>) -> &mut Self { todo!() } - pub fn add_row(&mut self, row: PhpMixed) -> &mut Self { + pub fn add_row(&mut self, _row: PhpMixed) -> &mut Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs b/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs index 68c589e..8feeeb8 100644 --- a/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs +++ b/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs @@ -6,7 +6,7 @@ use shirabe_php_shim::PhpMixed; pub struct ArrayInput; impl ArrayInput { - pub fn new(parameters: IndexMap<String, PhpMixed>) -> Self { + pub fn new(_parameters: IndexMap<String, PhpMixed>) -> Self { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs index f5c29e8..84b722d 100644 --- a/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_argument.rs @@ -9,10 +9,10 @@ impl InputArgument { pub const IS_ARRAY: i64 = 4; pub fn new( - name: &str, - mode: Option<i64>, - description: &str, - default: Option<PhpMixed>, + _name: &str, + _mode: Option<i64>, + _description: &str, + _default: Option<PhpMixed>, ) -> Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs b/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs index 9c188ba..673ca07 100644 --- a/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs +++ b/crates/shirabe-external-packages/src/symfony/console/input/input_option.rs @@ -11,11 +11,11 @@ impl InputOption { pub const VALUE_NEGATABLE: i64 = 16; pub fn new( - name: &str, - shortcut: Option<&str>, - mode: Option<i64>, - description: &str, - default: PhpMixed, + _name: &str, + _shortcut: Option<&str>, + _mode: Option<i64>, + _description: &str, + _default: PhpMixed, ) -> Self { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs b/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs index 12c6d9d..6c3ebad 100644 --- a/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs +++ b/crates/shirabe-external-packages/src/symfony/console/input/string_input.rs @@ -6,7 +6,7 @@ use shirabe_php_shim::PhpMixed; pub struct StringInput; impl StringInput { - pub fn new(input: &str) -> Self { + pub fn new(_input: &str) -> Self { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs b/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs index e5d83fb..068b678 100644 --- a/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs +++ b/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs @@ -5,7 +5,7 @@ use shirabe_php_shim::PhpMixed; pub struct StreamOutput; impl StreamOutput { - pub fn new(stream: PhpMixed, verbosity: i64, decorated: Option<bool>) -> Self { + pub fn new(_stream: PhpMixed, _verbosity: i64, _decorated: Option<bool>) -> Self { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/console/question/question.rs b/crates/shirabe-external-packages/src/symfony/console/question/question.rs index 34bb6a4..4cc4d6d 100644 --- a/crates/shirabe-external-packages/src/symfony/console/question/question.rs +++ b/crates/shirabe-external-packages/src/symfony/console/question/question.rs @@ -4,22 +4,22 @@ use shirabe_php_shim::PhpMixed; pub struct Question; impl Question { - pub fn new(question: &str, default: Option<PhpMixed>) -> Self { + pub fn new(_question: &str, _default: Option<PhpMixed>) -> Self { todo!() } pub fn set_validator( &mut self, - validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, + _validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, ) { todo!() } - pub fn set_max_attempts(&mut self, attempts: Option<i64>) { + pub fn set_max_attempts(&mut self, _attempts: Option<i64>) { todo!() } - pub fn set_hidden(&mut self, hidden: bool) { + pub fn set_hidden(&mut self, _hidden: bool) { todo!() } diff --git a/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs b/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs index 7f7acd6..4269337 100644 --- a/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs +++ b/crates/shirabe-external-packages/src/symfony/console/style/symfony_style.rs @@ -6,89 +6,89 @@ use shirabe_php_shim::PhpMixed; pub struct SymfonyStyle; impl SymfonyStyle { - pub fn new(input: &dyn InputInterface, output: &dyn OutputInterface) -> Self { + pub fn new(_input: &dyn InputInterface, _output: &dyn OutputInterface) -> Self { todo!() } - pub fn title(&mut self, message: &str) { + pub fn title(&mut self, _message: &str) { todo!() } - pub fn section(&mut self, message: &str) { + pub fn section(&mut self, _message: &str) { todo!() } - pub fn text(&mut self, message: &str) { + pub fn text(&mut self, _message: &str) { todo!() } - pub fn comment(&mut self, message: &str) { + pub fn comment(&mut self, _message: &str) { todo!() } - pub fn success(&mut self, message: PhpMixed) { + pub fn success(&mut self, _message: PhpMixed) { todo!() } - pub fn error(&mut self, message: PhpMixed) { + pub fn error(&mut self, _message: PhpMixed) { todo!() } - pub fn warning(&mut self, message: PhpMixed) { + pub fn warning(&mut self, _message: PhpMixed) { todo!() } - pub fn note(&mut self, message: PhpMixed) { + pub fn note(&mut self, _message: PhpMixed) { todo!() } - pub fn listing(&mut self, elements: &[String]) { + pub fn listing(&mut self, _elements: &[String]) { todo!() } - pub fn new_line(&mut self, count: i64) { + pub fn new_line(&mut self, _count: i64) { todo!() } pub fn ask( &mut self, - question: &str, - default: Option<&str>, - validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, + _question: &str, + _default: Option<&str>, + _validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, ) -> PhpMixed { todo!() } pub fn ask_hidden( &mut self, - question: &str, - validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, + _question: &str, + _validator: Option<Box<dyn Fn(Option<PhpMixed>) -> anyhow::Result<PhpMixed>>>, ) -> PhpMixed { todo!() } - pub fn confirm(&mut self, question: &str, default: bool) -> bool { + pub fn confirm(&mut self, _question: &str, _default: bool) -> bool { todo!() } pub fn choice( &mut self, - question: &str, - choices: Vec<PhpMixed>, - default: Option<PhpMixed>, + _question: &str, + _choices: Vec<PhpMixed>, + _default: Option<PhpMixed>, ) -> PhpMixed { todo!() } - pub fn table(&mut self, headers: Vec<PhpMixed>, rows: Vec<PhpMixed>) { + pub fn table(&mut self, _headers: Vec<PhpMixed>, _rows: Vec<PhpMixed>) { todo!() } - pub fn progress_start(&mut self, max: i64) { + pub fn progress_start(&mut self, _max: i64) { todo!() } - pub fn progress_advance(&mut self, step: i64) { + pub fn progress_advance(&mut self, _step: i64) { todo!() } @@ -100,11 +100,11 @@ impl SymfonyStyle { todo!() } - pub fn writeln(&mut self, messages: PhpMixed, r#type: i64) { + pub fn writeln(&mut self, _messages: PhpMixed, _type: i64) { todo!() } - pub fn write(&mut self, messages: PhpMixed, newline: bool, r#type: i64) { + pub fn write(&mut self, _messages: PhpMixed, _newline: bool, _type: i64) { todo!() } } diff --git a/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs b/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs index 9aa5a8b..ae8e5dc 100644 --- a/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs +++ b/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs @@ -1,16 +1,22 @@ #[derive(Debug)] pub struct ExecutableFinder; +impl Default for ExecutableFinder { + fn default() -> Self { + Self::new() + } +} + impl ExecutableFinder { pub fn new() -> Self { todo!() } - pub fn add_suffix(&mut self, suffix: &str) { + pub fn add_suffix(&mut self, _suffix: &str) { todo!() } - pub fn find(&self, name: &str, default: Option<&str>, dirs: &[String]) -> Option<String> { + pub fn find(&self, _name: &str, _default: Option<&str>, _dirs: &[String]) -> Option<String> { todo!() } } diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index 001e6f6..d1db732 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -72,7 +72,7 @@ pub struct RuntimeException { } impl std::fmt::Display for RuntimeException { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { todo!() } } @@ -84,7 +84,7 @@ pub struct UnexpectedValueException { } impl std::fmt::Display for UnexpectedValueException { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { todo!() } } @@ -96,7 +96,7 @@ pub struct InvalidArgumentException { } impl std::fmt::Display for InvalidArgumentException { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { todo!() } } @@ -108,7 +108,7 @@ pub struct LogicException { } impl std::fmt::Display for LogicException { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { todo!() } } @@ -120,7 +120,7 @@ pub struct BadMethodCallException { } impl std::fmt::Display for BadMethodCallException { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { todo!() } } @@ -132,7 +132,7 @@ pub struct OutOfBoundsException { } impl std::fmt::Display for OutOfBoundsException { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { todo!() } } @@ -147,60 +147,60 @@ pub struct ErrorException { } impl std::fmt::Display for ErrorException { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { todo!() } } -pub fn is_bool(value: &PhpMixed) -> bool { +pub fn is_bool(_value: &PhpMixed) -> bool { todo!() } -pub fn is_string(value: &PhpMixed) -> bool { +pub fn is_string(_value: &PhpMixed) -> bool { todo!() } -pub fn is_int(value: &PhpMixed) -> bool { +pub fn is_int(_value: &PhpMixed) -> bool { todo!() } -pub fn is_scalar(value: &PhpMixed) -> bool { +pub fn is_scalar(_value: &PhpMixed) -> bool { todo!() } -pub fn is_numeric(value: &PhpMixed) -> bool { +pub fn is_numeric(_value: &PhpMixed) -> bool { todo!() } -pub fn strtotime(time: &str) -> Option<i64> { +pub fn strtotime(_time: &str) -> Option<i64> { todo!() } -pub fn strcasecmp(s1: &str, s2: &str) -> i64 { +pub fn strcasecmp(_s1: &str, _s2: &str) -> i64 { todo!() } -pub fn sprintf(format: &str, args: &[PhpMixed]) -> String { +pub fn sprintf(_format: &str, _args: &[PhpMixed]) -> String { todo!() } -pub fn array_values<V: Clone>(array: &IndexMap<String, V>) -> Vec<V> { +pub fn array_values<V: Clone>(_array: &IndexMap<String, V>) -> Vec<V> { todo!() } -pub fn array_keys<V>(array: &IndexMap<String, V>) -> Vec<String> { +pub fn array_keys<V>(_array: &IndexMap<String, V>) -> Vec<String> { todo!() } -pub fn str_replace(search: &str, replace: &str, subject: &str) -> String { +pub fn str_replace(_search: &str, _replace: &str, _subject: &str) -> String { todo!() } -pub fn php_to_string(value: &PhpMixed) -> String { +pub fn php_to_string(_value: &PhpMixed) -> String { todo!() } -pub fn substr(s: &str, start: i64, length: Option<i64>) -> String { +pub fn substr(_s: &str, _start: i64, _length: Option<i64>) -> String { todo!() } @@ -212,187 +212,187 @@ pub fn spl_autoload_functions() -> Vec<PhpMixed> { todo!() } -pub fn array_push(array: &mut Vec<String>, value: String) -> i64 { +pub fn array_push(_array: &mut Vec<String>, _value: String) -> i64 { todo!() } -pub fn array_search_in_vec(needle: &str, haystack: &[String]) -> Option<usize> { +pub fn array_search_in_vec(_needle: &str, _haystack: &[String]) -> Option<usize> { todo!() } -pub fn array_map_str_fn<F: Fn(&str) -> String>(callback: F, array: &[String]) -> Vec<String> { +pub fn array_map_str_fn<F: Fn(&str) -> String>(_callback: F, _array: &[String]) -> Vec<String> { todo!() } -pub fn is_callable(value: &PhpMixed) -> bool { +pub fn is_callable(_value: &PhpMixed) -> bool { todo!() } -pub fn is_object(value: &PhpMixed) -> bool { +pub fn is_object(_value: &PhpMixed) -> bool { todo!() } -pub fn is_a(object_or_class: &PhpMixed, class: &str, allow_string: bool) -> bool { +pub fn is_a(_object_or_class: &PhpMixed, _class: &str, _allow_string: bool) -> bool { todo!() } -pub fn str_contains(haystack: &str, needle: &str) -> bool { +pub fn str_contains(_haystack: &str, _needle: &str) -> bool { todo!() } -pub fn str_starts_with(haystack: &str, needle: &str) -> bool { +pub fn str_starts_with(_haystack: &str, _needle: &str) -> bool { todo!() } -pub fn str_ends_with(haystack: &str, needle: &str) -> bool { +pub fn str_ends_with(_haystack: &str, _needle: &str) -> bool { todo!() } -pub fn strpos(haystack: &str, needle: &str) -> Option<usize> { +pub fn strpos(_haystack: &str, _needle: &str) -> Option<usize> { todo!() } -pub fn strtoupper(s: &str) -> String { +pub fn strtoupper(_s: &str) -> String { todo!() } -pub fn strlen(s: &str) -> i64 { +pub fn strlen(_s: &str) -> i64 { todo!() } -pub fn krsort<V>(array: &mut IndexMap<i64, V>) { +pub fn krsort<V>(_array: &mut IndexMap<i64, V>) { todo!() } -pub fn max_i64(a: i64, b: i64) -> i64 { +pub fn max_i64(_a: i64, _b: i64) -> i64 { todo!() } -pub fn count_mixed(value: &PhpMixed) -> i64 { +pub fn count_mixed(_value: &PhpMixed) -> i64 { todo!() } -pub fn array_slice_mixed(value: &PhpMixed, offset: i64, length: Option<i64>) -> PhpMixed { +pub fn array_slice_mixed(_value: &PhpMixed, _offset: i64, _length: Option<i64>) -> PhpMixed { todo!() } -pub fn array_slice_strs(value: &[String], offset: i64, length: Option<i64>) -> Vec<String> { +pub fn array_slice_strs(_value: &[String], _offset: i64, _length: Option<i64>) -> Vec<String> { todo!() } -pub fn empty(value: &PhpMixed) -> bool { +pub fn empty(_value: &PhpMixed) -> bool { todo!() } -pub fn method_exists(object: &PhpMixed, method_name: &str) -> bool { +pub fn method_exists(_object: &PhpMixed, _method_name: &str) -> bool { todo!() } -pub fn get_class(object: &PhpMixed) -> String { +pub fn get_class(_object: &PhpMixed) -> String { todo!() } -pub fn get_debug_type(value: &PhpMixed) -> String { +pub fn get_debug_type(_value: &PhpMixed) -> String { todo!() } -pub fn defined(name: &str) -> bool { +pub fn defined(_name: &str) -> bool { todo!() } -pub fn hash(algo: &str, data: &str) -> String { +pub fn hash(_algo: &str, _data: &str) -> String { todo!() } -pub fn hash_raw(algo: &str, data: &str) -> Vec<u8> { +pub fn hash_raw(_algo: &str, _data: &str) -> Vec<u8> { todo!() } -pub fn pack(format: &str, values: &[PhpMixed]) -> Vec<u8> { +pub fn pack(_format: &str, _values: &[PhpMixed]) -> Vec<u8> { todo!() } -pub fn unpack(format: &str, data: &[u8]) -> Option<IndexMap<String, Box<PhpMixed>>> { +pub fn unpack(_format: &str, _data: &[u8]) -> Option<IndexMap<String, Box<PhpMixed>>> { todo!() } pub const PHP_VERSION_ID: i64 = 80100; -pub fn extension_loaded(name: &str) -> bool { +pub fn extension_loaded(_name: &str) -> bool { todo!() } -pub fn gzopen(file: &str, mode: &str) -> PhpMixed { +pub fn gzopen(_file: &str, _mode: &str) -> PhpMixed { todo!() } -pub fn gzread(file: PhpMixed, length: i64) -> String { +pub fn gzread(_file: PhpMixed, _length: i64) -> String { todo!() } -pub fn gzclose(file: PhpMixed) { +pub fn gzclose(_file: PhpMixed) { todo!() } -pub fn fseek(stream: PhpMixed, offset: i64) -> i64 { +pub fn fseek(_stream: PhpMixed, _offset: i64) -> i64 { todo!() } -pub fn rewind(stream: PhpMixed) -> bool { +pub fn rewind(_stream: PhpMixed) -> bool { todo!() } -pub fn strip_tags(str: &str) -> String { +pub fn strip_tags(_str: &str) -> String { todo!() } pub const PHP_EOL: &str = "\n"; -pub fn fopen(file: &str, mode: &str) -> PhpMixed { +pub fn fopen(_file: &str, _mode: &str) -> PhpMixed { todo!() } -pub fn fwrite(file: PhpMixed, data: &str, length: i64) { +pub fn fwrite(_file: PhpMixed, _data: &str, _length: i64) { todo!() } -pub fn fclose(file: PhpMixed) { +pub fn fclose(_file: PhpMixed) { todo!() } -pub fn parse_url(url: &str, component: i64) -> PhpMixed { +pub fn parse_url(_url: &str, _component: i64) -> PhpMixed { todo!() } -pub fn parse_url_all(url: &str) -> PhpMixed { +pub fn parse_url_all(_url: &str) -> PhpMixed { todo!() } -pub fn pathinfo(path: PhpMixed, option: i64) -> PhpMixed { +pub fn pathinfo(_path: PhpMixed, _option: i64) -> PhpMixed { todo!() } -pub fn strtr(str: &str, from: &str, to: &str) -> String { +pub fn strtr(_str: &str, _from: &str, _to: &str) -> String { todo!() } -pub fn implode(glue: &str, pieces: &[String]) -> String { +pub fn implode(_glue: &str, _pieces: &[String]) -> String { todo!() } -pub fn version_compare(v1: &str, v2: &str, op: &str) -> bool { +pub fn version_compare(_v1: &str, _v2: &str, _op: &str) -> bool { todo!() } -pub fn version_compare_2(v1: &str, v2: &str) -> i64 { +pub fn version_compare_2(_v1: &str, _v2: &str) -> i64 { todo!() } -pub fn microtime(get_as_float: bool) -> f64 { +pub fn microtime(_get_as_float: bool) -> f64 { todo!() } -pub fn error_reporting(level: Option<i64>) -> i64 { +pub fn error_reporting(_level: Option<i64>) -> i64 { todo!() } @@ -431,15 +431,15 @@ impl Phar { pub const GZ: i64 = 4096; pub const BZ2: i64 = 8192; - pub fn new(a: String) -> Self { + pub fn new(_a: String) -> Self { todo!() } - pub fn extract_to(&self, a: &str, b: Option<()>, c: bool) { + pub fn extract_to(&self, _a: &str, _b: Option<()>, _c: bool) { todo!() } - pub fn running(return_full: bool) -> String { + pub fn running(_return_full: bool) -> String { todo!() } } @@ -481,15 +481,15 @@ pub struct PharData { } impl PharData { - pub fn new(a: String) -> Self { + pub fn new(_a: String) -> Self { todo!() } - pub fn new_with_format(path: String, flags: i64, alias: &str, format: i64) -> Self { + pub fn new_with_format(_path: String, _flags: i64, _alias: &str, _format: i64) -> Self { todo!() } - pub fn can_compress(algo: i64) -> bool { + pub fn can_compress(_algo: i64) -> bool { todo!() } @@ -497,7 +497,7 @@ impl PharData { todo!() } - pub fn get(&self, key: &str) -> Option<PharFileInfo> { + pub fn get(&self, _key: &str) -> Option<PharFileInfo> { todo!() } @@ -506,23 +506,23 @@ impl PharData { std::iter::empty() } - pub fn extract_to(&self, a: &str, b: Option<()>, c: bool) { + pub fn extract_to(&self, _a: &str, _b: Option<()>, _c: bool) { todo!() } - pub fn add_empty_dir(&self, a: &str) { + pub fn add_empty_dir(&self, _a: &str) { todo!() } pub fn build_from_iterator( &self, - iter: &mut dyn Iterator<Item = std::path::PathBuf>, - base: &str, + _iter: &mut dyn Iterator<Item = std::path::PathBuf>, + _base: &str, ) { todo!() } - pub fn compress(&self, algo: i64) { + pub fn compress(&self, _algo: i64) { todo!() } } @@ -532,12 +532,18 @@ pub struct ZipArchive { pub num_files: i64, } +impl Default for ZipArchive { + fn default() -> Self { + Self::new() + } +} + impl ZipArchive { pub fn new() -> Self { todo!() } - pub fn open(&mut self, filename: &str, flags: i64) -> Result<(), i64> { + pub fn open(&mut self, _filename: &str, _flags: i64) -> Result<(), i64> { todo!() } @@ -549,39 +555,39 @@ impl ZipArchive { todo!() } - pub fn stat_index(&self, index: i64) -> Option<IndexMap<String, Box<PhpMixed>>> { + pub fn stat_index(&self, _index: i64) -> Option<IndexMap<String, Box<PhpMixed>>> { todo!() } - pub fn extract_to(&self, path: &str) -> bool { + pub fn extract_to(&self, _path: &str) -> bool { todo!() } - pub fn locate_name(&self, name: &str) -> Option<i64> { + pub fn locate_name(&self, _name: &str) -> Option<i64> { todo!() } - pub fn get_from_index(&self, index: i64) -> Option<String> { + pub fn get_from_index(&self, _index: i64) -> Option<String> { todo!() } - pub fn get_name_index(&self, index: i64) -> String { + pub fn get_name_index(&self, _index: i64) -> String { todo!() } - pub fn get_stream(&self, name: &str) -> Option<PhpMixed> { + pub fn get_stream(&self, _name: &str) -> Option<PhpMixed> { todo!() } - pub fn add_empty_dir(&self, local_name: &str) -> bool { + pub fn add_empty_dir(&self, _local_name: &str) -> bool { todo!() } - pub fn add_file(&self, filepath: &str, local_name: &str) -> bool { + pub fn add_file(&self, _filepath: &str, _local_name: &str) -> bool { todo!() } - pub fn set_external_attributes_name(&self, name: &str, opsys: i64, attr: i64) -> bool { + pub fn set_external_attributes_name(&self, _name: &str, _opsys: i64, _attr: i64) -> bool { todo!() } @@ -612,11 +618,11 @@ pub trait Countable { fn count(&self) -> i64; } -pub fn in_array(needle: PhpMixed, haystack: &PhpMixed, strict: bool) -> bool { +pub fn in_array(_needle: PhpMixed, _haystack: &PhpMixed, _strict: bool) -> bool { todo!() } -pub fn realpath(path: &str) -> Option<String> { +pub fn realpath(_path: &str) -> Option<String> { todo!() } @@ -625,102 +631,102 @@ pub const JSON_UNESCAPED_SLASHES: i64 = 64; pub const JSON_PRETTY_PRINT: i64 = 128; pub const JSON_THROW_ON_ERROR: i64 = 4194304; -pub fn json_encode(value: &PhpMixed) -> Option<String> { +pub fn json_encode(_value: &PhpMixed) -> Option<String> { todo!() } -pub fn preg_quote(str: &str, delimiter: Option<char>) -> String { +pub fn preg_quote(_str: &str, _delimiter: Option<char>) -> String { todo!() } // Returns 1 on match, 0 on no match; populates matches[0]=full match, matches[1..]=captures. // Optional groups that did not participate in the match are stored as None. -pub fn preg_match(pattern: &str, subject: &str, matches: &mut Vec<Option<String>>) -> i64 { +pub fn preg_match(_pattern: &str, _subject: &str, _matches: &mut Vec<Option<String>>) -> i64 { todo!() } // Returns Some(result) on success, None on error. -pub fn preg_replace(pattern: &str, replacement: &str, subject: &str) -> Option<String> { +pub fn preg_replace(_pattern: &str, _replacement: &str, _subject: &str) -> Option<String> { todo!() } // Returns Some(parts) on success, None on error. -pub fn preg_split(pattern: &str, subject: &str) -> Option<Vec<String>> { +pub fn preg_split(_pattern: &str, _subject: &str) -> Option<Vec<String>> { todo!() } -pub fn dirname(path: &str) -> String { +pub fn dirname(_path: &str) -> String { todo!() } -pub fn stream_get_contents(stream: PhpMixed) -> Option<String> { +pub fn stream_get_contents(_stream: PhpMixed) -> Option<String> { todo!() } -pub fn class_exists(name: &str) -> bool { +pub fn class_exists(_name: &str) -> bool { todo!() } -pub fn function_exists(name: &str) -> bool { +pub fn function_exists(_name: &str) -> bool { todo!() } -pub fn mb_convert_encoding(string: Vec<u8>, to_encoding: &str, from_encoding: &str) -> String { +pub fn mb_convert_encoding(_string: Vec<u8>, _to_encoding: &str, _from_encoding: &str) -> String { todo!() } -pub fn touch(path: &str) -> bool { +pub fn touch(_path: &str) -> bool { todo!() } -pub fn chmod(path: &str, mode: u32) -> bool { +pub fn chmod(_path: &str, _mode: u32) -> bool { todo!() } -pub fn strpbrk(haystack: &str, char_list: &str) -> Option<String> { +pub fn strpbrk(_haystack: &str, _char_list: &str) -> Option<String> { todo!() } -pub fn rawurldecode(s: &str) -> String { +pub fn rawurldecode(_s: &str) -> String { todo!() } -pub fn rawurlencode(s: &str) -> String { +pub fn rawurlencode(_s: &str) -> String { todo!() } -pub fn urlencode(s: &str) -> String { +pub fn urlencode(_s: &str) -> String { todo!() } -pub fn base64_encode(data: &str) -> String { +pub fn base64_encode(_data: &str) -> String { todo!() } -pub fn base64_decode(data: &str) -> Option<Vec<u8>> { +pub fn base64_decode(_data: &str) -> Option<Vec<u8>> { todo!() } -pub fn substr_count(haystack: &str, needle: &str) -> i64 { +pub fn substr_count(_haystack: &str, _needle: &str) -> i64 { todo!() } pub fn openssl_x509_parse( - certificate: &str, - short_names: bool, + _certificate: &str, + _short_names: bool, ) -> Option<IndexMap<String, Box<PhpMixed>>> { todo!() } -pub fn openssl_get_publickey(certificate: &str) -> Option<PhpMixed> { +pub fn openssl_get_publickey(_certificate: &str) -> Option<PhpMixed> { todo!() } -pub fn openssl_pkey_get_details(key: PhpMixed) -> Option<IndexMap<String, Box<PhpMixed>>> { +pub fn openssl_pkey_get_details(_key: PhpMixed) -> Option<IndexMap<String, Box<PhpMixed>>> { todo!() } -pub fn fileperms(path: &str) -> i64 { +pub fn fileperms(_path: &str) -> i64 { todo!() } @@ -729,7 +735,7 @@ pub const FILTER_VALIDATE_URL: i64 = 273; pub const FILTER_VALIDATE_IP: i64 = 275; pub const FILTER_VALIDATE_INT: i64 = 257; -pub fn filter_var(value: &str, filter: i64) -> bool { +pub fn filter_var(_value: &str, _filter: i64) -> bool { todo!() } @@ -773,7 +779,7 @@ pub fn include_file(file: &str) -> PhpMixed { todo!() } -pub fn set_error_handler(callback: fn(i64, &str, &str, i64) -> bool) { +pub fn set_error_handler(_callback: fn(i64, &str, &str, i64) -> bool) { todo!() } @@ -785,7 +791,7 @@ pub const PHP_VERSION: &str = "8.1.0"; pub const STDERR: i64 = 2; -pub fn is_resource(value: &PhpMixed) -> bool { +pub fn is_resource(_value: &PhpMixed) -> bool { todo!() } @@ -793,7 +799,7 @@ pub fn is_resource(value: &PhpMixed) -> bool { pub struct RarEntry; impl RarEntry { - pub fn extract(&self, path: &str) -> bool { + pub fn extract(&self, _path: &str) -> bool { todo!() } } @@ -810,7 +816,7 @@ pub fn var_export_str(_value: &str, _return: bool) -> String { pub struct RarArchive; impl RarArchive { - pub fn open(file: &str) -> Option<Self> { + pub fn open(_file: &str) -> Option<Self> { todo!() } @@ -823,19 +829,19 @@ impl RarArchive { } } -pub fn array_fill_keys(keys: PhpMixed, value: PhpMixed) -> PhpMixed { +pub fn array_fill_keys(_keys: PhpMixed, _value: PhpMixed) -> PhpMixed { todo!() } -pub fn array_merge(array1: PhpMixed, array2: PhpMixed) -> PhpMixed { +pub fn array_merge(_array1: PhpMixed, _array2: PhpMixed) -> PhpMixed { todo!() } -pub fn substr_replace(string: &str, replace: &str, start: usize, length: usize) -> String { +pub fn substr_replace(_string: &str, _replace: &str, _start: usize, _length: usize) -> String { todo!() } -pub fn constant(name: &str) -> PhpMixed { +pub fn constant(_name: &str) -> PhpMixed { todo!() } @@ -843,7 +849,7 @@ pub fn get_loaded_extensions() -> Vec<String> { todo!() } -pub fn phpversion(extension: &str) -> Option<String> { +pub fn phpversion(_extension: &str) -> Option<String> { todo!() } @@ -855,65 +861,65 @@ pub fn ob_get_clean() -> Option<String> { todo!() } -pub fn html_entity_decode(s: &str) -> String { +pub fn html_entity_decode(_s: &str) -> String { todo!() } -pub fn hash_file(algo: &str, filename: &str) -> Option<String> { +pub fn hash_file(_algo: &str, _filename: &str) -> Option<String> { todo!() } -pub fn filesize(path: &str) -> Option<i64> { +pub fn filesize(_path: &str) -> Option<i64> { todo!() } -pub fn random_int(min: i64, max: i64) -> i64 { +pub fn random_int(_min: i64, _max: i64) -> i64 { todo!() } -pub fn json_encode_ex(value: &PhpMixed, flags: i64) -> Option<String> { +pub fn json_encode_ex(_value: &PhpMixed, _flags: i64) -> Option<String> { todo!() } pub const JSON_INVALID_UTF8_IGNORE: i64 = 1048576; -pub fn is_array(value: &PhpMixed) -> bool { +pub fn is_array(_value: &PhpMixed) -> bool { todo!() } -pub fn strnatcasecmp(s1: &str, s2: &str) -> i64 { +pub fn strnatcasecmp(_s1: &str, _s2: &str) -> i64 { todo!() } -pub fn file_exists(path: &str) -> bool { +pub fn file_exists(_path: &str) -> bool { todo!() } -pub fn is_writable(path: &str) -> bool { +pub fn is_writable(_path: &str) -> bool { todo!() } -pub fn unlink(path: &str) -> bool { +pub fn unlink(_path: &str) -> bool { todo!() } -pub fn file_put_contents(path: &str, data: &[u8]) -> Option<i64> { +pub fn file_put_contents(_path: &str, _data: &[u8]) -> Option<i64> { todo!() } -pub fn str_repeat(s: &str, count: usize) -> String { +pub fn str_repeat(_s: &str, _count: usize) -> String { todo!() } -pub fn strrpos(haystack: &str, needle: &str) -> Option<usize> { +pub fn strrpos(_haystack: &str, _needle: &str) -> Option<usize> { todo!() } -pub fn gzcompress(data: &[u8]) -> Option<Vec<u8>> { +pub fn gzcompress(_data: &[u8]) -> Option<Vec<u8>> { todo!() } -pub fn bzcompress(data: &[u8]) -> Option<Vec<u8>> { +pub fn bzcompress(_data: &[u8]) -> Option<Vec<u8>> { todo!() } @@ -921,19 +927,19 @@ pub fn getcwd() -> Option<String> { todo!() } -pub fn chdir(path: &str) -> anyhow::Result<()> { +pub fn chdir(_path: &str) -> anyhow::Result<()> { todo!() } -pub fn glob(pattern: &str) -> Vec<String> { +pub fn glob(_pattern: &str) -> Vec<String> { todo!() } -pub fn basename(path: &str) -> String { +pub fn basename(_path: &str) -> String { todo!() } -pub fn explode(delimiter: &str, string: &str) -> Vec<String> { +pub fn explode(_delimiter: &str, _string: &str) -> Vec<String> { todo!() } @@ -1028,31 +1034,31 @@ pub fn curl_init() -> CurlHandle { todo!() } -pub fn curl_close(handle: CurlHandle) { +pub fn curl_close(_handle: CurlHandle) { todo!() } -pub fn curl_setopt(handle: &CurlHandle, option: i64, value: PhpMixed) -> bool { +pub fn curl_setopt(_handle: &CurlHandle, _option: i64, _value: PhpMixed) -> bool { todo!() } -pub fn curl_setopt_array(handle: &CurlHandle, options: &IndexMap<i64, PhpMixed>) -> bool { +pub fn curl_setopt_array(_handle: &CurlHandle, _options: &IndexMap<i64, PhpMixed>) -> bool { todo!() } -pub fn curl_getinfo(handle: &CurlHandle) -> PhpMixed { +pub fn curl_getinfo(_handle: &CurlHandle) -> PhpMixed { todo!() } -pub fn curl_error(handle: &CurlHandle) -> String { +pub fn curl_error(_handle: &CurlHandle) -> String { todo!() } -pub fn curl_errno(handle: &CurlHandle) -> i64 { +pub fn curl_errno(_handle: &CurlHandle) -> i64 { todo!() } -pub fn curl_strerror(errornum: i64) -> Option<String> { +pub fn curl_strerror(_errornum: i64) -> Option<String> { todo!() } @@ -1060,27 +1066,27 @@ pub fn curl_multi_init() -> CurlMultiHandle { todo!() } -pub fn curl_multi_setopt(mh: &CurlMultiHandle, option: i64, value: PhpMixed) -> bool { +pub fn curl_multi_setopt(_mh: &CurlMultiHandle, _option: i64, _value: PhpMixed) -> bool { todo!() } -pub fn curl_multi_add_handle(mh: &CurlMultiHandle, handle: &CurlHandle) -> i64 { +pub fn curl_multi_add_handle(_mh: &CurlMultiHandle, _handle: &CurlHandle) -> i64 { todo!() } -pub fn curl_multi_remove_handle(mh: &CurlMultiHandle, handle: &CurlHandle) -> i64 { +pub fn curl_multi_remove_handle(_mh: &CurlMultiHandle, _handle: &CurlHandle) -> i64 { todo!() } -pub fn curl_multi_exec(mh: &CurlMultiHandle, still_running: &mut bool) -> i64 { +pub fn curl_multi_exec(_mh: &CurlMultiHandle, _still_running: &mut bool) -> i64 { todo!() } -pub fn curl_multi_select(mh: &CurlMultiHandle, timeout: f64) -> i64 { +pub fn curl_multi_select(_mh: &CurlMultiHandle, _timeout: f64) -> i64 { todo!() } -pub fn curl_multi_info_read(mh: &CurlMultiHandle) -> PhpMixed { +pub fn curl_multi_info_read(_mh: &CurlMultiHandle) -> PhpMixed { todo!() } @@ -1088,12 +1094,12 @@ pub fn curl_share_init() -> CurlShareHandle { todo!() } -pub fn curl_share_setopt(sh: &CurlShareHandle, option: i64, value: PhpMixed) -> bool { +pub fn curl_share_setopt(_sh: &CurlShareHandle, _option: i64, _value: PhpMixed) -> bool { todo!() } /// Cast a `\CurlHandle` to int (its spl_object_id) as `(int) $curlHandle` in PHP. -pub fn curl_handle_id(handle: &CurlHandle) -> i64 { +pub fn curl_handle_id(_handle: &CurlHandle) -> i64 { todo!() } @@ -1112,31 +1118,31 @@ pub fn stream_get_contents_with_max(stream: PhpMixed, max_length: Option<i64>) - todo!() } -pub fn bin2hex(data: &[u8]) -> String { +pub fn bin2hex(_data: &[u8]) -> String { todo!() } -pub fn random_bytes(length: usize) -> Vec<u8> { +pub fn random_bytes(_length: usize) -> Vec<u8> { todo!() } -pub fn is_dir(path: &str) -> bool { +pub fn is_dir(_path: &str) -> bool { todo!() } -pub fn file_get_contents(path: &str) -> Option<String> { +pub fn file_get_contents(_path: &str) -> Option<String> { todo!() } -pub fn strtolower(s: &str) -> String { +pub fn strtolower(_s: &str) -> String { todo!() } -pub fn ctype_alnum(s: &str) -> bool { +pub fn ctype_alnum(_s: &str) -> bool { todo!() } -pub fn ord(c: &str) -> i64 { +pub fn ord(_c: &str) -> i64 { todo!() } @@ -1144,19 +1150,19 @@ pub fn gethostname() -> String { todo!() } -pub fn feof(stream: PhpMixed) -> bool { +pub fn feof(_stream: PhpMixed) -> bool { todo!() } -pub fn str_replace_array(search: &[String], replace: &[String], subject: &str) -> String { +pub fn str_replace_array(_search: &[String], _replace: &[String], _subject: &str) -> String { todo!() } -pub fn file(filename: &str, flags: i64) -> Option<Vec<String>> { +pub fn file(_filename: &str, _flags: i64) -> Option<Vec<String>> { todo!() } -pub fn ucwords(s: &str) -> String { +pub fn ucwords(_s: &str) -> String { todo!() } @@ -1166,36 +1172,36 @@ pub fn get_current_user() -> String { pub const FILE_IGNORE_NEW_LINES: i64 = 2; -pub fn array_diff(array1: &[String], array2: &[String]) -> Vec<String> { +pub fn array_diff(_array1: &[String], _array2: &[String]) -> Vec<String> { todo!() } -pub fn copy(source: &str, dest: &str) -> bool { +pub fn copy(_source: &str, _dest: &str) -> bool { todo!() } pub fn exec( - command: &str, - output: Option<&mut Vec<String>>, - exit_code: Option<&mut i64>, + _command: &str, + _output: Option<&mut Vec<String>>, + _exit_code: Option<&mut i64>, ) -> Option<String> { todo!() } -pub fn tempnam(dir: &str, prefix: &str) -> Option<String> { +pub fn tempnam(_dir: &str, _prefix: &str) -> Option<String> { todo!() } pub fn openssl_verify( - data: &str, - signature: &[u8], - pub_key_id: PhpMixed, - algorithm: PhpMixed, + _data: &str, + _signature: &[u8], + _pub_key_id: PhpMixed, + _algorithm: PhpMixed, ) -> i64 { todo!() } -pub fn openssl_pkey_get_public(public_key: &str) -> PhpMixed { +pub fn openssl_pkey_get_public(_public_key: &str) -> PhpMixed { todo!() } @@ -1203,82 +1209,82 @@ pub fn openssl_get_md_methods() -> Vec<String> { todo!() } -pub fn openssl_free_key(key: PhpMixed) { +pub fn openssl_free_key(_key: PhpMixed) { todo!() } -pub fn iterator_to_array<T>(iter: T) -> Vec<PhpMixed> +pub fn iterator_to_array<T>(_iter: T) -> Vec<PhpMixed> where T: IntoIterator<Item = PhpMixed>, { todo!() } -pub fn end_arr<V: Clone>(array: &IndexMap<String, V>) -> Option<V> { +pub fn end_arr<V: Clone>(_array: &IndexMap<String, V>) -> Option<V> { todo!() } -pub fn fileowner(filename: &str) -> Option<i64> { +pub fn fileowner(_filename: &str) -> Option<i64> { todo!() } -pub fn unlink_silent(path: &str) -> bool { +pub fn unlink_silent(_path: &str) -> bool { todo!() } -pub fn array_unique<T: Clone>(array: &[T]) -> Vec<T> { +pub fn array_unique<T: Clone>(_array: &[T]) -> Vec<T> { todo!() } -pub fn current(value: PhpMixed) -> PhpMixed { +pub fn current(_value: PhpMixed) -> PhpMixed { todo!() } -pub fn key(value: PhpMixed) -> Option<String> { +pub fn key(_value: PhpMixed) -> Option<String> { todo!() } -pub fn reset<T: Clone>(array: &[T]) -> Option<T> { +pub fn reset<T: Clone>(_array: &[T]) -> Option<T> { todo!() } pub const OPENSSL_ALGO_SHA384: i64 = 9; pub fn array_intersect_key( - array1: &IndexMap<String, Box<PhpMixed>>, - array2: &IndexMap<String, Box<PhpMixed>>, + _array1: &IndexMap<String, Box<PhpMixed>>, + _array2: &IndexMap<String, Box<PhpMixed>>, ) -> IndexMap<String, Box<PhpMixed>> { todo!() } -pub fn is_file(path: &str) -> bool { +pub fn is_file(_path: &str) -> bool { todo!() } -pub fn spl_object_hash<T: ?Sized>(object: &T) -> String { +pub fn spl_object_hash<T: ?Sized>(_object: &T) -> String { todo!() } -pub fn serialize(value: &PhpMixed) -> String { +pub fn serialize(_value: &PhpMixed) -> String { todo!() } pub fn stream_context_create( - options: &IndexMap<String, PhpMixed>, - params: Option<&IndexMap<String, PhpMixed>>, + _options: &IndexMap<String, PhpMixed>, + _params: Option<&IndexMap<String, PhpMixed>>, ) -> PhpMixed { todo!() } -pub fn stripos(haystack: &str, needle: &str) -> Option<usize> { +pub fn stripos(_haystack: &str, _needle: &str) -> Option<usize> { todo!() } -pub fn php_uname(mode: &str) -> String { +pub fn php_uname(_mode: &str) -> String { todo!() } -pub fn uasort<F>(array: &mut Vec<String>, compare: F) +pub fn uasort<F>(_array: &mut Vec<String>, _compare: F) where F: Fn(&str, &str) -> i64, { @@ -1286,8 +1292,8 @@ where } pub fn array_replace_recursive( - base: IndexMap<String, PhpMixed>, - replacement: IndexMap<String, PhpMixed>, + _base: IndexMap<String, PhpMixed>, + _replacement: IndexMap<String, PhpMixed>, ) -> IndexMap<String, PhpMixed> { todo!() } @@ -1303,7 +1309,7 @@ pub const GLOB_MARK: i64 = 8; pub const GLOB_ONLYDIR: i64 = 1024; pub const GLOB_BRACE: i64 = 4096; -pub fn glob_with_flags(pattern: &str, flags: i64) -> Vec<String> { +pub fn glob_with_flags(_pattern: &str, _flags: i64) -> Vec<String> { todo!() } @@ -1311,11 +1317,11 @@ pub fn time() -> i64 { todo!() } -pub fn date(format: &str, timestamp: Option<i64>) -> String { +pub fn date(_format: &str, _timestamp: Option<i64>) -> String { todo!() } -pub fn trigger_error(message: &str, error_level: i64) { +pub fn trigger_error(_message: &str, _error_level: i64) { todo!() } @@ -1323,7 +1329,7 @@ pub fn sys_get_temp_dir() -> String { todo!() } -pub fn json_decode(s: &str, assoc: bool) -> anyhow::Result<PhpMixed> { +pub fn json_decode(_s: &str, _assoc: bool) -> anyhow::Result<PhpMixed> { todo!() } @@ -1336,11 +1342,11 @@ pub fn http_build_query_mixed( todo!() } -pub fn http_build_query(data: &[(&str, &str)], sep_str: &str, sep: &str) -> String { +pub fn http_build_query(_data: &[(&str, &str)], _sep_str: &str, _sep: &str) -> String { todo!() } -pub fn token_get_all(source: &str) -> Vec<PhpMixed> { +pub fn token_get_all(_source: &str) -> Vec<PhpMixed> { todo!() } @@ -1348,11 +1354,11 @@ pub const T_COMMENT: i64 = 315; pub const T_DOC_COMMENT: i64 = 316; pub const T_WHITESPACE: i64 = 317; -pub fn dirname_levels(path: &str, levels: i64) -> String { +pub fn dirname_levels(_path: &str, _levels: i64) -> String { todo!() } -pub fn strtr_array(s: &str, pairs: &IndexMap<String, String>) -> String { +pub fn strtr_array(_s: &str, _pairs: &IndexMap<String, String>) -> String { todo!() } @@ -1365,27 +1371,27 @@ pub fn array_search_mixed( todo!() } -pub fn array_search(needle: &str, haystack: &IndexMap<String, String>) -> Option<String> { +pub fn array_search(_needle: &str, _haystack: &IndexMap<String, String>) -> Option<String> { todo!() } -pub fn strcmp(s1: &str, s2: &str) -> i64 { +pub fn strcmp(_s1: &str, _s2: &str) -> i64 { todo!() } -pub fn rtrim(s: &str, chars: Option<&str>) -> String { +pub fn rtrim(_s: &str, _chars: Option<&str>) -> String { todo!() } -pub fn rmdir(dir: &str) -> bool { +pub fn rmdir(_dir: &str) -> bool { todo!() } -pub fn is_link(path: &str) -> bool { +pub fn is_link(_path: &str) -> bool { todo!() } -pub fn str_pad(input: &str, length: usize, pad_string: &str, pad_type: i64) -> String { +pub fn str_pad(_input: &str, _length: usize, _pad_string: &str, _pad_type: i64) -> String { todo!() } @@ -1393,29 +1399,29 @@ pub const STR_PAD_LEFT: i64 = 0; pub const STR_PAD_RIGHT: i64 = 1; pub const STR_PAD_BOTH: i64 = 2; -pub fn abs(value: i64) -> i64 { +pub fn abs(_value: i64) -> i64 { todo!() } pub const DATE_ATOM: &str = "Y-m-d\\TH:i:sP"; -pub fn ucfirst(s: &str) -> String { +pub fn ucfirst(_s: &str) -> String { todo!() } -pub fn strval(value: &PhpMixed) -> String { +pub fn strval(_value: &PhpMixed) -> String { todo!() } -pub fn usleep(microseconds: u64) { +pub fn usleep(_microseconds: u64) { todo!() } -pub fn mb_strlen(s: &str, encoding: &str) -> i64 { +pub fn mb_strlen(_s: &str, _encoding: &str) -> i64 { todo!() } -pub fn stream_isatty(stream: PhpMixed) -> bool { +pub fn stream_isatty(_stream: PhpMixed) -> bool { todo!() } @@ -1427,40 +1433,40 @@ pub fn posix_geteuid() -> i64 { todo!() } -pub fn posix_getpwuid(uid: i64) -> PhpMixed { +pub fn posix_getpwuid(_uid: i64) -> PhpMixed { todo!() } -pub fn posix_isatty(stream: PhpMixed) -> bool { +pub fn posix_isatty(_stream: PhpMixed) -> bool { todo!() } -pub fn fstat(stream: PhpMixed) -> PhpMixed { +pub fn fstat(_stream: PhpMixed) -> PhpMixed { todo!() } -pub fn getenv(name: &str) -> Option<String> { +pub fn getenv(_name: &str) -> Option<String> { todo!() } -pub fn putenv(setting: &str) -> bool { +pub fn putenv(_setting: &str) -> bool { todo!() } /// PHP superglobal $_SERVER access -pub fn server_get(name: &str) -> Option<String> { +pub fn server_get(_name: &str) -> Option<String> { todo!() } -pub fn server_set(name: &str, value: String) { +pub fn server_set(_name: &str, _value: String) { todo!() } -pub fn server_unset(name: &str) { +pub fn server_unset(_name: &str) { todo!() } -pub fn server_contains_key(name: &str) -> bool { +pub fn server_contains_key(_name: &str) -> bool { todo!() } @@ -1469,83 +1475,83 @@ pub fn server_argv() -> Vec<String> { } /// PHP superglobal $_ENV access -pub fn env_get(name: &str) -> Option<String> { +pub fn env_get(_name: &str) -> Option<String> { todo!() } -pub fn env_set(name: &str, value: String) { +pub fn env_set(_name: &str, _value: String) { todo!() } -pub fn env_unset(name: &str) { +pub fn env_unset(_name: &str) { todo!() } -pub fn env_contains_key(name: &str) -> bool { +pub fn env_contains_key(_name: &str) -> bool { todo!() } -pub fn trim(s: &str, chars: Option<&str>) -> String { +pub fn trim(_s: &str, _chars: Option<&str>) -> String { todo!() } -pub fn count(value: &PhpMixed) -> i64 { +pub fn count(_value: &PhpMixed) -> i64 { todo!() } -pub fn array_shift<T>(array: &mut Vec<T>) -> Option<T> { +pub fn array_shift<T>(_array: &mut Vec<T>) -> Option<T> { todo!() } -pub fn array_pop<T>(array: &mut Vec<T>) -> Option<T> { +pub fn array_pop<T>(_array: &mut Vec<T>) -> Option<T> { todo!() } -pub fn array_unshift<T>(array: &mut Vec<T>, value: T) { +pub fn array_unshift<T>(_array: &mut Vec<T>, _value: T) { todo!() } -pub fn array_reverse<T: Clone>(array: &[T], preserve_keys: bool) -> Vec<T> { +pub fn array_reverse<T: Clone>(_array: &[T], _preserve_keys: bool) -> Vec<T> { todo!() } -pub fn array_filter<T: Clone, F>(array: &[T], callback: F) -> Vec<T> +pub fn array_filter<T: Clone, F>(_array: &[T], _callback: F) -> Vec<T> where F: Fn(&T) -> bool, { todo!() } -pub fn array_all<T, F>(array: &[T], callback: F) -> bool +pub fn array_all<T, F>(_array: &[T], _callback: F) -> bool where F: Fn(&T) -> bool, { todo!() } -pub fn array_any<T, F>(array: &[T], callback: F) -> bool +pub fn array_any<T, F>(_array: &[T], _callback: F) -> bool where F: Fn(&T) -> bool, { todo!() } -pub fn array_reduce<T, U, F>(array: &[T], callback: F, initial: U) -> U +pub fn array_reduce<T, U, F>(_array: &[T], _callback: F, _initial: U) -> U where F: Fn(U, &T) -> U, { todo!() } -pub fn array_intersect<T: Clone + PartialEq>(array1: &[T], array2: &[T]) -> Vec<T> { +pub fn array_intersect<T: Clone + PartialEq>(_array1: &[T], _array2: &[T]) -> Vec<T> { todo!() } -pub fn mkdir(pathname: &str, mode: u32, recursive: bool) -> bool { +pub fn mkdir(_pathname: &str, _mode: u32, _recursive: bool) -> bool { todo!() } -pub fn rename(old_name: &str, new_name: &str) -> bool { +pub fn rename(_old_name: &str, _new_name: &str) -> bool { todo!() } @@ -1553,11 +1559,11 @@ pub fn clearstatcache() { todo!() } -pub fn disk_free_space(directory: &str) -> Option<f64> { +pub fn disk_free_space(_directory: &str) -> Option<f64> { todo!() } -pub fn filemtime(filename: &str) -> Option<i64> { +pub fn filemtime(_filename: &str) -> Option<i64> { todo!() } @@ -1567,23 +1573,23 @@ pub fn php_dir() -> String { } /// Equivalent to PHP's `require <file>` returning the file's return value -pub fn require_php_file(filename: &str) -> PhpMixed { +pub fn require_php_file(_filename: &str) -> PhpMixed { todo!() } -pub fn array_flip(array: &PhpMixed) -> PhpMixed { +pub fn array_flip(_array: &PhpMixed) -> PhpMixed { todo!() } -pub fn max(a: i64, b: i64) -> i64 { +pub fn max(_a: i64, _b: i64) -> i64 { todo!() } -pub fn array_key_exists<V>(key: &str, array: &IndexMap<String, V>) -> bool { +pub fn array_key_exists<V>(_key: &str, _array: &IndexMap<String, V>) -> bool { todo!() } -pub fn fgets(handle: PhpMixed) -> Option<String> { +pub fn fgets(_handle: PhpMixed) -> Option<String> { todo!() } @@ -1591,30 +1597,30 @@ pub fn umask() -> u32 { todo!() } -pub fn basename_with_suffix(path: &str, suffix: &str) -> String { +pub fn basename_with_suffix(_path: &str, _suffix: &str) -> String { todo!() } -pub fn inet_pton(host: &str) -> Option<Vec<u8>> { +pub fn inet_pton(_host: &str) -> Option<Vec<u8>> { todo!() } -pub fn ltrim(s: &str, chars: Option<&str>) -> String { +pub fn ltrim(_s: &str, _chars: Option<&str>) -> String { todo!() } -pub fn floor(value: f64) -> f64 { +pub fn floor(_value: f64) -> f64 { todo!() } -pub fn chr(value: u8) -> String { +pub fn chr(_value: u8) -> String { todo!() } pub fn filter_var_with_options( - value: &str, - filter: i64, - options: &IndexMap<String, PhpMixed>, + _value: &str, + _filter: i64, + _options: &IndexMap<String, PhpMixed>, ) -> PhpMixed { todo!() } @@ -1623,11 +1629,11 @@ pub fn memory_get_usage() -> i64 { todo!() } -pub fn mb_check_encoding(value: &str, encoding: &str) -> bool { +pub fn mb_check_encoding(_value: &str, _encoding: &str) -> bool { todo!() } -pub fn iconv(in_charset: &str, out_charset: &str, string: &str) -> Option<String> { +pub fn iconv(_in_charset: &str, _out_charset: &str, _string: &str) -> Option<String> { todo!() } @@ -1641,11 +1647,11 @@ pub fn json_last_error() -> i64 { todo!() } -pub fn sort<T: Ord>(array: &mut Vec<T>) { +pub fn sort<T: Ord>(_array: &mut Vec<T>) { todo!() } -pub fn sort_with_flags<T: Ord>(array: &mut Vec<T>, flags: i64) { +pub fn sort_with_flags<T: Ord>(_array: &mut Vec<T>, _flags: i64) { todo!() } @@ -1655,70 +1661,70 @@ pub const SORT_STRING: i64 = 2; pub const SORT_NATURAL: i64 = 6; pub const SORT_FLAG_CASE: i64 = 8; -pub fn usort<T, F>(array: &mut Vec<T>, compare: F) +pub fn usort<T, F>(_array: &mut Vec<T>, _compare: F) where F: FnMut(&T, &T) -> i64, { todo!() } -pub fn ksort<V>(array: &mut IndexMap<String, V>) { +pub fn ksort<V>(_array: &mut IndexMap<String, V>) { todo!() } -pub fn is_null(value: &PhpMixed) -> bool { +pub fn is_null(_value: &PhpMixed) -> bool { todo!() } -pub fn r#eval(code: &str) -> PhpMixed { +pub fn r#eval(_code: &str) -> PhpMixed { todo!() } -pub fn array_is_list(array: &PhpMixed) -> bool { +pub fn array_is_list(_array: &PhpMixed) -> bool { todo!() } pub fn array_splice<T>( - array: &mut Vec<T>, - offset: i64, - length: Option<i64>, - replacement: Vec<T>, + _array: &mut Vec<T>, + _offset: i64, + _length: Option<i64>, + _replacement: Vec<T>, ) -> Vec<T> { todo!() } -pub fn array_pop_first<T>(array: &mut Vec<T>) -> Option<T> { +pub fn array_pop_first<T>(_array: &mut Vec<T>) -> Option<T> { todo!() } -pub fn reset_first<T: Clone>(array: &[T]) -> Option<T> { +pub fn reset_first<T: Clone>(_array: &[T]) -> Option<T> { todo!() } -pub fn call_user_func<T>(callback: &str, args: &[PhpMixed]) -> T +pub fn call_user_func<T>(_callback: &str, _args: &[PhpMixed]) -> T where T: From<PhpMixed>, { todo!() } -pub fn array_merge_recursive(arrays: Vec<PhpMixed>) -> PhpMixed { +pub fn array_merge_recursive(_arrays: Vec<PhpMixed>) -> PhpMixed { todo!() } -pub fn levenshtein(string1: &str, string2: &str) -> i64 { +pub fn levenshtein(_string1: &str, _string2: &str) -> i64 { todo!() } pub fn array_slice<V: Clone>( - array: &IndexMap<String, V>, - offset: i64, - length: Option<i64>, + _array: &IndexMap<String, V>, + _offset: i64, + _length: Option<i64>, ) -> IndexMap<String, V> { todo!() } -pub fn asort<V: Ord>(array: &mut IndexMap<String, V>) { +pub fn asort<V: Ord>(_array: &mut IndexMap<String, V>) { todo!() } @@ -1726,11 +1732,11 @@ pub const PHP_INT_MAX: i64 = i64::MAX; pub const PHP_INT_MIN: i64 = i64::MIN; pub const PHP_INT_SIZE: i64 = 8; -pub fn call_user_func_array(callback: &str, args: &PhpMixed) -> PhpMixed { +pub fn call_user_func_array(_callback: &str, _args: &PhpMixed) -> PhpMixed { todo!() } -pub fn array_map<T, U, F>(callback: F, array: &[T]) -> Vec<U> +pub fn array_map<T, U, F>(_callback: F, _array: &[T]) -> Vec<U> where F: Fn(&T) -> U, { @@ -1740,11 +1746,11 @@ where impl Phar { pub const SHA512: i64 = 16; - pub fn new_phar(filename: String, flags: i64, alias: &str) -> Self { + pub fn new_phar(_filename: String, _flags: i64, _alias: &str) -> Self { todo!() } - pub fn set_signature_algorithm(&mut self, algo: i64) { + pub fn set_signature_algorithm(&mut self, _algo: i64) { todo!() } @@ -1756,16 +1762,16 @@ impl Phar { todo!() } - pub fn add_from_string(&mut self, path: &str, content: &str) { + pub fn add_from_string(&mut self, _path: &str, _content: &str) { todo!() } - pub fn set_stub(&mut self, stub: &str) { + pub fn set_stub(&mut self, _stub: &str) { todo!() } } -pub fn php_strip_whitespace(path: &str) -> String { +pub fn php_strip_whitespace(_path: &str) -> String { todo!() } @@ -1773,7 +1779,7 @@ pub fn error_get_last() -> Option<IndexMap<String, Box<PhpMixed>>> { todo!() } -pub fn is_readable(path: &str) -> bool { +pub fn is_readable(_path: &str) -> bool { todo!() } @@ -1781,11 +1787,11 @@ pub fn stream_get_wrappers() -> Vec<String> { todo!() } -pub fn php_require(file: &str) -> PhpMixed { +pub fn php_require(_file: &str) -> PhpMixed { todo!() } -pub fn intval(value: &PhpMixed) -> i64 { +pub fn intval(_value: &PhpMixed) -> i64 { todo!() } @@ -1805,26 +1811,26 @@ impl RecursiveIteratorIterator { pub const CHILD_FIRST: i64 = 16; } -pub fn recursive_directory_iterator(path: &str, flags: i64) -> RecursiveDirectoryIterator { +pub fn recursive_directory_iterator(_path: &str, _flags: i64) -> RecursiveDirectoryIterator { todo!() } pub fn recursive_iterator_iterator( - iter: RecursiveDirectoryIterator, - mode: i64, + _iter: RecursiveDirectoryIterator, + _mode: i64, ) -> RecursiveIteratorIterator { todo!() } -pub fn globals_get(name: &str) -> PhpMixed { +pub fn globals_get(_name: &str) -> PhpMixed { todo!() } -pub fn globals_set(name: &str, value: PhpMixed) { +pub fn globals_set(_name: &str, _value: PhpMixed) { todo!() } -pub fn clone<T: Clone>(value: T) -> T { +pub fn clone<T: Clone>(_value: T) -> T { todo!() } @@ -1832,7 +1838,7 @@ pub fn date_default_timezone_get() -> String { todo!() } -pub fn date_default_timezone_set(tz: &str) -> bool { +pub fn date_default_timezone_set(_tz: &str) -> bool { todo!() } @@ -1840,23 +1846,23 @@ pub fn getmypid() -> i64 { todo!() } -pub fn ini_set(varname: &str, value: &str) -> Option<String> { +pub fn ini_set(_varname: &str, _value: &str) -> Option<String> { todo!() } -pub fn is_subclass_of(object_or_class: &PhpMixed, class_name: &str, allow_string: bool) -> bool { +pub fn is_subclass_of(_object_or_class: &PhpMixed, _class_name: &str, _allow_string: bool) -> bool { todo!() } -pub fn memory_get_peak_usage(real_usage: bool) -> i64 { +pub fn memory_get_peak_usage(_real_usage: bool) -> i64 { todo!() } -pub fn register_shutdown_function(callback: Box<dyn Fn()>) { +pub fn register_shutdown_function(_callback: Box<dyn Fn()>) { todo!() } -pub fn round(value: f64, precision: i64) -> f64 { +pub fn round(_value: f64, _precision: i64) -> f64 { todo!() } @@ -1868,39 +1874,39 @@ pub fn composer_dev_warning_time() -> i64 { todo!() } -pub fn instantiate_class(class: &str, args: Vec<PhpMixed>) -> PhpMixed { +pub fn instantiate_class(_class: &str, _args: Vec<PhpMixed>) -> PhpMixed { todo!() } pub fn array_filter_use_key( - array: &IndexMap<String, PhpMixed>, - callback: Box<dyn Fn(&str) -> bool>, + _array: &IndexMap<String, PhpMixed>, + _callback: Box<dyn Fn(&str) -> bool>, ) -> IndexMap<String, PhpMixed> { todo!() } -pub fn escapeshellcmd(command: &str) -> String { +pub fn escapeshellcmd(_command: &str) -> String { todo!() } -pub fn system(command: &str, result_code: Option<&mut i64>) -> Option<String> { +pub fn system(_command: &str, _result_code: Option<&mut i64>) -> Option<String> { todo!() } -pub fn array_chunk<T: Clone>(array: &[T], size: i64, preserve_keys: bool) -> Vec<Vec<T>> { +pub fn array_chunk<T: Clone>(_array: &[T], _size: i64, _preserve_keys: bool) -> Vec<Vec<T>> { todo!() } pub fn number_format( - number: f64, - decimals: i64, - decimal_separator: &str, - thousands_separator: &str, + _number: f64, + _decimals: i64, + _decimal_separator: &str, + _thousands_separator: &str, ) -> String { todo!() } -pub fn is_executable(path: &str) -> bool { +pub fn is_executable(_path: &str) -> bool { todo!() } @@ -1916,65 +1922,65 @@ pub fn gc_enable() { todo!() } -pub fn addcslashes(string: &str, charlist: &str) -> String { +pub fn addcslashes(_string: &str, _charlist: &str) -> String { todo!() } -pub fn strnatcmp(s1: &str, s2: &str) -> i64 { +pub fn strnatcmp(_s1: &str, _s2: &str) -> i64 { todo!() } -pub fn uksort<V, F>(array: &mut IndexMap<String, V>, callback: F) +pub fn uksort<V, F>(_array: &mut IndexMap<String, V>, _callback: F) where F: FnMut(&str, &str) -> i64, { todo!() } -pub fn end<V: Clone>(array: &[V]) -> Option<V> { +pub fn end<V: Clone>(_array: &[V]) -> Option<V> { todo!() } -pub fn fileatime(filename: &str) -> Option<i64> { +pub fn fileatime(_filename: &str) -> Option<i64> { todo!() } -pub fn fread(handle: PhpMixed, length: i64) -> Option<String> { +pub fn fread(_handle: PhpMixed, _length: i64) -> Option<String> { todo!() } -pub fn lstat(filename: &str) -> Option<IndexMap<String, Box<PhpMixed>>> { +pub fn lstat(_filename: &str) -> Option<IndexMap<String, Box<PhpMixed>>> { todo!() } -pub fn react_promise_resolve(value: PhpMixed) -> PhpMixed { +pub fn react_promise_resolve(_value: PhpMixed) -> PhpMixed { todo!() } -pub fn symlink(target: &str, link: &str) -> bool { +pub fn symlink(_target: &str, _link: &str) -> bool { todo!() } pub fn array_diff_key( - array1: IndexMap<String, PhpMixed>, - array2: &IndexMap<String, PhpMixed>, + _array1: IndexMap<String, PhpMixed>, + _array2: &IndexMap<String, PhpMixed>, ) -> IndexMap<String, PhpMixed> { todo!() } -pub fn min(a: i64, b: i64) -> i64 { +pub fn min(_a: i64, _b: i64) -> i64 { todo!() } -pub fn escapeshellarg(arg: &str) -> String { +pub fn escapeshellarg(_arg: &str) -> String { todo!() } -pub fn strcspn(string: &str, characters: &str) -> usize { +pub fn strcspn(_string: &str, _characters: &str) -> usize { todo!() } -pub fn strstr(haystack: &str, needle: &str) -> Option<String> { +pub fn strstr(_haystack: &str, _needle: &str) -> Option<String> { todo!() } @@ -1986,15 +1992,15 @@ pub fn ioncube_loader_version() -> String { todo!() } -pub fn phpinfo(what: i64) { +pub fn phpinfo(_what: i64) { todo!() } -pub fn opendir(path: &str) -> Option<PhpMixed> { +pub fn opendir(_path: &str) -> Option<PhpMixed> { todo!() } -pub fn stream_copy_to_stream(source: PhpMixed, dest: PhpMixed) -> Option<i64> { +pub fn stream_copy_to_stream(_source: PhpMixed, _dest: PhpMixed) -> Option<i64> { todo!() } @@ -2016,7 +2022,7 @@ pub struct ArrayObject { } impl ArrayObject { - pub fn new(array: Option<PhpMixed>) -> Self { + pub fn new(_array: Option<PhpMixed>) -> Self { todo!() } } diff --git a/crates/shirabe-semver/src/constraint/constraint.rs b/crates/shirabe-semver/src/constraint/constraint.rs index 8db322d..f8ff04e 100644 --- a/crates/shirabe-semver/src/constraint/constraint.rs +++ b/crates/shirabe-semver/src/constraint/constraint.rs @@ -347,10 +347,10 @@ impl ConstraintInterface for Constraint { } fn get_pretty_string(&self) -> String { - if let Some(ref s) = self.pretty_string { - if !s.is_empty() { - return s.clone(); - } + if let Some(ref s) = self.pretty_string + && !s.is_empty() + { + return s.clone(); } self.__to_string() } diff --git a/crates/shirabe-semver/src/constraint/match_all_constraint.rs b/crates/shirabe-semver/src/constraint/match_all_constraint.rs index b6b2445..97ce98c 100644 --- a/crates/shirabe-semver/src/constraint/match_all_constraint.rs +++ b/crates/shirabe-semver/src/constraint/match_all_constraint.rs @@ -22,10 +22,10 @@ impl ConstraintInterface for MatchAllConstraint { } fn get_pretty_string(&self) -> String { - if let Some(ref s) = self.pretty_string { - if !s.is_empty() { - return s.clone(); - } + if let Some(ref s) = self.pretty_string + && !s.is_empty() + { + return s.clone(); } self.__to_string() } diff --git a/crates/shirabe-semver/src/constraint/match_none_constraint.rs b/crates/shirabe-semver/src/constraint/match_none_constraint.rs index 17a45bb..51e13fd 100644 --- a/crates/shirabe-semver/src/constraint/match_none_constraint.rs +++ b/crates/shirabe-semver/src/constraint/match_none_constraint.rs @@ -22,10 +22,10 @@ impl ConstraintInterface for MatchNoneConstraint { } fn get_pretty_string(&self) -> String { - if let Some(ref s) = self.pretty_string { - if !s.is_empty() { - return s.clone(); - } + if let Some(ref s) = self.pretty_string + && !s.is_empty() + { + return s.clone(); } self.__to_string() } diff --git a/crates/shirabe-semver/src/constraint/multi_constraint.rs b/crates/shirabe-semver/src/constraint/multi_constraint.rs index 29d6f5e..04e262b 100644 --- a/crates/shirabe-semver/src/constraint/multi_constraint.rs +++ b/crates/shirabe-semver/src/constraint/multi_constraint.rs @@ -270,10 +270,10 @@ impl ConstraintInterface for MultiConstraint { } fn get_pretty_string(&self) -> String { - if let Some(ref s) = self.pretty_string { - if !s.is_empty() { - return s.clone(); - } + if let Some(ref s) = self.pretty_string + && !s.is_empty() + { + return s.clone(); } self.__to_string() } diff --git a/crates/shirabe-semver/src/intervals.rs b/crates/shirabe-semver/src/intervals.rs index be7466e..898cab3 100644 --- a/crates/shirabe-semver/src/intervals.rs +++ b/crates/shirabe-semver/src/intervals.rs @@ -393,11 +393,7 @@ impl Intervals { if branches.exclude { // disjunctive constraint, so only exclude what's excluded in all constraints // !=a,!=b || !=b,!=c => !=b - branches.names = branches - .names - .into_iter() - .filter(|n| b.names.contains(n)) - .collect(); + branches.names.retain(|n| b.names.contains(n)); } else { // disjunctive constraint so exclude all names which are not explicitly // included in the alternative @@ -414,11 +410,7 @@ impl Intervals { // disjunctive constraint so exclude all names which are not explicitly // included in the alternative // !=a,!=b || (==b || ==c) => !=a - branches.names = branches - .names - .into_iter() - .filter(|n| !b.names.contains(n)) - .collect(); + branches.names.retain(|n| !b.names.contains(n)); } else { // disjunctive constraint, so just add all the other branches // (==a || ==b) || ==c => ==a || ==b || ==c @@ -438,11 +430,7 @@ impl Intervals { } else { // conjunctive, so only keep included names which are not excluded // (==a||==c) && !=a,!=b => ==c - branches.names = branches - .names - .into_iter() - .filter(|n| !b.names.contains(n)) - .collect(); + branches.names.retain(|n| !b.names.contains(n)); } } else { if branches.exclude { @@ -457,11 +445,7 @@ impl Intervals { } else { // conjunctive, so only keep names that are included in both // (==a||==b) && (==a||==c) => ==a - branches.names = branches - .names - .into_iter() - .filter(|n| b.names.contains(n)) - .collect(); + branches.names.retain(|n| b.names.contains(n)); } } } diff --git a/crates/shirabe-semver/src/version_parser.rs b/crates/shirabe-semver/src/version_parser.rs index 95149af..2c3bcc9 100644 --- a/crates/shirabe-semver/src/version_parser.rs +++ b/crates/shirabe-semver/src/version_parser.rs @@ -191,10 +191,10 @@ impl VersionParser { // a branch ending with -dev is only valid if it is numeric // if it gets prefixed with dev- it means the branch name should // have had a dev- prefix already when passed to normalize - if let Ok(normalized) = self.normalize_branch(&branch_name) { - if !normalized.starts_with("dev-") { - return Ok(normalized); - } + if let Ok(normalized) = self.normalize_branch(&branch_name) + && !normalized.starts_with("dev-") + { + return Ok(normalized); } } @@ -599,8 +599,7 @@ impl VersionParser { )?; // PHP's empty() on "0" returns true, but here we only check for truly empty/missing - let empty = - |x: &Option<String>| -> bool { x.as_deref().map_or(true, |s| s.is_empty()) }; + let empty = |x: &Option<String>| -> bool { x.as_deref().is_none_or(|s| s.is_empty()) }; // matches[12]=to minor, matches[13]=to patch, matches[15]=to stability, // matches[17]=to dev, matches[18]=to wildcard-dev @@ -645,37 +644,34 @@ impl VersionParser { let version_str = match_[2].clone().unwrap_or_default(); let op_str = match_[1].clone().unwrap_or_default(); - let version_result: anyhow::Result<String> = (|| { - match self.normalize(&version_str, None) { - Ok(v) => Ok(v), - Err(e) => { - // recover from an invalid constraint like foobar-dev which should be - // dev-foobar except if the constraint uses a known operator, in which - // case it must be a parse error - if version_str.ends_with("-dev") - && php::preg_match("{^[0-9a-zA-Z-./]+$}", &version_str, &mut Vec::new()) - > 0 - { - self.normalize( - &format!("dev-{}", &version_str[..version_str.len() - 4]), - None, - ) - } else { - Err(e) - } + let version_result: anyhow::Result<String> = (match self.normalize(&version_str, None) { + Ok(v) => Ok(v), + Err(e) => { + // recover from an invalid constraint like foobar-dev which should be + // dev-foobar except if the constraint uses a known operator, in which + // case it must be a parse error + if version_str.ends_with("-dev") + && php::preg_match("{^[0-9a-zA-Z-./]+$}", &version_str, &mut Vec::new()) > 0 + { + self.normalize( + &format!("dev-{}", &version_str[..version_str.len() - 4]), + None, + ) + } else { + Err(e) } } - })(); + }); if let Ok(mut version) = version_result { let op = if op_str.is_empty() { "=" } else { &op_str }; - if op != "==" && op != "=" { - if let Some(ref stab_mod) = stability_modifier { - if Self::parse_stability(&version) == "stable" { - version = format!("{}-{}", version, stab_mod); - } - } + if op != "==" + && op != "=" + && let Some(ref stab_mod) = stability_modifier + && Self::parse_stability(&version) == "stable" + { + version = format!("{}-{}", version, stab_mod); } if op == "<" || op == ">=" { let modifier_pattern = format!("{{-{}$}}", MODIFIER_REGEX); |
