wiki-archive/twiki/data/Geospatial/CodingConventions.txt

40 lines
1.1 KiB
Plaintext

%META:TOPICINFO{author="TimSutton" date="1175439113" format="1.1" reprev="1.2" version="1.2"}%
%META:TOPICPARENT{name="GeoAppInter"}%
---+++ Basics
<verbatim>
/** @defgroup Foo // or @ingroup Foo
* This is a foo class */
class FooBar {
private var $fooVar;
private var $barVar;
/** This is a foo function.
* @returns a bar object.
*/
function FooBar ( $_fooVar, $_barVar ) {
$var = "foo";
}
}
</verbatim>
This would be saved to a file based on the class name FooBar.php
---+++ Documenting
We are using [[http://www.stack.nl/~dimitri/doxygen/][doxygen]] to document all code. We require only the class description and 'ingroup' tags as mandatory, other in class docs are optional. If you refer to another class in the /** */ comments doxygen will hyperlink so make sure to spell correctly.
---+++ Paging
To avoid dealing with paging we will limit all search results to 500
---+++ Naming
* Name class names with CamelCase, leading capital letter.
* Name class files with ClassName.php
* Name functions with fooFunction (camel case, leading lower case letter)
-- Main.TimSutton - 31 Mar 2007