Developer pages: Coding Guidelines
Namespaces
This section applies to Stubbles versions with namespaces.
Namespace and all imports are defined after the file doc comment.
<?php
/**
* Short description of file - most times this is identical with class description.
*
* @author Frank Kleine <mikey@stubbles.net>
* @package stubbles
* @subpackage examples
* @version $Id$
*/
namespace net::stubbles::example;
use net::stubbles::util::Binford;
/**
* Short description of class.
*
* @package stubbles
* @subpackage examples
*/
class ExampleNamespacedClass extends net::stubbles::lang::BaseObject
{
public function __construct(Binford $binford, ::Iterator $iterator)
{
...
}
}
?>
Classes from the global space and PHP internal classes should always be referenced with ::Classname.
Stubbles classes all reside in the net::stubbles package.
Next: Tools
