Skip to content

Commit 25523c5

Browse files
coisagithub-actions[bot]Copilot
authored
[composer] Scope ProxyCommand under composer adapter (#270)
* feat(composer): add command runtime hybrid foundation * refactor composer json handling away from composer json utility classes * refactor: complete composer-command migration and cleanup for dev-tools * Update wiki submodule pointer for PR #270 * refactor: remove logger-aware command interface * Update wiki submodule pointer for PR #270 * feat: change dirname e basename method names Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com> * feat: change dirname e basename method names Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com> * Fix coverage metadata and stabilize dev-tools command tests * Update wiki submodule pointer for PR #270 * fix: align composer command provider test with proxy map keys * refactor: centralize command retrieval through DevTools API * Update wiki submodule pointer for PR #270 * fix: avoid registering command aliases in composer provider * Update wiki submodule pointer for PR #270 * test: guard composer provider against alias-only command entries * test: align DevTools test with Application::all loader contract * test: document alias filtering and cover command alias registration * test: cover alias preservation in composer command provider * test: avoid command provider assertions depending on map keys * chore: align standards php-cs-fixer naming and harden command loader * Update wiki submodule pointer for PR #270 * refactor: rename dockblock references to docheader * chore: normalize phpdoc command naming and docs * docs: fix heading formatting in rector-and-phpdoc.rst Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com> * test: centralize tooling excluded directories and cleanup fixture handling * Update wiki submodule pointer for PR #270 * feat: add ignoreErrorsOnPackage for 'composer/composer' in configuration Co-authored-by: Copilot <copilot@github.com> Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com> * docs: update phpdoc section to clarify aliases and functionality Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com> * docs: update parameter descriptions for SymfonyStyle in command classes Co-authored-by: Copilot <copilot@github.com> Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com> * Update wiki submodule pointer for PR #270 --------- Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <copilot@github.com>
1 parent 686eab0 commit 25523c5

79 files changed

Lines changed: 1028 additions & 459 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/phpunit-tests/SKILL.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,57 @@ Choose the smallest command that proves the change.
8383
- Re-run after fixes until the targeted tests pass.
8484
- If failures come from unrelated pre-existing breakage, call that out separately and do not silently claim success.
8585

86+
### Composer plugin validation flow
87+
88+
Some repository test scenarios are only valid when DevTools is executed as a Composer plugin.
89+
Create a temporary fixture under `backup/` before running plugin-based verification.
90+
91+
```bash
92+
PROJECT_ROOT="$(pwd)"
93+
PLUGIN_FIXTURE="$PROJECT_ROOT/backup/composer-plugin-consumer"
94+
mkdir -p "$PROJECT_ROOT/backup"
95+
rm -rf "$PLUGIN_FIXTURE"
96+
mkdir -p "$PLUGIN_FIXTURE"
97+
98+
cat > "$PLUGIN_FIXTURE/composer.json" <<'JSON'
99+
{
100+
"name": "fast-forward/dev-tools-composer-plugin-consumer-fixture",
101+
"description": "Fixture project used to validate DevTools plugin behavior.",
102+
"license": "MIT",
103+
"type": "project",
104+
"require": {
105+
"fast-forward/dev-tools": "*@dev"
106+
},
107+
"repositories": [
108+
{
109+
"type": "path",
110+
"url": "../..",
111+
"options": {
112+
"symlink": true
113+
}
114+
}
115+
],
116+
"minimum-stability": "dev",
117+
"prefer-stable": true,
118+
"config": {
119+
"allow-plugins": {
120+
"ergebnis/composer-normalize": true,
121+
"fast-forward/dev-tools": true,
122+
"phpdocumentor/shim": true,
123+
"phpro/grumphp-shim": true,
124+
"pyrech/composer-changelogs": true
125+
}
126+
},
127+
"scripts": {
128+
"dev-tools": "dev-tools",
129+
"dev-tools:fix": "@dev-tools --fix"
130+
}
131+
}
132+
JSON
133+
134+
cd "$PLUGIN_FIXTURE"
135+
composer install
136+
composer tests
137+
```
138+
86139
Read [references/generation-checklist.md](references/generation-checklist.md) before writing or repairing tests in an unfamiliar repository.

.github/wiki

Submodule wiki updated from 3dea0d4 to c99c7cd

.php-cs-fixer.dist.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
declare(strict_types=1);
44

5+
require __DIR__ . '/vendor/autoload.php';
6+
7+
use FastForward\DevTools\Path\WorkingProjectPathResolver;
8+
59
$rules = [
610
'phpdoc_indent' => true,
711
'phpdoc_order' => [
@@ -39,11 +43,7 @@
3943

4044
$finder = PhpCsFixer\Finder::create()
4145
->in([getcwd()])
42-
->exclude('public')
43-
->exclude('resources')
44-
->exclude('vendor')
45-
->exclude('tmp')
46-
;
46+
->exclude(WorkingProjectPathResolver::TOOLING_EXCLUDED_DIRECTORIES);
4747

4848
return (new PhpCsFixer\Config())
4949
->setRiskyAllowed(false)

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add a hybrid command runtime bootstrap and capability bridge that keeps command discovery split between migrated Symfony commands (`DevTools`) and legacy Composer `BaseCommand` commands (`DevToolsComposer`) while exposing proxy commands during Composer execution for the first migration step (#199)
13+
14+
### Changed
15+
16+
- Restore `standards:phpdoc` as the command entry point for PHPDoc checks while keeping
17+
the legacy aliases `docheader` and `php-cs-fixer`.
18+
- Remove the `phpdoc` alias from `reports:docs` to avoid command-name collisions with
19+
the standards PHPDoc check command.
20+
1021
## [1.22.3] - 2026-04-25
1122

1223
### Fixed

bin/dev-tools.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
namespace FastForward\DevTools;
2121

2222
use FastForward\DevTools\Console\DevTools;
23-
use Symfony\Component\Console\Input\ArgvInput;
2423

2524
$projectVendorAutoload = \dirname(__DIR__, 4) . '/vendor/autoload.php';
2625
$pluginVendorAutoload = \dirname(__DIR__) . '/vendor/autoload.php';
2726

2827
require_once file_exists($projectVendorAutoload) ? $projectVendorAutoload : $pluginVendorAutoload;
2928

30-
DevTools::create()->run(new ArgvInput([...$argv, '--no-plugins']));
29+
DevTools::create()->run();

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"require": {
4242
"php": "^8.3",
4343
"composer-plugin-api": "^2.0",
44-
"composer/composer": "^2.9",
4544
"container-interop/service-provider": "^0.4.1",
4645
"dg/bypass-finals": "^1.9",
4746
"ergebnis/agent-detector": "^1.1",
@@ -82,6 +81,9 @@
8281
"thecodingmachine/safe": "^3.4",
8382
"twig/twig": "^3.24"
8483
},
84+
"require-dev": {
85+
"composer/composer": "^2.9"
86+
},
8587
"minimum-stability": "stable",
8688
"autoload": {
8789
"psr-4": {

docs/api/commands.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ subprocess execution is needed.
3737
- ``refactor``
3838
- Runs Rector with local or packaged configuration.
3939
* - ``FastForward\DevTools\Console\Command\PhpDocCommand``
40-
- ``phpdoc``
41-
- Runs PHP-CS-Fixer and a focused Rector PHPDoc pass.
40+
- ``standards:phpdoc``
41+
- Runs PHP-CS-Fixer and a focused Rector PHPDoc pass. Supported aliases:
42+
``phpdoc``, ``docheader`` and ``php-cs-fixer``.
4243
* - ``FastForward\DevTools\Console\Command\CodeStyleCommand``
4344
- ``code-style``
4445
- Runs Composer Normalize and ECS.

docs/commands/funding.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Options
3333

3434
``--composer-file`` (optional)
3535
Path to the Composer manifest to synchronize. Default:
36-
``Factory::getComposerFile()``.
36+
``composer.json``.
3737

3838
``--funding-file`` (optional)
3939
Path to the GitHub funding file to synchronize. Default:

docs/commands/metrics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Options
3333
Comma-separated directories that should be excluded from analysis.
3434

3535
Default:
36-
``vendor,tmp,cache,spec,build,.dev-tools,backup,resources,tests/Fixtures``.
36+
``vendor,tmp,cache,spec,build,.dev-tools,backup,resources``.
3737

3838
``--target=<directory>``
3939
Output directory for the generated metrics reports.

docs/commands/phpdoc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Description
77
-----------
88

99
The ``phpdoc`` command coordinates PHPDoc checking and fixing using:
10+
(alias ``docheader`` and ``php-cs-fixer``)
1011

1112
- PHP-CS-Fixer - fixes PHPDoc formatting
1213
- Rector with ``AddMissingMethodPhpDocRector`` - adds missing method PHPDoc

0 commit comments

Comments
 (0)