views:

38

answers:

1

All the files in the code base I am documenting will always use the same version "string" Is there a way I can specific in a single place for the PhpDocumentor to use the same version for all files, regardless if it is specified or not (should auto-inherit)

...and what other tags would this be useful for off the top of your head?

Edit:

Anything that could get around parent-child relations? Something like a .ini or configuration file for reading in the version, author, copyright?

A: 

I am not aware PHPDocumentor allows anything like this.

Also, having the same version on all files seems wrong usage to me. The version annotation gives the version for a specific file. If you was to fix a bug in Class A, why would the version of Class B change?

As for inserting the same annotations across multiple documents, I suggest to look into your IDEs templating feature. Usually, you can configure snippets like this and insert them with keyboard shortcuts or when creating new files.

Another option would be to set and replace annotations values when creating the documentation through a deploy script, like Phing or Ant or through a pre-commit hook in your code repository.


EDIT Going through the phpdocumentor manual again, I found this:

The {@inheritdoc} inline tag is used in the DocBlocks of classes, methods and class variables of child classes. phpDocumentor will automatically inherit the @author tag, @version tag, and @copyright tag from a parent class. In addition, if there is no documentation comment present, it will inherit the parent's documentation.

Note that if the {@inheritdoc} inline tag is not present, and a child class is undocumented, the child class will still attempt to inherit documentation from the parent class as is. {@inheritdoc} allows flexibility of where to put documentation from the parent class in a child class's documentation.

It's not exactly what you are looking for, but it's a similar direction.

Gordon
That is kind of confusing. At one part I agree there should be a way to track a version of a file, on the other the "released" documentation should be for version X.Y.Z. I'll look at IDE settings again thanks :)
Urda
@Urda You could handle this by tagging or branching your application in your sourcecode repository. I've also updated the answers once more.
Gordon
@Gordon Funny story about inheritdoc. I can never seem to get it to work as expected. Tried messing with it for about two hours on Friday.
Urda