Documenting properties and variables

The following code is the DataLine class that has been used for the date amfPHP tutorials. It has phpdoc tags added for the documentation example. This tutorial requires you to:

  • Follow what is written in this code sample
  • Compare the tags used in the code sample with the phpdoc.org website
  • View the generated output

Make sure you check out my other tutorial on documenting properties.

Just be careful if you copy and paste because Drupal has done some interesting things with the hyperlinks in the source code.

<?php
/**
* DataLine.php
*
* this is a page-level doc.  Stuff related to this package or file would normally be placed here...
* @package RPC
* @author brent
* @version 1
*/
 
/**
* This is a VO, and is used for demonstration purposes of RPC with Flex using the Bravo class.  
*
* This Value Object covers strings, integers and dates.  The name of the variables indicates the type that it is.
*
* Pay attention to the placement of the @var keyword.  Get it out of order and its not pleasant. 
*
* @package 		RPC
* @author       Brent Knigge
* @copyright    20 January 2013
* @version 1
* @link  <a href="http://www.brentknigge.com/?q=node/505">http://www.brentknigge.com/?q=node/505</a> View the contents of this file.
*/
class DataLine
//********************************************************************
{
/**
* @var int 
* Primary Key.
*
* The documentation of properties only supports one line descriptors!
*/ 
public $some_id;   
 
/**
* @var int
* This is used to store integer values
*/
public $some_int; 
 
/**
* @var string
* some_char is used for strings
*/
public $some_char;
 
/**
* @var date
* some_date is used for date objects
*/
public $some_date;
};
 
?>