We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, the #[prop] attribute does not handle case conversion, so we must resort to:
#[prop]
#[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.
#[php_class]
rename_fields
rename_methods
#[php_impl]
camelCase
The #[prop(rename)] argument should be kept around for corner-cases like:
#[prop(rename)]
#[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 = ..)]...
#[prop(name = ..)]
#[prop(rename = ..)]
For ergonomics, it could even be made into a global, project-wide, configuration option?
The text was updated successfully, but these errors were encountered:
Thinking about it, it should look more like :
#[php_class(field_case = "snake", method_case = "camel", constant_case = "upper")] struct Foo;
This would ease the burden of verbose repeated configuration.
Sorry, something went wrong.
Well I think you could simply rename your function and use #[allow(non_snake_case)] :)
#[allow(non_snake_case)]
No branches or pull requests
Currently, the
#[prop]
attribute does not handle case conversion, so we must resort to:which can quickly become tedious.
The
#[php_class]
attribute should accept arename_fields
argument similiar torename_methods
for#[php_impl]
, and default tocamelCase
.The
#[prop(rename)]
argument should be kept around for corner-cases like: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?
The text was updated successfully, but these errors were encountered: