From 270121b365bf36ae041696f53248b7aa7ad330fd Mon Sep 17 00:00:00 2001 From: Jrean Date: Mon, 6 Apr 2015 12:33:00 +0800 Subject: [PATCH] Allow custom visibilities for inserting class properties and/or extracting class properties. Default value privated is keept. --- plugin/php-refactoring-toolbox.vim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugin/php-refactoring-toolbox.vim b/plugin/php-refactoring-toolbox.vim index ef2b9eb..c0307d2 100644 --- a/plugin/php-refactoring-toolbox.vim +++ b/plugin/php-refactoring-toolbox.vim @@ -181,7 +181,11 @@ function! PhpExtractClassProperty() " {{{ normal mr let l:name = expand('') call s:PhpReplaceInCurrentFunction('$' . l:name . '\>', '$this->' . l:name) - call s:PhpInsertProperty(l:name, "private") + let l:visibility = inputdialog("Visibility (default is private): ") + if empty(l:visibility) + let l:visibility = 'private' + endif + call s:PhpInsertProperty(l:name, l:visibility) normal `r endfunction " }}} @@ -237,7 +241,11 @@ endfunction function! PhpCreateProperty() " {{{ let l:name = inputdialog("Name of new property: ") - call s:PhpInsertProperty(l:name, "private") + let l:visibility = inputdialog("Visibility (default is private): ") + if empty(l:visibility) + let l:visibility = 'private' + endif + call s:PhpInsertProperty(l:name, l:visibility) endfunction " }}}