@@ -8,7 +8,7 @@ use syn::{Expr, Ident, ItemImpl};
8
8
use crate :: constant:: PhpConstAttribute ;
9
9
use crate :: function:: { Args , CallType , Function , MethodReceiver } ;
10
10
use crate :: helpers:: get_docs;
11
- use crate :: parsing:: { MethodRename , PhpRename , Rename , RenameRule , Visibility } ;
11
+ use crate :: parsing:: { PhpRename , RenameRule , Visibility } ;
12
12
use crate :: prelude:: * ;
13
13
14
14
/// Method types.
@@ -48,8 +48,7 @@ pub fn parser(mut input: ItemImpl) -> Result<TokenStream> {
48
48
let mut parsed = ParsedImpl :: new (
49
49
path,
50
50
args. rename_methods . unwrap_or ( RenameRule :: Camel ) ,
51
- args. rename_constants
52
- . unwrap_or ( RenameRule :: ScreamingSnakeCase ) ,
51
+ args. rename_constants . unwrap_or ( RenameRule :: ScreamingSnake ) ,
53
52
) ;
54
53
parsed. parse ( input. items . iter_mut ( ) ) ?;
55
54
@@ -184,8 +183,9 @@ impl<'a> ParsedImpl<'a> {
184
183
match items {
185
184
syn:: ImplItem :: Const ( c) => {
186
185
let attr = PhpConstAttribute :: from_attributes ( & c. attrs ) ?;
187
- let name = c. ident . rename ( self . rename_constants ) ;
188
- let name = attr. rename . rename ( name) ;
186
+ let name = attr
187
+ . rename
188
+ . rename ( c. ident . to_string ( ) , self . rename_constants ) ;
189
189
let docs = get_docs ( & attr. attrs ) ?;
190
190
c. attrs . retain ( |attr| !attr. path ( ) . is_ident ( "php" ) ) ;
191
191
@@ -197,8 +197,9 @@ impl<'a> ParsedImpl<'a> {
197
197
}
198
198
syn:: ImplItem :: Fn ( method) => {
199
199
let attr = PhpFunctionImplAttribute :: from_attributes ( & method. attrs ) ?;
200
- let name = method. sig . ident . rename_method ( self . rename_methods ) ;
201
- let name = attr. rename . rename ( name) ;
200
+ let name = attr
201
+ . rename
202
+ . rename_method ( method. sig . ident . to_string ( ) , self . rename_methods ) ;
202
203
let docs = get_docs ( & attr. attrs ) ?;
203
204
method. attrs . retain ( |attr| !attr. path ( ) . is_ident ( "php" ) ) ;
204
205
0 commit comments