pub struct PHPBackend { /* private fields */ }Expand description
PHP 8.x code generation backend for OxiLean.
Implementations§
Source§impl PHPBackend
impl PHPBackend
Sourcepub fn with_indent(indent: impl Into<String>) -> Self
pub fn with_indent(indent: impl Into<String>) -> Self
Create a PHPBackend with a custom indent string.
Sourcepub fn mangle_name(&self, name: &str) -> String
pub fn mangle_name(&self, name: &str) -> String
Mangle an OxiLean name to a valid PHP identifier.
PHP identifiers must match [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*.
Sourcepub fn emit_function(&self, func: &PHPFunction) -> String
pub fn emit_function(&self, func: &PHPFunction) -> String
Emit a PHP function (top-level or standalone).
Sourcepub fn emit_interface(&self, iface: &PHPInterface) -> String
pub fn emit_interface(&self, iface: &PHPInterface) -> String
Emit a PHP interface declaration.
Sourcepub fn emit_trait(&self, tr: &PHPTrait) -> String
pub fn emit_trait(&self, tr: &PHPTrait) -> String
Emit a PHP trait declaration.
Sourcepub fn emit_class(&self, class: &PHPClass) -> String
pub fn emit_class(&self, class: &PHPClass) -> String
Emit a PHP class declaration.
Sourcepub fn emit_script(&self, script: &PHPScript) -> String
pub fn emit_script(&self, script: &PHPScript) -> String
Emit a complete PHP script.
Sourcepub fn emit_namespace(&self, ns: &PHPNamespace) -> String
pub fn emit_namespace(&self, ns: &PHPNamespace) -> String
Emit a namespace block.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PHPBackend
impl RefUnwindSafe for PHPBackend
impl Send for PHPBackend
impl Sync for PHPBackend
impl Unpin for PHPBackend
impl UnsafeUnpin for PHPBackend
impl UnwindSafe for PHPBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more