Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Skip printing the @return tag for __construct functions: we know the …

…return type (the class it’s implemented in), but rather than trying to parse the file for the classname, we assume that the doc-generator library is smart enough to work it out, so we leave out the return type

git-svn-id: http://svn.textmate.org/trunk/Bundles/PHP.tmbundle@9488 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
commit 0ae080e4a422039279adc9e3d39b84aa28dfd996 1 parent 5540e4c
@ciaran ciaran authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 Commands/Post-doc.tmCommand
View
7 Commands/Post-doc.tmCommand
@@ -23,13 +23,14 @@ case next_line
when /(class|interface)/
type = $&
tag 'package', 'default'
-when /function\s*\w+\((.*)\)/
+when /function\s*(\w+)\((.*)\)/
+ function_name, args = $1, $2
type = 'function'
- $1.split(/,/).each do |arg|
+ args.split(/,/).each do |arg|
arg.strip =~ /(?:(\w+)\s*)?\$([A-z0-9]+)/
tag 'param', $1 || 'string', "\\$" + $2
end
- tag 'return', 'void'
+ tag 'return', 'void' unless function_name == '__construct'
when /const|define/
type = 'constant'
author = false
Please sign in to comment.
Something went wrong with that request. Please try again.