8

I've run into a problem with PHP 5.3 namespacing and Doxygen comments.

Example:

/**
 * Sample Method
 *
 * @param string $output
 * @return \Project\Lib\Rest
 */

Doxygen gives me the following warnings:

warning: Found unknown command `\Project'
warning: Found unknown command `\Lib'
warning: Found unknown command `\Rest'

What can I do to fix this or turn off \commands and only use @commands

St. John Johnson
  • 6,590
  • 7
  • 35
  • 56

1 Answers1

5

Try escaping your backslashes, i.e. use

/**
 * Sample Method
 *
 * @param string $output
 * @return \\Project\\Lib\\Rest
 */

\\ is actually a doxygen command which just prints a backslash.

See also Documenting PHP with Doxygen: The Pros and Cons:

/**
 * Sample Method
 *
 * @param string $output
 * @return Project::Lib::Rest
 */
albert
  • 8,285
  • 3
  • 19
  • 32
Chris
  • 44,602
  • 16
  • 137
  • 156
  • 1
    This isn't so great because then the double-slash will be visible for users who are just reading the source of documentation (e.g. the header file), and it could confuse them. – David Grayson Jul 22 '15 at 20:39