
Order and Spacing
27
Order and Spacing
To ease long term readability of source code, the text and tags must conform to the order and spacing
provided in the example above. This standard is adopted from the JavaDoc standard.
SVN ident strings
Include SVN $Header$ strings in your code. This makes it easier for people to know which version
of a file they have and where it came from, so that they can usefully refer to the file’s SVN history
to find out about bugs and fixes, etc. If your repository is configured appropriately, use the custom
tag instead of $Header$.
Variable Settings
• Always run Mambo/Joomla! and PHP will full Error Reporting Level (E_ALL). You can change
this level in the global configuration (see „Server“ # Error Reporting Level) and in your PHP.ini.
• Always initialize variables. (just $a=0 is initialization)
• Use isset( $var ) to check if a variable has been set. Use empty( $var ) to check if Array indexes
have been set or are empty.
Header Comment Blocks
All source code files in the repository shall contain a "page-level" docblock at the top of each file and
a "class-level" docblock immediately above each class. Below are examples of such docblocks.
<?php
/**
* Short description for file
*
* Long description for file (if any)...
*
*
* @package VirtueMart
* @subpackage classes_product
* @copyright 2007 VirtueMart Developer Team
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @version $Id: Developer_Manual.xml 1079 2007-12-07 18:34:23Z soeren_nb $
*/
/*
* Place includes, constant defines and $_GLOBAL settings here.
* Make sure they have appropriate docblocks to avoid phpDocumentor
* construing they are documented by the page-level docblock.
*/
/**
* Short description for class
*
* Long description for class (if any)...
*
Commentaires sur ces manuels