From 183674077a2df6bcd7178e1f539f8ec8955bae35 Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Thu, 16 Aug 2001 06:40:22 +0000 Subject: [PATCH] * incorporated Jon's last changes to CODING_STANDARDS git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@55092 c90b9560-bf6c-de11-be94-00142212c4b1 --- pear/standards.xml | 72 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/pear/standards.xml b/pear/standards.xml index 2ec839c091..aa14edfdf5 100644 --- a/pear/standards.xml +++ b/pear/standards.xml @@ -1,4 +1,4 @@ - + PEAR Coding Standards @@ -347,15 +347,67 @@ T package.xml - - Naming Constants - - Constants should always be all-uppercase, with underscores to seperate - words. Prefix constant names with the name of the class/package - they are used in. For example, the constants used by the - DB:: package all begin with - "DB_". - + + Naming Conventions + + Functions and Methods + + Functions and methods should be named using the "studly caps" + style (also referred to as "bumpy case" or "camel caps"). + Functions should in addition have the package name as a prefix, + to avoid name collisions between packages. The initial letter of + the name (after the prefix) is lowercase, and each letter that + starts a new "word" is capitalized. Some examples: + + + + + connect() + getData() + buildSomeWidget() + XML_RPC_serializeData() + + + + + + + Private class members (meaning class members that an intented to + be used only from within the same class in which they are + declared; PHP does not yet support truly-enforceable private + namespaces) are preceeded by a single underscore. For example: + + + + + _sort() + _initTree() + $this->_status + + + + + + + + Constants + + Constants should always be all-uppercase, with underscores to + seperate words. Prefix constant names with the uppercased name + of the class/package they are used in. For example, the constants + used by the DB:: package all begin with + "DB_". + + + + Global Variables + + If your package needs to define global variables, their name + should start with a single underscore followed by the package + name and another underscore. For example, the PEAR package uses + a global variable called $_PEAR_destructor_object_list. + +