diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:25:52 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:25:52 +0900 |
| commit | 7f606f36fef0c0467c3c0db3d0da33af486dae8a (patch) | |
| tree | c3f0a3340e1dbfc5245964a775b73030d5abf44e /crates/shirabe-external-packages/src/seld/json_lint | |
| parent | 9389ddbf06f6d38445c277640cab7b2270057790 (diff) | |
| download | php-shirabe-7f606f36fef0c0467c3c0db3d0da33af486dae8a.tar.gz php-shirabe-7f606f36fef0c0467c3c0db3d0da33af486dae8a.tar.zst php-shirabe-7f606f36fef0c0467c3c0db3d0da33af486dae8a.zip | |
feat(port): add stub implementations of shirabe-external-packages
Diffstat (limited to 'crates/shirabe-external-packages/src/seld/json_lint')
4 files changed, 45 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs b/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs new file mode 100644 index 0000000..9e35396 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct DuplicateKeyException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for DuplicateKeyException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for DuplicateKeyException {} 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 new file mode 100644 index 0000000..6deb13c --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/json_parser.rs @@ -0,0 +1,16 @@ +use shirabe_php_shim::PhpMixed; + +#[derive(Debug)] +pub struct JsonParser; + +impl JsonParser { + pub const DETECT_KEY_CONFLICTS: u32 = 1; + + pub fn new() -> Self { + todo!() + } + + pub fn parse(&self, json: &str, flags: u32) -> anyhow::Result<PhpMixed> { + todo!() + } +} diff --git a/crates/shirabe-external-packages/src/seld/json_lint/mod.rs b/crates/shirabe-external-packages/src/seld/json_lint/mod.rs new file mode 100644 index 0000000..fef5a26 --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/mod.rs @@ -0,0 +1,3 @@ +pub mod duplicate_key_exception; +pub mod json_parser; +pub mod parsing_exception; diff --git a/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs b/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs new file mode 100644 index 0000000..3ec6b6b --- /dev/null +++ b/crates/shirabe-external-packages/src/seld/json_lint/parsing_exception.rs @@ -0,0 +1,13 @@ +#[derive(Debug)] +pub struct ParsingException { + pub message: String, + pub code: i64, +} + +impl std::fmt::Display for ParsingException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.message) + } +} + +impl std::error::Error for ParsingException {} |
