5

I've switched to PHP 5.3 and the namespaces. It seems like the @package tag is redundant and useless now.

Is it still required by phpDoc, or can I ignore this tag now ?

Thanks

Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261

2 Answers2

5

It is not required.

Latest doc now states that @package should be avoided if you use namespace and you don't need a different structure for documentation:

If, across the board, both logical and functional subdivisions are equal is it NOT RECOMMENDED to use the @package tag, to prevent maintenance overhead.

http://phpdoc.org/docs/latest/references/phpdoc/tags/package.html

PowerKiKi
  • 4,539
  • 4
  • 39
  • 47
1

@package is not related to namespaces but to organizing the resulting documentation.

Packages are used to help you logically group related elements. phpDoc manual

EDIT:

Is there any replacement for PHPDocumentor that supports PHP 5.3?

Community
  • 1
  • 1
Raffael
  • 19,547
  • 15
  • 82
  • 160
  • How is "logically group related elements" different from namespaces ? I mean if that was up to me, I'd like my documentation grouped by namespaces now. What i'm wondering is : does the @package tag adds something more than namespaces ? (well except that for now it's the only way to organise the generated documentation) – Matthieu Napoli Mar 28 '11 at 19:35
  • @package simply has nothing todo with namespaces. namespace organize the code, @package organizes the doc. and they do that in completely independent and different ways. See edit for link. – Raffael Mar 28 '11 at 19:38