Download the PHP package drevops/phpcs-standard without Composer
On this page you can find all versions of the php package drevops/phpcs-standard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download drevops/phpcs-standard
More information about drevops/phpcs-standard
Files in drevops/phpcs-standard
Package phpcs-standard
Short Description DrevOps PHP_CodeSniffer rules: enforce consistent naming (snakeCase or camelCase) for variables and parameters, PHPUnit data provider conventions.
License GPL-2.0-or-later
Homepage https://github.com/drevops/phpcs-standard
Informations about the package phpcs-standard
DrevOps PHP_CodeSniffer Standard
[](https://github.com/drevops/phpcs-standard/issues)
[](https://github.com/drevops/phpcs-standard/pulls)
[](https://github.com/drevops/phpcs-standard/actions/workflows/test-php.yml)
[](https://codecov.io/gh/drevops/phpcs-standard)



[](https://github.com/drevops/vortex)
PHP_CodeSniffer standard enforcing:
- Consistent naming conventions for local variables and function/method parameters (configurable:
snakeCaseorcamelCase) - PHPUnit data provider naming conventions and organization
Installation
The standard is automatically registered via phpcodesniffer-composer-installer.
Verify: vendor/bin/phpcs -i (should list DrevOps)
Usage
Configuration
Create phpcs.xml:
Use individual sniffs:
Configure naming convention
By default, both sniffs enforce snakeCase. Configure to use camelCase:
LocalVariableNaming
Enforces consistent naming convention for local variables inside functions/methods.
With snakeCase (default):
With camelCase:
Excludes:
- Function/method parameters (handled by
ParameterNaming) - Class properties (not enforced)
- Reserved variables (
$this,$_GET,$_POST, etc.)
Error codes
DrevOps.NamingConventions.LocalVariableNaming.NotSnakeCase(whenformat="snakeCase")DrevOps.NamingConventions.LocalVariableNaming.NotCamelCase(whenformat="camelCase")
Ignore
ParameterNaming
Enforces consistent naming convention for function/method parameters.
With snakeCase (default):
With camelCase:
Excludes:
- Parameters inherited from interfaces/parent classes
- Parameters in interface/abstract method declarations
- Class properties (including promoted constructor properties)
Error codes
DrevOps.NamingConventions.ParameterNaming.NotSnakeCase(whenformat="snakeCase")DrevOps.NamingConventions.ParameterNaming.NotCamelCase(whenformat="camelCase")
Ignore
DataProviderPrefix
Enforces consistent naming prefix for PHPUnit data provider methods.
Configuration
Customize the required prefix:
Error code
DrevOps.TestingPractices.DataProviderPrefix.InvalidPrefix
Ignore
Auto-fixing
This sniff supports auto-fixing with phpcbf:
- Renames provider methods to use the correct prefix
- Updates all
@dataProviderannotations to reference the new name
DataProviderMatchesTestName
Ensures data provider method names match their test method names.
Supported formats:
@dataProviderannotations#[DataProvider('methodName')]attributes (PHP 8+)
Excludes:
- External providers (
ClassName::methodName) - Non-test methods
- Non-test classes
Error code
DrevOps.TestingPractices.DataProviderMatchesTestName.InvalidProviderName
Ignore
DataProviderOrder
Enforces structural organization of test and data provider methods.
Helper methods between tests and providers are allowed:
Configuration
Reverse the ordering (provider before test):
Options:
after(default) - Providers must appear after their test methodsbefore- Providers must appear before their test methods
Error codes
DrevOps.TestingPractices.DataProviderOrder.ProviderBeforeTest- Provider appears before test (whenproviderPosition="after")DrevOps.TestingPractices.DataProviderOrder.ProviderAfterTest- Provider appears after test (whenproviderPosition="before")
Ignore
Development
License
GPL-3.0-or-later
This repository was created using the Scaffold project template
All versions of phpcs-standard with dependencies
dealerdirect/phpcodesniffer-composer-installer Version ^1
squizlabs/php_codesniffer Version ^3.10 || ^4