PHPの標準勧告提案PSR
 PHP Standards Recommendations – PHP-FIG
PSRはPHPのコードはこのように作るべきだと推奨する提案の一つです。PSRはPHP-FIG — PHP Framework Interop Group – PHP-FIGによって策定されています。PHP-FIGはPHP Framework Interop Groupとある通り、複数あるPHPフレームワークの各関係者の集団です。その影響力は強く、いくつものフレームワークを始めとして多くのコードがPSRに準拠したコードになっています。
 現在、承認済みのPSRは次の表の通りです。
Accepted
| Num | Title | Editor | Coordinator | Sponsor | 
|---|---|---|---|---|
| 1 | Basic Coding Standard | Paul M. Jones | N/A | N/A | 
| 2 | Coding Style Guide | Paul M. Jones | N/A | N/A | 
| 3 | Logger Interface | Jordi Boggiano | N/A | N/A | 
| 4 | Autoloading Standard | Paul M. Jones | Phil Sturgeon | Larry Garfield | 
| 6 | Caching Interface | Larry Garfield | Paul Dragoonis | Robert Hafner | 
| 7 | HTTP Message Interface | Matthew Weier O’Phinney | Beau Simensen | Paul M. Jones | 
| 11 | Container Interface | Matthieu Napoli, David Négrier | Matthew Weier O’Phinney | Korvin Szanto | 
| 13 | Hypermedia Links | Larry Garfield | Matthew Weier O’Phinney | Marc Alexander | 
| 15 | HTTP Handlers | Woody Gilk | N/A | Matthew Weier O’Phinney | 
| 16 | Simple Cache | Paul Dragoonis | Jordi Boggiano | Fabien Potencier | 
| 17 | HTTP Factories | Woody Gilk | N/A | Matthew Weier O’Phinney | 
 この中で特に多くの出番があるのはPSR-2、コーディング規約です。インデントはスペース4個、一行はできるだけ80文字以内に最大でも120文字以内、クラス、メソッドの開き括弧は次の行、などなどコードのスタイルについての規約が羅列されています。日本語訳も既にいくつかあります。PSR-2 コーディングガイド(日本語)|北海道札幌市のシステム開発会社インフィニットループ
【PSR】PHPの標準コーディング規約 – Qiita
【PHP】PSR-2 Coding Style Guide(コーディングスタイルガイド)
 チェックツールにはphp_codesniffer、修正ツールには php-cs-fixerなどがあります。
 
					         
               
                       
                