aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-17 01:44:24 +0900
committernsfisis <nsfisis@gmail.com>2026-05-17 01:44:24 +0900
commit527d27cef0fe71357c944ee7faed02a6f506488e (patch)
tree4cec56842a90dd5c10b78be4a0b2a82985dfcd93 /crates
parentedf934ba867fa917dd29e4fa2cc86bbef37da96b (diff)
downloadphp-shirabe-527d27cef0fe71357c944ee7faed02a6f506488e.tar.gz
php-shirabe-527d27cef0fe71357c944ee7faed02a6f506488e.tar.zst
php-shirabe-527d27cef0fe71357c944ee7faed02a6f506488e.zip
feat(port): port FileList.php
Diffstat (limited to 'crates')
-rw-r--r--crates/shirabe-class-map-generator/Cargo.toml8
-rw-r--r--crates/shirabe-class-map-generator/src/file_list.rs19
2 files changed, 27 insertions, 0 deletions
diff --git a/crates/shirabe-class-map-generator/Cargo.toml b/crates/shirabe-class-map-generator/Cargo.toml
new file mode 100644
index 0000000..c913bce
--- /dev/null
+++ b/crates/shirabe-class-map-generator/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "shirabe-class-map-generator"
+version.workspace = true
+edition.workspace = true
+
+[dependencies]
+shirabe-php-shim.workspace = true
+anyhow.workspace = true
diff --git a/crates/shirabe-class-map-generator/src/file_list.rs b/crates/shirabe-class-map-generator/src/file_list.rs
new file mode 100644
index 0000000..8647dbd
--- /dev/null
+++ b/crates/shirabe-class-map-generator/src/file_list.rs
@@ -0,0 +1,19 @@
+//! ref: composer/vendor/composer/class-map-generator/src/FileList.php
+
+use indexmap::IndexMap;
+
+/// Contains a list of files which were scanned to generate a classmap
+#[derive(Debug)]
+pub struct FileList {
+ pub files: IndexMap<String, bool>,
+}
+
+impl FileList {
+ pub fn add(&mut self, path: String) {
+ self.files.insert(path, true);
+ }
+
+ pub fn contains(&self, path: &str) -> bool {
+ self.files.contains_key(path)
+ }
+}