Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D digitec-wiki
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Digitec
  • digitec-wiki
  • Wiki
  • php coding standards

php coding standards · Changes

Page history
mmclin: update naming conventions authored Mar 25, 2014 by Rene Cabral's avatar Rene Cabral
Hide whitespace changes
Inline Side-by-side
php-coding-standards.markdown
View page @ 22e9c153
......@@ -141,6 +141,35 @@ count()
keys()
```
The usage of these methods are only allowed when it is clear that there is a main relation:
- a CookieJar has many Cookie objects;
- a Service Container has many services and many parameters (as services is the main relation, the naming convention is used for this relation);
- a Console Input has many arguments and many options. There is no "main" relation, and so the naming convention does not apply.
For many relations where the convention does not apply, the following methods must be used instead (where XXX is the name of the related thing):
| Main Relation | Other Relations |
| ----- | ----- |
|get() |getXXX()|
|set() |setXXX()|
|n/a |replaceXXX()|
|has() |hasXXX()|
|all() |getXXXs()|
|replace() |setXXXs()|
|remove() |removeXXX()|
|clear() |clearXXX()|
|isEmpty() |isEmptyXXX()|
|add() |addXXX()|
|register() |registerXXX()|
|count() |countXXX()|
|keys() |n/a|
While "setXXX" and "replaceXXX" are very similar, there is one notable difference: "setXXX" may replace, or add new elements to the relation. "replaceXXX", on the other hand, cannot add new elements. If an unrecognized key as passed to "replaceXXX" it must throw an exception.
### Documentation
* Add PHPDoc blocks for all classes, methods, and functions;
......
Clone repository
  • alpha beta testing
  • browser testing
  • camtasia licenses
  • code delivery processes
  • coding practices
  • css and sass coding standards
  • database schema standards
  • dependency management
  • development environments
  • digitec agile process
  • digitec gitlab styles
  • digitec software promises
  • digitec spec process
  • gitlab administration
  • gitlab issues tags
View All Pages