CodeRabbit home page
Search...
⌘K
Signup
Signup
Search...
Navigation
Supported tools
PHPCS
Documentation
Blog
Changelog
Discord
Get started
Introduction
Quickstart
Add CodeRabbit to your repository
Overview
Supported Git platforms
Add organizations
Set permissions
Review pull requests
Overview
Control and manage code reviews
Generate improvements
Code review troubleshooting
CodeRabbit Chat
Analyze & improve your code
Create and resolve issues
Integrate issue tracking
Issue Chat
Create issues
Linked Issues
IDE extensions
Review local changes
Install the VSCode extension
Use the VSCode extension
Use with self-hosted CodeRabbit
Configure the VSCode extension
Uninstall the VSCode extension
Configure
Overview
Organization preferences
Repository preferences
Add a configuration file
Initial configuration guide
Knowledge base
Integrate MCP servers
Review instructions
Linters & security analysis tools
Manage your account
Manage your subscription
Role based access
Generate reports
Overview
Schedule reports
Generate reports on demand
Customize reports
Best practices
Setup best practices
Code review best practices
Reference
CodeRabbit API
Code review commands
Configuration reference
Configuration file template
Supported tools
List of supported tools
actionlint
Biome
Brakeman
Buf
Checkmake
Checkov
CircleCI
Clippy
Cppcheck
detekt
Dotenv Linter
ESLint
Flake8
Gitleaks
golangci-lint
Hadolint
HTMLHint
LanguageTool
Luacheck
markdownlint
OSV-Scanner
Oxlint
PHPCS
PHPMD
PHPStan
Pipeline Failure Remediation
PMD
Prisma Lint
Pylint
Regal
RuboCop
Ruff
Semgrep
ShellCheck
Shopify CLI
SQLFluff
SwiftLint
Caching
Resources
Get support
Self-host CodeRabbit
Why CodeRabbit?
FAQs
Early Access Program
Future development
On this page
Files
Features
Popular Standards
Configuration
Links
Supported tools
PHPCS
CodeRabbit’s guide to PHPCS.
PHPCS
(PHP CodeSniffer) is a development tool that ensures your code conforms to a coding standard. It is an essential tool for any development team that wants to ensure their code is consistent and follows best practices.
Files
PHPCS will run on files with the following extensions:
.php
Features
PHPCS can detect and fix various coding standard violations including:
PSR Standards
: Enforces PSR-1, PSR-2, PSR-12, and other coding standards
Custom Standards
: Supports custom coding standards and rules
Auto-fixing
: Can automatically fix many coding standard violations
Custom Rules
: Allows creation of custom sniff rules
Multiple Standards
: Can enforce multiple coding standards simultaneously
Popular Standards
PHPCS supports many coding standards including:
PSR-1
: Basic Coding Standard
PSR-2
: Coding Style Guide
PSR-12
: Extended Coding Style
Squiz
: Squiz Labs coding standard
PEAR
: PEAR coding standard
Zend
: Zend Framework coding standard
Configuration
PHPCS requires a configuration file to run. CodeRabbit will only run PHPCS if one of the following configuration files is found:
phpcs.xml
- XML configuration file
phpcs.xml.dist
- Distributed XML configuration file
CodeRabbit will not run PHPCS if no configuration file is found.
Links
PHPCS GitHub Repository
PHPCS Documentation
Available Coding Standards
Creating Custom Standards
Oxlint
PHPMD
Assistant
Responses are generated using AI and may contain mistakes.