PSR-1/2/4/5/12 are a solid foundation, but are not an entire coding style by themselves. I have taken the time to document all of the nitpicky patterns and nuances of my personal coding style.
It goes well-beyond brace placement and tabs vs. spaces to cover topics such as docblock annotations, ternary operations and which variation of English to use. It aims for thoroughness and pedanticism over hoping that we can all get along.
- PSR-1 — Basic Coding Style
- PSR-2 — Coding Style Guide
- PSR-4 — Autoloading Patterns
- PSR-5 — Documentation Block Patterns
- PSR-12 — Extended Coding Style
This is an attempt to document my personal coding style, patterns, and rationale. This is NOT an attempt to tell anybody else how to write code. There is a 100% chance that someone will disagree with me, and that's perfectly OK. This is for me.
If you want to fork this and make edits for yourself or your team, please go right ahead.
- PSR.md
- EDITOR-SETTINGS.md
- GRAMMAR.md
- COMMENTS.md
- DOCBLOCKS.md
- SPELLING.md
- NAMING.md
- WHITESPACE-ALIGNMENT.md
- CLASSES-METHODS.md
- LANGUAGE-PATTERNS.md
My primary influences are:
- SimplePie
- AWS SDK for PHP
- PSR-1
- PSR-2
- PEAR
- Evolt standards
- ...and other things I've picked up since I started writing PHP in 2002.
This set of standards cannibalizes and obsoletes the document I published back in 2010. This set is more evolution than revolution, and there is still a lot of overlap between the two.
My intention is to release all rights to this documentation and make it available under the Public Domain. Unfortunately, in the U.S. it's not quite that cut-and-dry. So, I am dual-licensing this work under CC0 and the Unlicense. You can choose whichever license you would prefer to adhere to.
To the extent possible under law, Ryan Parman has waived all copyright and related or neighboring rights to "Parman PHP Coding Standards". This work is published from: United States.