Search code examples
phpphpdoc

Documenting a function with phpDocumentor's @since tag


I have a function my_function() in my project that I'd like to rename in my next release. My project is currently at version 1.0 so my next release will be 1.1.

/**
 * Summary
 *
 * @since 1.0
 */
function my_function() {
    // Stuff.
}

As you can see in the example above, I'm documenting my code with phpDocumentor docblocks. If I go ahead and change the name of this function, should I increment the @since tag to 1.1? I'm trying to understand if a function name change would mean that function is seen as a new element. Thanks in advance.


Solution

  • If your function's name will be changed, this will be another function. And users of your api or whatever should rewrite their codes, as previous function will be not supported anymore. So for a new function you should change @since attribute.