SpearDevs PHP Standards package contains:
- PHPStan
- Easy Coding Standard
- Rector
- PHPUnit
- GitHub Action workflow
{
"extra": {
"symfony": {
"endpoint": [
"https://api.github.com/repos/speardevs/recipes/contents/index.json",
"flex://defaults"
]
}
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:SpearDevs/PHPStandards.git"
}
]
}
composer require speardevs/php-standards --dev
Generate token here and
create new GitHub Action's secret key SPEARDEVS_PIPELINES_KEY
with generated token.
Default PHP version in package is defined as 8.2
. If adjustment is needed then update following files:
.github/workflows/speardevs-coding-standards.yaml
- set correct PHP version forphp-version
keyrector.php
- replaceLevelSetList::UP_TO_PHP_82
set list name with proper version; example:LevelSetList::UP_TO_PHP_74
If amount of changes to apply is overwhelming, you can generate baseline and then slowly improve code file by file.
If project has no implemented tests, comment Run PHPUnit tests
step in pipeline defined
in .github/workflows/speardevs-coding-standards.yaml
to pass correctly job.