-
Notifications
You must be signed in to change notification settings - Fork 79
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Currently, the #[prop] attribute does not handle case conversion, so we must resort to:
#[php_class]
struct Foo {
#[prop(rename = "isBar")]
pub is_bar: bool,
}which can quickly become tedious.
The #[php_class] attribute should accept a rename_fields argument similiar to rename_methods for #[php_impl], and default to camelCase.
The #[prop(rename)] argument should be kept around for corner-cases like:
#[php_class]
struct Request {
#[prop(rename = "isXMLHttpRequest")]
pub is_xml_http_request: bool,
}Although on might argue that it should be #[prop(name = ..)] and not #[prop(rename = ..)]...
For ergonomics, it could even be made into a global, project-wide, configuration option?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working