@@ -90,7 +90,7 @@ let s:php_regex_ns_line = '^namespace\_s\+[\\_A-Za-z0-9]*\_s*[;{]'
90
90
let s: php_regex_use_line = ' ^use\_s\+[\\_A-Za-z0-9]\+\%(\_s\+as\_s\+[_A-Za-z0-9]\+\)\?\_s*\%(,\_s\+[\\_A-Za-z0-9]\+\%(\_s\+as\_s\+[_A-Za-z0-9]\+\)\?\_s*\)*;'
91
91
let s: php_regex_class_line = ' ^\%(\%(final\s\+\|abstract\s\+\)\?class\>\|trait\>\)'
92
92
let s: php_regex_const_line = ' ^\s*const\s\+[^;]\+;'
93
- let s: php_regex_member_line = ' ^\s*\%(\%(private\|protected\|public\|static\)\s*\)\+\$'
93
+ let s: php_regex_member_line = ' ^\s*\%(\%(private\|protected\|public\|static\)\%(\_s\+?\?[\\|_A-Za-z0-9]\+\)\?\ s*\)\+\$'
94
94
let s: php_regex_func_line = ' ^\s*\%(\%(private\|protected\|public\|static\|abstract\)\s*\)*function\_s\+'
95
95
96
96
let s: php_regex_local_var = ' \$\<\%(this\>\)\@![A-Za-z0-9]*'
@@ -193,14 +193,14 @@ function! PhpRenameClassVariable() " {{{
193
193
let l: oldName = substitute (expand (' <cword>' ), ' ^\$*' , ' ' , ' ' )
194
194
let l: newName = inputdialog (' Rename ' . l: oldName . ' to: ' )
195
195
if g: vim_php_refactoring_auto_validate_rename == 0
196
- if s: PhpSearchInCurrentClass (' \C\%(\%(\%(public\|protected\|private\|static\)\_s\+\)\+\$\|$this->\)\@<=' . l: newName . ' \>' , ' n' ) > 0
196
+ if s: PhpSearchInCurrentClass (' \C\%(\%(\%(public\|protected\|private\|static\)\%(\_s\+?\?[\\|_A-Za-z0-9]\+\)\?\ _s\+\)\+\$\|$this->\)\@<=' . l: newName . ' \>' , ' n' ) > 0
197
197
call s: PhpEchoError (l: newName . ' seems to already exist in the current class. Rename anyway ?' )
198
198
if inputlist ([" 0. No" , " 1. Yes" ]) == 0
199
199
return
200
200
endif
201
201
endif
202
202
endif
203
- call s: PhpReplaceInCurrentClass (' \C\%(\%(\%(public\|protected\|private\|static\)\_s\+\)\+\$\|$this->\)\@<=' . l: oldName . ' \>' , l: newName )
203
+ call s: PhpReplaceInCurrentClass (' \C\%(\%(\%(public\|protected\|private\|static\)\%(\_s\+?\?[\\|_A-Za-z0-9]\+\)\?\ _s\+\)\+\$\|$this->\)\@<=' . l: oldName . ' \>' , l: newName )
204
204
endfunction
205
205
" }}}
206
206
0 commit comments