0

I use phpdocumentor tags to document my php codes classes and function, as shown below

/**
* Module for Car 
* @category Vehicle
* @version  2.0
* @since    1.0
* @link     http://api.abc.example.com/v2.0/docs/#!/car
*/

My question is that, is there way to dynamically change @version and @link values. As if the version change, I do not want to go to every class and function to update the @version ad @link fields. If my system version change from v2.0 to 3.0 I would have to change documentation for all my classes and functions

/**
* Module for Car 
* @category Vehicle
* @version  3.0
* @since    1.0
* @link     http://api.abc.example.com/v3.0/docs/#!/car
*/

Its a tedious works to do so :-).

Any suggestions?

Manjunath Reddy
  • 1,039
  • 2
  • 13
  • 22
  • if you dont change anything in a class, dont change the version number. – Grumpy Jul 23 '14 at 09:50
  • @Grumpy, Thanks for the reply :-). My system is actually an API, so, I version the API with v2.0 or 3.0, So version refers to API version not to individual class or method. However, I tag version in all my classes and method to keep up to date on which method or class was added on which version of the API. – Manjunath Reddy Jul 23 '14 at 10:21
  • Sounds to me like you're hoping for something akin to "keyword expansion" like CVS and SVN have (http://stackoverflow.com/questions/39742/does-git-have-anything-like-svn-propset-svnkeywords-or-pre-post-commit-hooks). Its availability will depend on which VCS you use. – ashnazg Jul 23 '14 at 20:05

1 Answers1

0

Many editors have function replace in files. You can set path and simply replace:

@version  2.0

to

@version  3.0

The same with the second string

Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
  • Thanks :-), I do not want to use the 'Find and replace' method, as it require me to commit all my files again back to source control, I want to avoid committing lot of files just because of changing the version number. However, I would like to configure version number some where in the system root level and refer to version dynamically. – Manjunath Reddy Jul 23 '14 at 10:22