drupal-spider / drupalsecurity
Drupal Security is a library to review security issue of Drupal code.
Package info
github.com/mingsong-hu/DrupalSecurity
Type:phpcodesniffer-standard
pkg:composer/drupal-spider/drupalsecurity
Fund package maintenance!
1.2.4
2026-01-28 05:41 UTC
Requires
- php: >=5.4.0
- ext-mbstring: *
- drupal/coder: >=8.2.0
- phpcsstandards/phpcsutils: >=1.0.0
- squizlabs/php_codesniffer: >=3.0.0
- symfony/yaml: >=2.0.0
Requires (Dev)
- phpunit/phpunit: >= 12.5.7
README
DrupalSecurity is a library for automated Drupal code security reviews. It defines rules for PHP_CodeSniffer
Note that Javascript has not been supported yet. To check and fix Javascript files please use ESLint and see the Drupal ESLint documentation.
Global installation
composer global require "squizlabs/php_codesniffer=*"
composer global require mingsong-hu/drupalsecurity
Make sure you have the composer bin dir in your PATH. The default value is ~/.composer/vendor/bin/, but you can check the value that you need to use by running
composer global config bin-dir --absolute
Usage
Check Drupal Security standards
phpcs --standard=DrupalSecurity --ignore='*/tests/*' --extensions=php,module,inc,install,theme,yml,twig [/file/to/drupal/module]
List all sniffers
phpcs --standard=DrupalSecurity -e