Configure PhpStorm for Drupal coding standards | Drupal 8

Configure PhpStorm for Drupal coding standards

Submitted by editor on Fri, 05/04/2018 - 10:36
Question

How to configure phpstorm for drupal coding standards / Development ?

Change default settings of PhpStorm.

File -> Default settings -> Editor -> Code Style -> PHP

Drupal recommends less than 80 characters per line.
Set "Tab size", "Indent" and "Continuation indent" to 2

On the "Wrapping and Braces tab", make sure these settings are set correctly:

Keep control statements in one line should be unchecked
Place braces in class declaration should be unchecked
Place braces in function declaration should be unchecked
Always force braces for if() statements should be checked
Force braces for while() statements should be checked
Else on new line for if() statements should be checked
'While' on new line for do...while() statements should be checked
'Catch' on new line for for try() statements should be checked
Chop down Array initializer if long should be checked
New line after ( for Array initializer should be checked
Place ) on new line for Array initializer should be checked

You can also use my predefined file from hear : Default_PhpStorm_Style.xml_.zip
Import download the file, unzip and Import from :
File -> Default settings -> Editor -> Code Style
--> Gear icon -> Import scheme -> Intelij....XML

 

Tags

Comments

AlfredLandy (not verified)

Wed, 06/20/2018 - 08:40

It was really helpful to read your post on Configure Php Storm for Drupal coding standards. Because I was in search of this configuration settings. Your post was much helpful for me, as you explained simple words and that too clearly by step by step. If you are in search of online writing service then please contact with the  best essay writing service which will help you to achieve genuine essays at cheap price and in short time period. Thanks for sharing this post with us.

Add new comment