I was wondering if there is an easier (or just any) way to declare functions in PHP files. For example, let's say we have following function:
function myfunc($parama = '', $paramb = 0) {}
Would it be possible to add (as part of PHP bundle) a snippet to create:
/***
*
*
* @param $parama String
* @param $paramb Integer
* @return
* @author
* @copyright {current_date}
*/
In case it's doable, the bundle would auto-add it just by typing /***
above function.
Any thoughts are warmly welcome. I managed to do that in TextMate a while ago, but can't figure out how to do it in Aptana.
FYI: I'm referring to Aptana 3.0.6.
Thanks! :)
...
(an hour later)
Actually, I figured it out - created a snippet for this:
snippet 'Declare Function' do |s|
s.trigger = 'docf'
s.scope = 'source.php'
s.expansion = '/***
*
*
* @param
* @return
* @author $6
* @copyright ' + Time.now.strftime('%Y-%m-%d') + '
*/
function ${1:functionName}($2)
{
$0
}'
end
Hope it's useful for other devs. :)
This is a feature of PHPed (http://www.nusphere.com/). This has been my IDE of choice for the past 4 years. After a function has been defined, you start the comment block with:
/**
And press enter. It reads the function signature and generates some nice javadoc comments, much like the ones you've provided above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With