Development¶
Follow these steps to run tests, check documentation, verify conformance fixtures, and contribute changes to friendsofmago/mago-symfony.
Install dependencies¶
Clone the repository and install Composer dependencies:
composer install
Run the test suite¶
Run the full test suite, conformance catalog validation, and docs test:
php tests/check-spec.php
php tests/docs-test.php
composer test
If you have just installed, run all CI checks, including the Zensical docs build, with one command:
just check-ci
composer test runs php tests/run.php, which executes:
vendor/bin/mago extension validatetests/runtime.php, covering Symfony runtime contract tests and worker checkstests/docs-test.php, covering diagnostic coverage, Zensical navigation andllmstxtparity, and internal Markdown links- Exact diagnostic assertions across JSON map, compiled XML, Security user, plain console, lifecycle,
TreeBuilder, and explicit configuration-error modes
Set MAGO=/path/to/mago with just, or MAGO_BIN=/path/to/mago with php tests/run.php, to test against another Mago binary.
Run self-analysis¶
Analyze src/, bin/, and resources/ against the committed self-analysis baseline:
vendor/bin/mago --config mago-self.toml analyze --no-extensions --reporting-format=json > .mago-self-report.json || true
php tools/self-analyze-gate.php .mago-self-report.json
Run corpus checks, benchmarks, and spec harvesting¶
Run the pinned open-source corpus checks across symfony-demo, symfony, shopware, and drupal:
php tools/corpus-run.php --check
php tools/corpus-run.php --target=symfony-demo,symfony --check
php tools/corpus-run.php --update-baseline
Run local benchmarks and verify conformance hashes:
php bench/run-local.php --iterations=10000 --runs=5
php spec/harvest.php
Build and preview documentation¶
Documentation lives in docs/ and builds with Zensical 0.1.1 from zensical.toml.
Preview locally with live reload on http://127.0.0.1:8000:
just docs
Build into site/ and fail on any broken link or anchor:
just docs-build
Both recipes install Zensical 0.1.1 into .venv/.
Repository layout¶
src/SymfonyExtension.phpdefines the publiccreate()andplugins()entry points.src/Analyzer/SymfonyPlugin.phpregisters thesymfonyanalyzer plugin, its return-type providers, lifecycle initializers, entry points, and analysis hooks.src/Analyzer/TreeBuilderRootTypePlugin.phpregisters thesymfony-tree-builder-rootanalyzer plugin soSymfonyPluginkeeps provider memoization enabled.src/Analyzer/Providers/contains every provider, hook, index, loader, and issue filter.resources/worker.phpandbin/mago-symfony-workerimplement the worker entry points.tests/contains runtime contract checks, fixture suites, andtests/docs-test.php.spec/contains the pinned conformance catalog verified bytests/check-spec.php.
Keep documentation in sync¶
When you add or change a diagnostic code in src/:
- Update the code's entry and summary row in Diagnostics.
- Update the topic page under
docs/analyzer/. - Run
php tests/docs-test.phpandjust docs-build.
When you add a new Markdown page under docs/:
- Add the page to
navinzensical.toml. - Add the same page in the exact same order under
[project.plugins.llmstxt.sections]inzensical.toml. - Run
php tests/docs-test.phpandjust docs-build.