diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:57 +0900 |
| commit | f31b101ce1e921a026ba234b1f0a83b0392bc118 (patch) | |
| tree | b7ac2aa84d71ebd162cc21aeab0240e7e0544988 /crates/shirabe-external-packages/src/symfony/component/finder/finder.rs | |
| parent | 5e31fa33c3b5cf726a57a063b8e7a070869250fe (diff) | |
| download | php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.gz php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.zst php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.zip | |
fix(compile): fix all remaining compile errors
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/component/finder/finder.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/symfony/component/finder/finder.rs | 41 |
1 files changed, 40 insertions, 1 deletions
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 8437ba6..466f17e 100644 --- a/crates/shirabe-external-packages/src/symfony/component/finder/finder.rs +++ b/crates/shirabe-external-packages/src/symfony/component/finder/finder.rs @@ -1,5 +1,15 @@ use crate::symfony::component::finder::spl_file_info::SplFileInfo; +/// Helper trait so `Finder::exclude` accepts both single strings and slices +/// (PHP's variadic / array argument compatibility). +pub trait IntoFinderExclude {} +impl IntoFinderExclude for &str {} +impl IntoFinderExclude for String {} +impl IntoFinderExclude for &String {} +impl IntoFinderExclude for &[String] {} +impl IntoFinderExclude for &Vec<String> {} +impl IntoFinderExclude for Vec<String> {} + #[derive(Debug)] pub struct Finder; @@ -38,7 +48,7 @@ impl Finder { todo!() } - pub fn exclude(&mut self, _exclude: &[String]) -> &mut Self { + pub fn exclude<E: IntoFinderExclude>(&mut self, _exclude: E) -> &mut Self { todo!() } @@ -54,10 +64,21 @@ impl Finder { todo!() } + pub fn not_path(&mut self, _pattern: &str) -> &mut Self { + todo!() + } + pub fn name(&mut self, _pattern: &str) -> &mut Self { todo!() } + pub fn sort<F>(&mut self, _comparator: F) -> &mut Self + where + F: FnMut(&SplFileInfo, &SplFileInfo) -> i64, + { + todo!() + } + pub fn sort_by_name(&mut self) -> &mut Self { todo!() } @@ -78,6 +99,24 @@ impl Finder { todo!(); std::iter::empty() } + + /// PHP: Finder implements Countable. + pub fn len(&self) -> usize { + todo!() + } + + pub fn is_empty(&self) -> bool { + self.len() == 0 + } +} + +impl IntoIterator for &Finder { + type Item = SplFileInfo; + type IntoIter = std::vec::IntoIter<SplFileInfo>; + + fn into_iter(self) -> Self::IntoIter { + todo!() + } } #[derive(Debug)] |
