Version 17 by Maks 3w
on Jul 10, 2012 18:43.

compared with
Current by Ralph Schindler
on Jan 02, 2014 16:29.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (15)

View Page History
h3. Namespaces

Namespaces *MUST* contain only alphanumeric characters, the underscore, and, of course, the namespace separator ({{\\}}). ({{\\}}).

Namespaces *SHOULD* be MixedCase, and acronyms used in namespaces *SHOULD* as well. As examples:
{code}

If as a result of such declarations, the line length exceeds the maximum line length, break the line before the {{extends}} and/or after {{implements}} keywords, and pad those lines by one indentation level.

{code:php}
class SampleClass extends AbstractFoo implements
extends AbstractFoo Bar
implements Bar
{
}

{code:php}
class SampleClass implements
implements BarInterface,
BazInterface
BazInterface
{
}
When throwing an exception, you *SHOULD* provide a useful exception message. Such messages *SHOULD* indicate the root cause of an issue, and provide meaningful diagnostics. As an example, you may want to include the following information:

* The method throwing the exception ({{\_\_METHOD\_\_}}) ({{\__METHOD_\_}})
* Any parameters that were involved in calculations that led to the exception (often class names or variable types will be sufficient)

*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-20124 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Magic
*/
{code}

The {{@category}} annotation *MUST* have a value of "Zend".

The {{@package}} annotation *MUST* be assigned, and should be equivalent to the component name of the class contained in the file; typically, this will only have two segments, the "Zend" prefix, and the component name. Segments *MUST* be separated by the underscore ("_") character.

The {{@subpackage}} annotation is optional. If provided, it *SHOULD* be the subcomponent name, minus the class prefix. In the example above, the assumption is that the class in the file is either "Zend\Magic\Wand", or lives under that namespace.

h4. Classes

*
* Long description for class (if any)...
*
* @category Zend
* @package Zend_Magic
* @subpackage Wand
*/
{code}

The {{@category}} annotation *MUST* have a value of "Zend".

The {{@package}} annotation *MUST* be assigned, and should be equivalent to the component to which the class belongs; typically, this will only have two segments, the "Zend" prefix, and the component name. Segments *MUST* be separated by the underscore ("_") character.

The {{@subpackage}} annotation is optional. If provided, it *SHOULD* be the subcomponent name, minus the class prefix. In the example above, the assumption is that the class described is either "Zend\Magic\Wand", or lives under that namespace.

h4. Functions