From 4e8bec79953a7d01456ef88ae72a161b62d7678d Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Wed, 19 Jul 2023 13:13:12 +0200 Subject: [PATCH] Add helper for class name (#255) --- src/zend/class.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/zend/class.rs b/src/zend/class.rs index dc06a3285..6e7f7961d 100644 --- a/src/zend/class.rs +++ b/src/zend/class.rs @@ -79,6 +79,10 @@ impl ClassEntry { Self::try_find(name.as_str().ok()?) } } + + pub fn name(&self) -> Option<&str> { + unsafe { self.name.as_ref().and_then(|s| s.as_str().ok()) } + } } impl PartialEq for ClassEntry {