1313 <em>Share one set of rules across multiple repositories via Composer.</em>
1414</p >
1515
16- ## Features
16+ ## System requirements
1717
18- <picture >
19- <source media="(min-width: 768px)" srcset="./docs/svgs/features.svg">
20- <img src="./docs/svgs/features-mobile.svg" alt="Feature Overview" style="width: 100%;">
21- </picture >
18+ - [ ` PHP ` ] ( https://www.php.net/downloads ) 8.3 or higher.
19+ - [ ` Composer ` ] ( https://getcomposer.org/download/ ) for dependency management.
2220
2321## Installation
2422
2523``` bash
26- composer require php-forge/coding-standard:^0.2 --dev
24+ composer require php-forge/coding-standard:^0.3 --dev
2725```
2826
27+ Or add the dependency manually to ` composer.json ` :
28+
29+ ``` json
30+ {
31+ "require-dev" : {
32+ "php-forge/coding-standard" : " ^0.3"
33+ }
34+ }
35+ ```
36+
37+ Then run ` composer update ` .
38+
2939## Configuration files
3040
3141This package ships shared ECS and Rector configurations under
@@ -127,15 +137,11 @@ return static function (RectorConfig $rectorConfig): void {
127137};
128138```
129139
130- ## Scaffolded distribution (optional)
140+ ## Scaffolded distribution
131141
132- This package is also a [ ` yii2-extensions/scaffold ` ] ( https://github.com/yii2-extensions/scaffold ) provider.
133-
134- When the scaffold plugin is installed and authorized, ` composer install ` distributes the canonical metadata and
135- super-linter configs into your repository root automatically; so the ECS / Rector wrappers above and the shared linter
136- rules stay in lock-step across every repository that opts in.
137-
138- Opt in by adding the plugin and authorizing this package as a provider:
142+ This package is a [ ` yii2-extensions/scaffold ` ] ( https://github.com/yii2-extensions/scaffold ) provider for the
143+ ** root ` ecs.php ` and ` rector.php ` wrapper templates** (sourced from ` src/config/ ` via ` scaffold.json ` ). Consumers can
144+ opt in by allowing the plugin and listing this package as an authorised provider:
139145
140146``` bash
141147composer require yii2-extensions/scaffold:^0.1 --dev
@@ -150,6 +156,7 @@ composer require yii2-extensions/scaffold:^0.1 --dev
150156 },
151157 "extra" : {
152158 "scaffold" : {
159+ "auto" : false ,
153160 "allowed-packages" : [
154161 " php-forge/coding-standard"
155162 ]
@@ -158,45 +165,20 @@ composer require yii2-extensions/scaffold:^0.1 --dev
158165}
159166```
160167
161- On the next ` composer install ` / ` composer update ` , these files land in your repository root:
162-
163- | File | Mode | Purpose |
164- | ------------------------------------ | ---------- | -------------------------------------------------------- |
165- | ` .editorconfig ` | ` replace ` | Editor settings (UTF-8, LF, indent) |
166- | ` .gitattributes ` | ` replace ` | Text/binary handling, archive excludes |
167- | ` .gitignore ` | ` append ` | Common ignore patterns; project-specific lines preserved |
168- | ` .styleci.yml ` | ` replace ` | StyleCI config (PSR-12 + risky) |
169- | ` .ecrc ` | ` replace ` | editor-config-checker exclusions |
170- | ` .prettierignore ` | ` replace ` | Paths Prettier should skip |
171- | ` .prettierrc.json ` | ` replace ` | Prettier formatting rules |
172- | ` .stylelintignore ` | ` replace ` | Paths stylelint should skip |
173- | ` composer-require-checker.json ` | ` preserve ` | Composer require-checker whitelist (project-specific) |
174- | ` .github/linters/actionlint.yml ` | ` replace ` | actionlint config for Super-Linter |
175- | ` .github/linters/.codespellrc ` | ` replace ` | codespell config |
176- | ` .github/linters/.gitleaks.toml ` | ` replace ` | gitleaks config |
177- | ` .github/linters/.markdown-lint.yml ` | ` replace ` | markdownlint config |
178- | ` ecs.php ` | ` preserve ` | ECS wrapper for the project root |
179- | ` rector.php ` | ` preserve ` | Rector wrapper for the project root |
180-
181- Mode semantics:
182-
183- - ` replace ` : lock-step with this package. Local edits trigger a warning and the file is skipped on update.
184- Use ` vendor/bin/scaffold reapply <file> --force ` to re-sync.
185- - ` append ` : provider content is appended to the existing file. Project lines are never blown away.
186- - ` preserve ` : file is written once on first install and never overwritten.
187-
188- The scaffolded ` ecs.php ` / ` rector.php ` ship with ` 83 ` as the default PHP target; switch to ` 81 ` , ` 82 ` , or ` 84 ` to match
189- your minimum PHP version. Mode ` preserve ` protects your edits across ` composer update ` .
190-
191- ### Scaffold commands
168+ With ` auto: false ` , the plugin does not run on ` composer install ` ; sync the wrappers manually:
192169
193170``` bash
194- vendor/bin/scaffold status # show which files are synced/modified/missing
195- vendor/bin/scaffold diff < file> # diff between local and provider version
196- vendor/bin/scaffold reapply [< file> ] [--force] # re-apply provider content
197- vendor/bin/scaffold eject < file> # stop tracking a file (kept on disk)
171+ vendor/bin/scaffold reapply --provider=php-forge/coding-standard
198172```
199173
174+ Both wrappers ship in mode ` preserve ` ; written once on first install, never overwritten so consumer edits to paths
175+ or PHP target version survive subsequent runs.
176+
177+ ## Related packages
178+
179+ For dev environment scaffolding, see [ ` php-forge/baseline ` ] ( https://github.com/php-forge/baseline ) . The two packages
180+ are independent; adopt either, both, or neither.
181+
200182## Composer scripts
201183
202184Follow the same convention used across PHP Forge repositories:
@@ -210,10 +192,6 @@ Follow the same convention used across PHP Forge repositories:
210192}
211193```
212194
213- ## Documentation
214-
215- - 📚 [ Installation Guide] ( docs/installation.md )
216-
217195## Package information
218196
219197[ ![ PHP] ( https://img.shields.io/badge/%3E%3D8.3-777BB4.svg?style=for-the-badge&logo=php&logoColor=white )] ( https://www.php.net/releases/8.3/en.php )
0 commit comments