Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tags
*.pyc
11 changes: 9 additions & 2 deletions ftplugin/php_documentor.vim
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ let g:pdv_re_abstract = '\(abstract\)'
let g:pdv_re_final = '\(final\)'

" [:space:]*(private|protected|public|static|abstract)*[:space:]+[:identifier:]+\([:params:]\)
let g:pdv_re_func = '^\s*\([a-zA-Z ]*\)function\s\+\([^ (]\+\)\s*(\s*\(.*\)\s*)\s*[{;]\?$'
let g:pdv_re_func = '^\s*\([a-zA-Z ]*\)function\s\+\([^ (]\+\)\s*(\s*\(.*\)\s*)\(\s*:\(.*\)\)\?\s*[{;]\?$'

" [:typehint:]*[:space:]*$[:identifier]\([:space:]*=[:space:]*[:value:]\)?
let g:pdv_re_param = ' *\([^ &]*\) *&\?\$\([A-Za-z_][A-Za-z0-9_]*\) *=\? *\(.*\)\?$'

Expand Down Expand Up @@ -291,6 +292,7 @@ func! PhpDocFunc()
let l:modifier = substitute (l:name, g:pdv_re_func, '\1', "g")
let l:funcname = substitute (l:name, g:pdv_re_func, '\2', "g")
let l:parameters = substitute (l:name, g:pdv_re_func, '\3', "g") . ","
let l:returntype = substitute (l:name, g:pdv_re_func, '\5', "g")
let l:scope = PhpDocScope(l:modifier, l:funcname)
let l:static = g:pdv_cfg_php4always == 1 ? matchstr(l:modifier, g:pdv_re_static) : ""
let l:abstract = g:pdv_cfg_php4always == 1 ? matchstr(l:modifier, g:pdv_re_abstract) : ""
Expand Down Expand Up @@ -339,7 +341,12 @@ func! PhpDocFunc()
if l:scope != ""
call add(l:comment_lines, l:indent . g:pdv_cfg_Commentn . " @access " . l:scope)
endif
call add(l:comment_lines, l:indent . g:pdv_cfg_Commentn . " @return " . g:pdv_cfg_ReturnVal)
" Default return type from config
if l:returntype == ""
let l:returntype = g:pdv_cfg_ReturnVal
endif
call add(l:comment_lines, l:indent . g:pdv_cfg_Commentn)
call add(l:comment_lines, l:indent . g:pdv_cfg_Commentn . " @return " . l:returntype)

" Close the comment block.
call add(l:comment_lines, l:indent . g:pdv_cfg_CommentTail)
Expand Down