https://github.com/phphd/coding-standard
PhPhD Coding Standard
https://github.com/phphd/coding-standard
Last synced: 9 months ago
JSON representation
PhPhD Coding Standard
- Host: GitHub
- URL: https://github.com/phphd/coding-standard
- Owner: phphd
- License: mit
- Created: 2023-11-09T19:28:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-18T13:48:40.000Z (about 1 year ago)
- Last Synced: 2025-06-22T08:44:47.665Z (about 1 year ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PhPhD Coding Standard
---------------------
## Installation
1. Add VCS repository in `composer.json` to this package:
```json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/phphd/coding-standard"
}
]
}
```
2. Install via composer:
```sh
composer require --dev phphd/coding-standard
```
3. Add a set list to your `ecs.php` config file:
```diff
+use PhPhD\CodingStandard\ValueObject\Set\PhdSetList;
use Symplify\EasyCodingStandard\Config\ECSConfig;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([__DIR__.'/']);
$ecsConfig->skip([__DIR__.'/vendor']);
+ $ecsConfig->sets([PhdSetList::ecs()->getPath()]);
};
```
4. Add set list to your `rector.php` config file:
```diff
+use PhPhD\CodingStandard\ValueObject\Set\PhdSetList;
use Rector\Config\RectorConfig;
use Rector\ValueObject\PhpVersion;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([__DIR__.'/']);
$rectorConfig->skip([__DIR__.'/vendor']);
+ $rectorConfig->sets([PhdSetList::rector()->getPath()]);
$rectorConfig->phpVersion(PhpVersion::PHP_80);
};
```
5. Run the tools:
```shell
vendor/bin/ecs check
vendor/bin/rector --dry-run
```