-
All functions MUST be namespaced with the full module or theme name as a
prefix.
-
A leading underscore MUST be prefixed to the function name for 'private'
functions.
-
Private functions SHOULD never be called from outside of the module in
which they are declared.
-
Private functions SHOULD be declared at the bottom of a file.
-
Functions MUST be documented with one of two types of comments:
-
a one-liner comment (referred to as 'one-liners' in the rest of this
document) that is literally a one line summary only
OR
-
a full description comment (referred to as 'docblocks' in the rest of
this document) with a summary, parameters and result returned where
appropriate.
-
-
Function documentation comments, both one-liners and docblocks, MUST
comply with the Drupal API documentation standards for functions.
-
All function parameters (
@param
) and returned values (@return
) MUST bedocumented if using docblocks.
-
All parameters (
@param
) listed in docblocks SHOULD be type hinted -
If values are returned as a result (
@return
) then docblocks MUST indicate the data types returned.
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.