Coder
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
Coder checks your Drupal code against coding standards and other best practices. It can also fix coding standard violations for you with the phpcbf command from PHP_CodeSniffer, see the installation instructions and usage examples. Those checks apply to all versions of Drupal, so you can use Coder 8.x-2.x to check Drupal 7 code.
Coder is not a module, it is used as command line tool and in IDEs.
Note that Javascript support has been removed. To check and fix Javascript files please use ESLint and see the Drupal ESLint documentation.
Online version
Usage
$ phpcs --standard=Drupal example.module
FILE: /home/klausi/workspace/coder/example.module
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
1 | ERROR | [ ] Missing file doc comment
3 | ERROR | [ ] Missing function doc comment
4 | ERROR | [ ] Opening brace should be on the same line as the declaration
5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
6 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Drupal 8 module upgrading
See https://drupal.org/project/drupalmoduleupgrader
Old Coder module for D7 and D6
All information is now on a documentation page.
Sponsors
The Coder module was originally developed by douggreen, partially supported by CivicActions.
The Coder Review module was sponsored by Annertech for several years of work. Development of the Drupal 7.x upgrade routines was partially sponsored by Clarity Digital Group (owners of NowPublic.com and Examiner.com).
The Coder Upgrade module is sponsored by Boombatower Development.