Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1.36 KB

File metadata and controls

40 lines (31 loc) · 1.36 KB

WordPress Coding Standards

Jetbrains PHPStorm

  1. Clone this repository to your local machine
  2. cd into the cloned repository and navigate to the wordpress directory
  3. Install the WordPress Coding Standards using Composer: composer install
  4. Copy phpcs.xml.dist to the root of your project, change text_domain, prefixes to match your project
  5. Settings -> PHP -> Quality Tools -> PHP_CodeSniffer -> Set to ON
  6. Configuration -> click "..."
  7. Set "PHP_CodeSniffer path":
    1. On MacOs: vendor/bin/phpcs
    2. On Windows: vendor/bin/phpcs.bat
  8. Set "PHP Code Beatifier and Fixer Settings" -> "Path to phpcbf":
    1. On MacOs: vendor/bin/phpcbf
    2. On Windows: vendor/bin/phpcbf.bat
  9. Set Coding Standard to "Custom" and point it to the location of the copied phpcs.xml.dist file
  10. Editor -> Inspections -> PHP -> PHP_CodeSniffer validation -> Set to ON

Screenshots

Windows Screenshot

Expand

Windows Screenshot Windows Screenshot Windows Screenshot

MacOS Screenshot

Expand

MacOS Screenshot MacOS Screenshot MacOS Screenshot