Table of Contents

Summary

Information

Document Information

This RFC has been incorporated into the PEAR2 Standards (pear2_standards).

Author(s) Information

Discussion List

This RFC is currently being discussed only by pear-group; future discussion will occur on pear-devhttp://news.php.net/php.pear.dev.

This RFC's content is also being influenced by the new PHP Standards group http://news.php.net/php.standards.

Introduction

With the introduction of namespaces in PHP 5.3, the PEAR1 rule of Package_Subpackage_ClassName naming (for creating pseudo-namespacing) is no longer necessary. Package naming rules will be set by the PEAR2_Naming_Standards RFC, whereas class naming rules are addressed here in this RFC.

The naming of individual classes retains these PEAR1 rules [1]:

New guidelines for PEAR2:

Issues

A debate was originally spurred by the use of actual classes whose names, once namespaces removes their Several_Prefix_Layers_ from the name, will be just “Abstract” or “Interface” [2]. This prompted some discussion around various forms of “Hungarian Notation” in class naming, particularly for Abstract and Interface classes. Part of this RFC addresses the justification for requiring such naming style [4].

Proposed Solution

Initial rules and guidelines:

The only exception to the Interface suffix requirement is the base package exception, which must be named simply “Exception”. [3]

One benefit of the suffix rather than a prefix is in alphabetical-based visual listing of classes. Using prefixes would result in all unrelated abstract classes being listed togther... the same result would apply to all unrelated intefaces.

Examples

Here are some real-life examples gleaned from PEAR1 packages

References