Skip to content

PSR-1 Coding Style Guide #19

Closed
wants to merge 69 commits into from

5 participants

@pmjones
pmjones commented Mar 21, 2012

The final (?) version of the style guide.

pmjones and others added some commits Mar 6, 2012
@pmjones pmjones add a fleshed-out version of style guide proposal af71f89
@saltybeagle saltybeagle Minor Spelling corrections 69be98c
@pmjones pmjones Merge pull request #1 from saltybeagle/master
Minor spelling corrections
550dc72
@pmjones pmjones break lines at about 80 chars 0335b99
@pmjones pmjones merge spelling changes 7bb84cd
@pmjones pmjones update line length notes per Andreas Moller and Wil Moore 49b6fef
@pmjones pmjones add a note about namespace names, and change so that there is one 'us…
…e' per line, instead of one 'use' and multiple lines (per gnugat)
c36244b
@pmjones pmjones add a note about namespace names, and change so that there is one 'us…
…e' per line, instead of one 'use' and multiple lines (per gnugat) ... also remove prefix/suffix requirements, per discssion with klaussilveira
5aa80a2
@pmjones pmjones Merge branch 'master' of github.com:pmjones/fig-standards 3c5dea0
@pmjones pmjones use namespaced constants, per @KingCrunch, and only use globals const…
…ants as a fallback
aecd965
@pmjones pmjones per notes from @gnugat and Wil Moore III, discourage global vars inst…
…ead of disallowing
93e6c5b
@pmjones pmjones per notes from @KingCrunch and @klaussilveira, reducing the errors ch…
…apter to say only E_ALL
9cd5072
@pmjones pmjones add try/catch to the control structures c6a7158
@pmjones pmjones rename the chapter 336336b
@pmjones pmjones add a comma 97003b0
@pmjones pmjones minor changes c775d79
@pmjones pmjones update the 'credits' aac843f
@pmjones pmjones add note about trailing space d4b4c3d
@pmjones pmjones discourage, but allow, global functions fa5e0ba
@pmjones pmjones extract operator and expression rules to their own chapter ee14d0b
@pmjones pmjones add <?php lines e977d3e
@pmjones pmjones minor updates 41c3ae5
@pmjones pmjones break into sections, add a note about blank lines e2bb63d
@pmjones pmjones rewording 214b6a3
@pmjones pmjones rewording 9412f14
@pmjones pmjones rewording cad7314
@pmjones pmjones include a reference to &$args f51cce2
@pmjones pmjones fix a merge conflict, and some rewording 67af4d0
@pmjones pmjones Zend Framework, not just Zend c1d8758
@pmjones pmjones add a 'tl;dr' overview of bullet points b2c45c7
@pmjones pmjones change from '75-85' to just '80' b3db972
@pmjones pmjones PSR-0 requires only one namespace level; put one line between the 'us…
…e' block and the class
6e5f005
@pmjones pmjones we do 'recommendations' not 'requirements' 2d40fc8
@pmjones pmjones add a section about substitution/interpolation de44fde
@pmjones pmjones rewording a29611d
@pmjones pmjones markup change c2c4e6a
@pmjones pmjones add explicit desciription on control structures 895cabf
@pmjones pmjones consolidate phrasing 0517a8f
@pmjones pmjones rewording 569f44e
@pmjones pmjones remove, consolidate, and rename files 7d92c1c
@pmjones pmjones commit the intro 8736aa0
@pmjones pmjones change property names 0f51f36
@pmjones pmjones rewording 81f48d5
@pmjones pmjones incorporate suggestions 4395087
@pmjones pmjones consolidate all chapters into a single document 30fd257
@pmjones pmjones minor changes 3a14039
@pmjones pmjones minor edits ec34d8f
@pmjones pmjones minor edits 12e9203
@pmjones pmjones minor edits 21a4059
@marcooliveira marcooliveira Fixed two typos, "visbility" and "mamespaces". 187c010
@pmjones pmjones Merge pull request #3 from marcooliveira/patch-1
Patch-typo-visbility-mamespaces
7083e35
@pmjones pmjones minor change: 459d372
@pmjones pmjones typos 676c06f
@pmjones pmjones Merge branch 'psr-1-reduced' 40d715e
@pmjones pmjones continued minor edits da3b16a
@pmjones pmjones Merge branch 'psr-1-reduced' 7f2f61a
@leek leek Enabling markdown syntax highlighting bdbcd10
@pmjones pmjones Merge pull request #4 from leek/patch-1
Enable markdown syntax highlighting
7e4281b
@pmjones pmjones put static *after* visibility ca47794
@pmjones pmjones modify case/break indents on switch structures 0b8571e
@pmjones pmjones minor reorg of 'lines', add a bit about one statement per line d48cf7a
@pmjones pmjones soften line length langauge a little 17e7832
@pmjones pmjones remove extraneous blank lines a06ef37
@pmjones pmjones name change 3eb8d22
@pmjones pmjones change heading markup a6728fc
@pmjones pmjones argument consistency 0ea15d1
@pmjones pmjones update introductory language, add list of voting and non-voting parti…
…cipants
fc1e9f8
@pmjones pmjones use 'encourage' not 'strongly encourage' and add a prohibition on 'var' ce10fbc
@andrerom andrerom commented on the diff Mar 22, 2012
proposed/PSR-1.md
+```
+
+Argument lists may be split across subsequent indented lines; list only one
+argument per line. When the argument list is split across multiple lines, the
+closing parenthesis and opening brace are placed together on their own line.
+
+```php
+<?php
+namespace Vendor\Package;
+
+class ClassName
+{
+ public function aVeryLongMethodName(
+ ClassTypeHint $arg1,
+ &$arg2,
+ array $arg3 = []
@andrerom
andrerom added a note Mar 22, 2012

Maybe the use of arrays in examples should not hint preference of PHP 5.4 only syntax?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pmjones pmjones closed this Mar 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.