Skip to content

Allow configuring the Symfony AI and UX versions used in class links#206

Open
Amoifr wants to merge 1 commit into
symfony-tools:mainfrom
Amoifr:fix-199-configurable-ai-ux-versions
Open

Allow configuring the Symfony AI and UX versions used in class links#206
Amoifr wants to merge 1 commit into
symfony-tools:mainfrom
Amoifr:fix-199-configurable-ai-ux-versions

Conversation

@Amoifr

@Amoifr Amoifr commented Jul 11, 2026

Copy link
Copy Markdown

The :class: directive supports Symfony AI (#196) and Symfony UX (#198) classes, but the generated URLs have their versions hardcoded to main and 2.x in ClassReference. This makes them configurable, following the same pattern as the Symfony version.

BuildConfig gains two versions, defaulting to the current values, so nothing changes unless you opt in:

$buildConfig = (new BuildConfig())
    ->setSymfonyVersion('7.4')
    ->setSymfonyAiVersion('1.0')   // defaults to 'main'
    ->setSymfonyUxVersion('3.x')   // defaults to '2.x'
;

The two URLs become placeholder constants (like SYMFONY_REPOSITORY_URL), ClassReference receives them instead of hardcoding the branches, and KernelFactory — its only instantiation site — passes them along.

About the tests:

  • the existing blocks/references/class fixture passes untouched, which shows the defaults preserve the current output;
  • the new tests cover both monorepos, including the slugged sub-repository case (Symfony\AI\AiBundleai-bundle);
  • I double-checked they aren't vacuous: putting the branches back in ClassReference makes exactly the 3 configured AI/UX cases fail, while the Symfony one and the defaults stay green.

One thing I noticed while tracing the wiring, and deliberately left alone: Application::__construct() takes $symfonyVersion but never passes it to BuildConfig, so the --symfony-version CLI option looks like it has no effect. That's a separate matter — happy to open an issue if you'd like.

Fixes #199

Thanks for maintaining the tooling that keeps the docs building. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add support for versioning of Symfony AI and UX links

1 participant