Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Tomas Votruba:
Try PSR-12 on Your Code Today
Apr 10, 2018 @ 15:51:19

In a post to his site Tomas Votruba shows you how to test the PSR-12 standard on your current codebase using some custom PHP-CS-Fixer rules. The PSR-12 standard is a recommendation from the PHP-FIG group about consistency in coding styles and formatting. It expands and replaces the previous PSR-2 standard.

The standard is still behind the door, but feedback, before it gets accepted, is very important. After accepting it will be written down and it will be difficult to change anything.

Try PSR-12 today and see, how it works for your code.

Korvin Szanto, a developer working on the PHP-CS-Fixer project, has put together a commit with the rules to update and enforce the PSR-12 coding standard. The post shows how to install these rules and how to change up your YAML configuration to include them. He also includes a discussion about agreeing/disagreeing with the coding standard idea and gives examples of two rules he personally doesn't agree with.

tagged: psr12 coding standard phpcsfixer rules custom tutorial

Link: https://www.tomasvotruba.cz/blog/2018/04/09/try-psr-12-on-your-code-today/


Trending Topics: