Extract name from a property access like `$user->email`.
(expr: &str)
| 301 | |
| 302 | /// Extract name from a property access like `$user->email`. |
| 303 | fn extract_property_name(expr: &str) -> Option<String> { |
| 304 | let name_part = find_last_member_access(expr)?; |
| 305 | |
| 306 | // Must NOT contain `(` (that would be a method call) |
| 307 | if name_part.contains('(') { |
| 308 | return None; |
| 309 | } |
| 310 | |
| 311 | let ident = name_part.trim(); |
| 312 | if ident.is_empty() { |
| 313 | return None; |
| 314 | } |
| 315 | |
| 316 | Some(to_camel_case(ident)) |
| 317 | } |
| 318 | |
| 319 | /// Extract name from a static call like `Carbon::now()`. |
| 320 | fn extract_static_call_name(expr: &str) -> Option<String> { |
no test coverage detected