diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-14 03:00:27 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-14 03:02:02 +0900 |
| commit | 1378a4818fe5933867328fd4e5972ff9db240dd1 (patch) | |
| tree | 65699ab983a469495dc7412c1d173d68f92ae05b /crates/shirabe-external-packages/src/composer/pcre/unexpected_null_match_exception.rs | |
| parent | 299bf55547c92cbe8c32db2af0350ddad30b0b69 (diff) | |
| download | php-shirabe-1378a4818fe5933867328fd4e5972ff9db240dd1.tar.gz php-shirabe-1378a4818fe5933867328fd4e5972ff9db240dd1.tar.zst php-shirabe-1378a4818fe5933867328fd4e5972ff9db240dd1.zip | |
feat(pcre): implement Preg class
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/composer/pcre/unexpected_null_match_exception.rs')
| -rw-r--r-- | crates/shirabe-external-packages/src/composer/pcre/unexpected_null_match_exception.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/composer/pcre/unexpected_null_match_exception.rs b/crates/shirabe-external-packages/src/composer/pcre/unexpected_null_match_exception.rs new file mode 100644 index 0000000..513870c --- /dev/null +++ b/crates/shirabe-external-packages/src/composer/pcre/unexpected_null_match_exception.rs @@ -0,0 +1,29 @@ +//! ref: composer/vendor/composer/pcre/src/UnexpectedNullMatchException.php + +use super::pcre_exception::PcreException; + +#[derive(Debug)] +pub struct UnexpectedNullMatchException(pub PcreException); + +impl UnexpectedNullMatchException { + pub fn new(message: String) -> UnexpectedNullMatchException { + UnexpectedNullMatchException(PcreException(shirabe_php_shim::RuntimeException { + message, + code: 0, + })) + } + + pub fn from_function(_function: &str, _pattern: &str) -> UnexpectedNullMatchException { + panic!( + "fromFunction should not be called on UnexpectedNullMatchException, use PcreException" + ); + } +} + +impl std::fmt::Display for UnexpectedNullMatchException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.0) + } +} + +impl std::error::Error for UnexpectedNullMatchException {} |
