Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Formula
- METHOD_NAME = [CONTEXT] + VERB + [HOW]
- METHOD_NAME
- Must use camelCase (reference Zend Certificated Engineer study manual, Composer, and PSR standards).
- Must not start with “__” unless it’s a predefined magic method.
- Must start with an alphabetical character.
- CONTEXT
- Should be a noun.
- Should be the name of the thing modified by VERB.
- Should be omitted if the CONTEXT is implied by object.
- VERB
- Required.
- Should be the name of the function that is being performed.
- Should be based on a defined list of house terms (e.g. get, load, fetch).
- Reference thesaurus for assistance.
- HOW
- Should be omitted if parameters are optional.
- May be omitted if multiple parameters are required.
- Prefixed by the word "By".
- Examples
- $doc->loadByPath($path);
- $user->loadByName($username);
- $user->armDisableById($id);
- $user->add($username, $id);
- $user->load();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement