Context autowiring | autoconfiguration#125
Open
Guikingone wants to merge 2 commits into
Open
Conversation
pamil
reviewed
Jun 3, 2020
| ->scalarNode('class')->defaultNull()->end() | ||
| ->scalarNode('environment')->defaultNull()->end() | ||
| ->booleanNode('debug')->defaultNull()->end() | ||
| ->booleanNode('autoconfigure')->defaultFalse()->end() |
Member
There was a problem hiding this comment.
I guess those options are not really related to the kernel configuration, so it should be on the same level with bootstrap and kernel options.
|
|
||
| private function handleAutoConfiguration(ContainerBuilder $container): void | ||
| { | ||
| $container->registerForAutoconfiguration(Context::class)->addTag(self::CONTEXT_TAG); |
Member
There was a problem hiding this comment.
This probably won't work, since $container here is Behat's container, not the application's container with all the context services. There's a bundle inside this extension where it is already implemented.
Contributor
|
@Guikingone Hello, let me know if there is an inspiration to continue your work.) |
yannickgranger
pushed a commit
to yannickgranger/SymfonyExtension
that referenced
this pull request
Jan 25, 2026
Extract magic string 'fob.context' to public constant for better maintainability and discoverability. Based on upstream PR FriendsOfBehat#125 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
yannickgranger
added a commit
to yannickgranger/SymfonyExtension
that referenced
this pull request
Jan 25, 2026
* docs: prepare for open-source release and Packagist - Update composer.json: new package name (yannickgranger/symfony-extension), keywords, homepage, support links, branch-alias 3.0-dev - Update LICENSE: add fork maintainer copyright - Add CONTRIBUTING.md: development setup, testing, PR guidelines - Add GitHub templates: issue templates, PR template, CODEOWNERS - Add CHANGELOG v3.0.0: document all fork changes, new features, fixes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: extract CONTEXT_TAG constant for context autoconfiguration Extract magic string 'fob.context' to public constant for better maintainability and discoverability. Based on upstream PR FriendsOfBehat#125 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: add context_discovery option for automatic context detection When enabled, contexts implementing Behat\Context are automatically discovered from the Symfony container without needing explicit behat.yml configuration. Uses autoconfigure to tag Context implementers. - Add DISCOVERED_CONTEXTS_PARAMETER to store discovered context IDs - Store discovered contexts during container compilation - Add context_discovery config option (default: false) - Fall back to discovery when no explicit contexts are available - Explicit contexts still take precedence when configured Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: GRANGER Yannick <ygranger@softwaymedical.fr> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: This PR is opened in order to ease the discussions about the implementation, this is a work in progress 🙂