Permalink
Browse files

Updated Code Style Guide

People were getting the idea that PSR's were being forced down their throats.

Now we're recommending the PEAR style guide (only ever intended for PEAR packages) and the Zend style guide (only ever meant for Zend projects) as well as the PSRs (only ever intended for FIG projects).
  • Loading branch information...
Phil Sturgeon
Phil Sturgeon committed Mar 1, 2013
1 parent f928406 commit e7fadf48f5d59693fb360453143d87f17ae46a9c
Showing with 17 additions and 12 deletions.
  1. +17 −12 _posts/02-01-01-Code-Style-Guide.md
@@ -5,32 +5,37 @@ PHP developers to choose several of these and combine them into a single project
(as close as possible) to a common code style to make it easy for developers to mix and match various libraries for
their projects.
-The [Framework Interop Group][fig] (formerly known as the 'PHP Standards Group') has proposed and approved a series of
-style recommendations, known as [PSR-0][psr0], [PSR-1][psr1], [PSR-2][psr2] and [PSR-3][psr3]. Don't let the funny names confuse you,
-these recommendations are merely a set of rules that some projects like Drupal, Zend, Symfony, CakePHP, phpBB, AWS SDK, FuelPHP,
-Lithium, etc are starting to adopt. You can use them for your own projects, or continue to use your own personal style.
+The [Framework Interop Group][fig] has proposed and approved a series of style recommendations, known as [PSR-0][psr0],
+[PSR-1][psr1] and [PSR-2][psr2]. Don't let the funny names confuse you, these recommendations are merely
+a set of rules that some projects like Drupal, Zend, Symfony, CakePHP, phpBB, AWS SDK, FuelPHP, Lithium, etc are starting
+to adopt. You can use them for your own projects, or continue to use your own personal style.
-Ideally you should write PHP code that adheres to one or more of these standards so that other developers can easily
-read and work with your code, and applications that implement the components can have consistency even when working with
-lots of third-party code. The first few recommendations are designed to be a super-set of the previous recommendation.
+Ideally you should write PHP code that adheres to a known standard. This could be any combination of PSR's, or one
+of the coding standards made by PEAR or Zend. This means other developers can easily read and work with your code,
+and applications that implement the components can have consistency even when working with lots of third-party code.
* [Read about PSR-0][psr0]
* [Read about PSR-1][psr1]
* [Read about PSR-2][psr2]
-* [Read about PSR-3][psr3]
+* [Read about PEAR Coding Standards][pear-cs]
+* [Read about Zend Coding Standards][zend-cs]
+
+You can use [PHP_CodeSniffer][phpcs] to check code against any one of these recommendations, and plugins for text editors
+like [Sublime Text 2][st-cs] to be given real time feedback.
-You can use [PHP_CodeSniffer][phpcs] to check code against these recommendations.
Use Fabien Potencier's [PHP Coding Standards Fixer][phpcsfixer] to automatically modify your code syntax so that it
conforms with these standards, saving you from fixing each problem by hand.
-English is preferred for all symbol names and code infrastructure. Comments may be written in any language easily readable by all current and future parties who may be working on the codebase.
+English is preferred for all symbol names and code infrastructure. Comments may be written in any language easily readable
+by all current and future parties who may be working on the codebase.
[fig]: http://www.php-fig.org/
[psr0]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
[psr1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
[psr2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
[psr3]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
+[pear-cs]: http://pear.php.net/manual/en/standards.php
+[zend-cs]: http://framework.zend.com/wiki/display/ZFDEV2/Coding+Standards
[phpcs]: http://pear.php.net/package/PHP_CodeSniffer/
-[phpcs-psr]: https://github.com/klaussilveira/phpcs-psr
+[st-cs]: https://github.com/benmatselby/sublime-phpcs
[phpcsfixer]: http://cs.sensiolabs.org/
-

1 comment on commit e7fadf4

@bobthecow

This comment has been minimized.

Show comment Hide comment
@bobthecow

bobthecow Mar 4, 2013

👍

👍

Please sign in to comment.