Download the PHP package haspadar/sheriff without Composer
On this page you can find all versions of the php package haspadar/sheriff. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sheriff
Sheriff
Pre-configured strict quality gate for PHP
Over 1200 rules from 18 tools
| Tool | Rules |
|---|---|
| PHPStan | 128 (48 strict + 80 haspadar custom) at level 9 |
| Psalm | 331 issue types at level 1 |
| PHP_CodeSniffer | 382 sniffs (Slevomat + core) |
| PHP-CS-Fixer | 364 fixers (303 core + 61 kubawerlos) |
| PHPMD | 6 rulesets, all enabled |
| Infection | mutation testing, Covered MSI ≥ 80% |
Configure
Customization is optional. If needed, create .sheriff.yaml in the project root.
Four settings cascade across every tool that consumes them:
php.src— paths analysed by PHPStan, Psalm, PHPUnit, PHPMD, PHP_CodeSniffer, PHP Metrics, Infection, SonarCloudphp.exclude— paths skipped by PHP_CodeSniffer and PHP-CS-Fixerinfra.exclude— paths skipped by PHP Metrics, markdownlint, jsonlint, yamllint, typos, hadolint, shellcheckphp.versions— versions used in the CI matrix and consumed by PHPStan, PHP-CS-Fixer, PHPMD, Infection
Change one key, every consuming tool follows.
Use append to extend default lists:
Use override to replace individual keys:
Use php_cs_fixer.extend and phpcs.extend to inject native-syntax fragments at the end of the generated config. Useful when a built-in rule clashes with project code — for example, narrowing phpdoc_types instead of disabling it entirely:
The value is passed through verbatim; Sheriff does not parse it. Use a YAML block scalar (| or |-) for multi-line fragments.
Use envs to export environment variables in CI workflows. Each value is a shell command evaluated at runtime:
The full list of available keys and their defaults is generated to .sheriff/config.yaml on every sheriff sync.
.sheriff/ and .github/ are generated by sheriff sync and may be safely deleted.
Workflow
To change configuration:
- Edit
.sheriff.yaml - Run
vendor/bin/sheriff sync
Do not edit .sheriff/ or the GitHub workflow file .github/workflows/sheriff.yml directly — they are generated and will be overwritten.
Commands
sheriff sync— generate configuration from templatessheriff check— run checks, excluding slow ones by default (check.slow: infection, sonar)sheriff check <tool>— run specific tool-f,--full— include slow checks (default:check.full)-F,--no-full— exclude slow checks-p,--parallel— run checks concurrently (default:check.parallel)-P,--no-parallel— force sequential execution-v,--verbose— show full output from each checksheriff fix— run auto-fixable toolssheriff fix <tool>— run specific fixer
Checks
PHP
- PHPStan — level 9 with strict rules, phpstan-phpunit (PHPUnit-aware assertions, data providers,
MockObjectinference) and haspadar/phpstan-rules (80 custom rules for object-oriented strictness) - Psalm — with psalm/plugin-phpunit for PHPUnit-aware type narrowing and provider validation
- PHPUnit
- Infection
- PHPMD
- PHP Metrics
- PHP_CodeSniffer — with Slevomat Coding Standard rules (class structure, doc comments, attributes)
- PHP-CS-Fixer — with kubawerlos/php-cs-fixer-custom-fixers and PHPUnit ruleset (
php_unit_*: strict asserts, dedicated assertions, data-provider naming/static/return-type, attributes; requires PHPUnit 12+)
Linters
- actionlint
- hadolint
- shellcheck
- markdownlint-cli2
- jsonlint
- yamllint
- typos
CI
- SonarCloud — requires
SONAR_TOKENenvironment variable (get token) - Pull request size limit
- Code coverage (Codecov)
Contributing
- Fork the repository
- Create a feature branch
- Ensure all checks pass
- Open a pull request
All pull requests must pass CI before merging.
License
MIT
All versions of sheriff with dependencies
friendsofphp/php-cs-fixer Version ^3.95
haspadar/phpstan-rules Version >=0.36 <1.0.0
infection/infection Version ^0.33.0
kubawerlos/php-cs-fixer-custom-fixers Version ^3.36
phpmd/phpmd Version ^2.15
phpmetrics/phpmetrics Version ^2.9
phpstan/phpstan Version ^2.1
phpstan/phpstan-phpunit Version ^2.0
phpstan/phpstan-strict-rules Version ^2.0
phpunit/phpunit Version ^12.0
psalm/plugin-phpunit Version ^0.19.7
slevomat/coding-standard Version ^8.28
squizlabs/php_codesniffer Version ^4.0
symfony/process Version ^7.0
symfony/yaml Version ^7.4
vimeo/psalm Version ^6.14