phpDocumentor phpDocumentor
[ class tree: phpDocumentor ] [ index: phpDocumentor ] [ all elements ]
Prev Next

@var

Document the data type of a class variable

by Gregory Beaver
Tag Documentation written by [email protected]
Copyright 2002, Gregory Beaver
(phpDocumentor 0.4.1+)
@var datatype description

Description

You may use the @var tag to document the data type of class variables.

The datatype should be a valid PHP type (int, string, bool, etc), a class name for the type of object, or simply "mixed". phpDocumentor will display the optional description unmodified, and defaults to "mixed" if the datatype is not present

Example

Here's an example:

  1. class class1
  2. {
  3.    /**
  4.     * example of documenting a variable's type
  5.     * @var string 
  6.     */
  7.    var $variable;
  8.    /**
  9.     * example of documenting a variable's type
  10.     * @var string contains class1 information
  11.     */
  12.    var $variable_with_desc;
  13.    /**
  14.     * this variable is documented as type "mixed" since no @var tag is present
  15.     */
  16.    var $mixed_variable;
  17. }

Prev Up Next
@uses phpDocumentor tags @version

Documentation generated on Tue, 06 Dec 2011 07:15:56 -0600 by phpDocumentor 1.4.4