From 5aca6a5eef938b1fdedb4d14f5f7edcac91b5215 Mon Sep 17 00:00:00 2001 From: Li Zhineng Date: Mon, 28 Apr 2025 17:20:39 +0800 Subject: build data from raw html --- src/Build/CodeToNameHandler.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/Build/CodeToNameHandler.php (limited to 'src/Build/CodeToNameHandler.php') diff --git a/src/Build/CodeToNameHandler.php b/src/Build/CodeToNameHandler.php new file mode 100644 index 0000000..6aaf7a5 --- /dev/null +++ b/src/Build/CodeToNameHandler.php @@ -0,0 +1,27 @@ + + */ + private array $data = []; + + public function handle(string $code, string $name): void + { + $this->data['_'.$code] = $name; + } + + public function export(string $destination): void + { + $exported = VarExporter::export($this->data); + + file_put_contents($destination, '