From 83a7bd6920b61aa1d729e191b2fa35eb411a2d48 Mon Sep 17 00:00:00 2001 From: Ken Guest Date: Wed, 6 Apr 2016 20:42:43 +0100 Subject: [PATCH 1/2] Mention phpcbf in Coding Style Guide. --- _posts/02-01-01-Code-Style-Guide.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/_posts/02-01-01-Code-Style-Guide.md b/_posts/02-01-01-Code-Style-Guide.md index 4a3a7cb..cd77d03 100644 --- a/_posts/02-01-01-Code-Style-Guide.md +++ b/_posts/02-01-01-Code-Style-Guide.md @@ -15,7 +15,7 @@ recommendations are merely a set of rules that some projects like Drupal, Zend, 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 a known standard. This could be any combination of PSR's, or one +Ideally you should write PHP code that adheres to a known standard. This could be any combination of PSRs, 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. @@ -29,8 +29,11 @@ applications that implement the components can have consistency even when workin 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 fix the code layout automatically by using one of the two following tools. One is the [PHP Coding Standards Fixer][phpcsfixer] which has a very well tested codebase. -Another option is [php.tools][phptools], which is made popular by the [sublime-phpfmt][sublime-phpfmt] editor plugin. While being newer, it makes great improvements in performance, meaning real-time editor fixing is more fluid. +You can fix the code layout automatically by using one of the following tools: + +- One is the [PHP Coding Standards Fixer][phpcsfixer] which has a very well tested codebase. +- Another option is [php.tools][phptools], which is made popular by the [sublime-phpfmt][sublime-phpfmt] editor plugin. While being newer, it makes great improvements in performance, meaning real-time editor fixing is more fluid. +- Also, the [PHP Code Beautifier and Fixer][phpcbf] tool which is included with PHP_CodeSniffer can be used to adjust your code accordingly. And you can run phpcs manually from shell: @@ -53,6 +56,7 @@ readable by all current and future parties who may be working on the codebase. [pear-cs]: http://pear.php.net/manual/en/standards.php [symfony-cs]: http://symfony.com/doc/current/contributing/code/standards.html [phpcs]: http://pear.php.net/package/PHP_CodeSniffer/ +[phpcbf]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically [st-cs]: https://github.com/benmatselby/sublime-phpcs [phpcsfixer]: http://cs.sensiolabs.org/ [phptools]: https://github.com/phpfmt/php.tools From f626af3bd2a1c844d8a76976cf2ff7fd0b3b9f8a Mon Sep 17 00:00:00 2001 From: Ken Guest Date: Fri, 27 May 2016 09:34:42 +0100 Subject: [PATCH 2/2] Remove line about phptools on ccirello's request. ccirello is a maintainer of phpfmt/php.tools - so if he doesn't want his project mentioned... --- _posts/02-01-01-Code-Style-Guide.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/_posts/02-01-01-Code-Style-Guide.md b/_posts/02-01-01-Code-Style-Guide.md index cd77d03..9988cf7 100644 --- a/_posts/02-01-01-Code-Style-Guide.md +++ b/_posts/02-01-01-Code-Style-Guide.md @@ -32,7 +32,6 @@ editors like [Sublime Text 2][st-cs] to be given real time feedback. You can fix the code layout automatically by using one of the following tools: - One is the [PHP Coding Standards Fixer][phpcsfixer] which has a very well tested codebase. -- Another option is [php.tools][phptools], which is made popular by the [sublime-phpfmt][sublime-phpfmt] editor plugin. While being newer, it makes great improvements in performance, meaning real-time editor fixing is more fluid. - Also, the [PHP Code Beautifier and Fixer][phpcbf] tool which is included with PHP_CodeSniffer can be used to adjust your code accordingly. And you can run phpcs manually from shell: @@ -59,5 +58,4 @@ readable by all current and future parties who may be working on the codebase. [phpcbf]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically [st-cs]: https://github.com/benmatselby/sublime-phpcs [phpcsfixer]: http://cs.sensiolabs.org/ -[phptools]: https://github.com/phpfmt/php.tools [sublime-phpfmt]: https://github.com/phpfmt/sublime-phpfmt